test(completion): add regression test for fish quoting issue

This commit is contained in:
Gibson Fahnestock 2022-02-14 19:22:06 +00:00
parent 86864b004b
commit 0fbabaa3fe
No known key found for this signature in database
GPG key ID: B01FBB92821C587A

View file

@ -1,3 +1,5 @@
use clap::PossibleValue;
use super::*;
fn build_app() -> App<'static> {
@ -172,6 +174,7 @@ fn build_app_sub_subcommands() -> App<'static> {
Arg::new("config")
.long("--config")
.takes_value(true)
.possible_values([PossibleValue::new("Lest quotes aren't escaped.")])
.help("the other case to test"),
),
),
@ -190,7 +193,7 @@ complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and not __fish_seen
complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from sub_cmd; and not __fish_seen_subcommand_from help" -s V -l version -d 'Print version information'
complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from sub_cmd; and not __fish_seen_subcommand_from help" -f -a "sub_cmd" -d 'sub-subcommand'
complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from sub_cmd; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from sub_cmd" -l config -d 'the other case to test' -r
complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from sub_cmd" -l config -d 'the other case to test' -r -f -a "{Lest quotes aren't escaped. }"
complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from sub_cmd" -s h -l help -d 'Print help information'
complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from sub_cmd" -s V -l version -d 'Print version information'
complete -c my_app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from help" -s h -l help -d 'Print help information'