Skip to content

Commit

Permalink
Merge pull request #5309 from epage/long
Browse files Browse the repository at this point in the history
fix(complete): Don't provide help output for user
  • Loading branch information
epage authored Jan 15, 2024
2 parents a04e455 + 6fcba98 commit f7a2e46
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions clap_complete/src/dynamic/shells/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::dynamic::Completer as _;
#[derive(clap::Subcommand)]
#[allow(missing_docs)]
#[derive(Clone, Debug)]
#[command(about = None, long_about = None)]
pub enum CompleteCommand {
/// Register shell completions for this program
#[command(hide = true)]
Expand All @@ -31,6 +32,7 @@ pub enum CompleteCommand {
#[command(group = clap::ArgGroup::new("complete").multiple(true).conflicts_with("register"))]
#[allow(missing_docs)]
#[derive(Clone, Debug)]
#[command(about = None, long_about = None)]
pub struct CompleteArgs {
/// Specify shell to complete for
#[arg(long)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ set edit:completion:arg-completer[exhaustive] = {|@words|
&'exhaustive'= {
cand --generate 'generate'
cand --global 'everywhere'
cand -h 'Print help (see more with ''--help'')'
cand --help 'Print help (see more with ''--help'')'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
cand action 'action'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
complete -c exhaustive -n "__fish_use_subcommand" -l generate -d 'generate' -r -f -a "{bash '',elvish '',fish '',powershell '',zsh ''}"
complete -c exhaustive -n "__fish_use_subcommand" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_use_subcommand" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c exhaustive -n "__fish_use_subcommand" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_use_subcommand" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_use_subcommand" -f -a "action"
complete -c exhaustive -n "__fish_use_subcommand" -f -a "quote"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ _exhaustive() {
_arguments "${_arguments_options[@]}" \
'--generate=[generate]:SHELL:(bash elvish fish powershell zsh)' \
'--global[everywhere]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_exhaustive_commands" \
Expand Down

0 comments on commit f7a2e46

Please sign in to comment.