Version
0.7.1
Description
Shell completions for ouch compress can show misleading completion descriptions.
Current Behavior
When I'm typing ouch compress (a space in the end), the hint shows:
~/Projects/test
> ls
file.txt
~/Projects/test
> ouch compress
output -- The resulting file. Its extensions can be used to specify the compression formats // completion desc
Then, I continue typing ouch compress file.txt (a space in the end):
~/Projects/test
> ouch compress file.txt
files -- Files to be compressed // completion desc
This is confusing because users expect ouch compress <FILES>... <OUTPUT>, but completion description can make it look as ouch compress <OUTPUT> <FILES>....
Expected Behavior
Completion descriptions should reflect the documented argument order: ouch compress <FILES>... <OUTPUT>. They should not suggest that the output archive comes before the input files.
Likely Cause
CAUTION: The content in this section is suggested by openai/gpt-5.5.
// src/cli/args.rs
Subcommand::Compress {
/// Files to be compressed
#[arg(required = true, value_hint = ValueHint::FilePath)]
files: Vec<PathBuf>,
/// The resulting file. Its extensions can be used to specify the compression formats
#[arg(required = true, value_hint = ValueHint::FilePath)]
output: PathBuf,
}
A variadic positional argument followed by another required positional is parseable once the full command is known, but it is inherently hard for shell completion because the command line is incomplete while completion is being requested.
build.rs appears to only expose this via generated completions:
for shell in Shell::value_variants() {
generate_to(*shell, cmd, "ouch", out).unwrap();
}
Possible Fixes
CAUTION: The content in this section is suggested by openai/gpt-5.5.
-
Prefer an explicit output option for future CLI shape, e.g.
ouch compress file1 file2 --output archive.zip
This removes the ambiguity for completions.
-
If preserving the current syntax is required, add custom completion behavior for compress so completions do not present misleading files/output labels.
-
At minimum, adjust generated/manual completion text to avoid suggesting that output comes before input files.
Related
Version
0.7.1
Description
Shell completions for
ouch compresscan show misleading completion descriptions.Current Behavior
When I'm typing
ouch compress(a space in the end), the hint shows:Then, I continue typing
ouch compress file.txt(a space in the end):This is confusing because users expect
ouch compress <FILES>... <OUTPUT>, but completion description can make it look asouch compress <OUTPUT> <FILES>....Expected Behavior
Completion descriptions should reflect the documented argument order:
ouch compress <FILES>... <OUTPUT>. They should not suggest that the output archive comes before the input files.Likely Cause
CAUTION: The content in this section is suggested by
openai/gpt-5.5.A variadic positional argument followed by another required positional is parseable once the full command is known, but it is inherently hard for shell completion because the command line is incomplete while completion is being requested.
build.rsappears to only expose this via generated completions:Possible Fixes
CAUTION: The content in this section is suggested by
openai/gpt-5.5.Prefer an explicit output option for future CLI shape, e.g.
This removes the ambiguity for completions.
If preserving the current syntax is required, add custom completion behavior for
compressso completions do not present misleadingfiles/outputlabels.At minimum, adjust generated/manual completion text to avoid suggesting that
outputcomes before input files.Related