Skip to content

Completions for ank apply do not work as expected #614

@krucod3

Description

@krucod3

The clap completions for ank-apply do not work as expected.

If you try to auto-complete the path to a manifest, a space " " is added after every level (folder) on the path.
When the space is deleted, the completion works again and the next level can be searched for.

Current Behavior

Space added after every folder

Expected Behavior

No space added

Steps to Reproduce

  1. enter ank apply <start of folder name >
  2. Tab
  3. observe

Context (Environment)

Ankaios 0.5, 0.6, 0.7, main

Logs

Additional Information

Final result

I tried to reduce the struct ApplyArgs to see if the problem comes from there, but it seems like it's somewhere else.

This does not fix the problem:

#[derive(clap::Args, Debug)]
pub struct ApplyArgs {
    #[arg(long, short, value_hint = ValueHint::FilePath)]
    pub file: Option<PathBuf>,
}

Note that the Vec was also changed with Option and this did not solve the problem either.

The example in clap is working as expected without spaces:

I compared the derive attributes and could not find an obvious mistake.

We should build a minimal example from our cli.rs code and see what causes the problem.
It is also possible that we have found a clap bug that we need to log.

To be filled by the one closing the issue.

Metadata

Metadata

Assignees

Labels

blockedbugSomething isn't working. Issue will appear in the change log "Bug Fixes"good first issueGood for newcomers

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions