clap/tests/snapshots/sub_subcommands.nu

41 lines
932 B
Text
Raw Normal View History

2022-10-22 15:27:04 +00:00
module completions {
2022-10-31 12:11:01 +00:00
def "my-app choice" [] {
[ "first" "second" ]
}
2022-10-22 15:27:04 +00:00
# Tests completions
export extern my-app [
file?: string # some input file
--config(-c) # some config file
2022-10-31 10:32:40 +00:00
--conf # some config file
-C # some config file
2022-10-31 12:11:01 +00:00
choice?: string@"my-app choice"
2022-10-22 15:27:04 +00:00
--version(-V) # Print version information
]
# tests things
export extern "my-app test" [
--case: string # the case to test
--version(-V) # Print version information
]
# top level subcommand
export extern "my-app some_cmd" [
--version(-V) # Print version information
]
2022-10-31 12:11:01 +00:00
def "my-app some_cmd sub_cmd config" [] {
[ "Lest quotes, aren't escaped." "Second to trigger display of options" ]
}
2022-10-22 15:27:04 +00:00
# sub-subcommand
export extern "my-app some_cmd sub_cmd" [
2022-10-31 12:11:01 +00:00
--config: string@"my-app some_cmd sub_cmd config" # the other case to test
2022-10-22 15:27:04 +00:00
--version(-V) # Print version information
]
}
use completions *