Skip to content

Commit

Permalink
fix: Is option?
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jul 6, 2024
1 parent e276fc4 commit 4f45406
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion clap_complete/src/shells/fish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ fn gen_subcommand_helpers(
}
optspecs.push_str(&escape_string(long, false));
}
if option.is_required_set() {

let is_an_option = option.get_num_args().map(|r| r.takes_values()).unwrap_or(true);
if is_an_option {
optspecs.push('=');
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Print an optspec for argparse to handle cmd's options that are independent of any subcommand.
function __fish_exhaustive_global_optspecs
string join \n global generate h/help V/version
string join \n global generate= h/help V/version
end

function __fish_exhaustive_needs_command
Expand Down

0 comments on commit 4f45406

Please sign in to comment.