mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
45a7c2e37e
The generated scripts can be used as script, module and overlay. * script `source completion_script.nu` * module `use completion_script.nu *` * overlay `overlay use completion_script.nu`
67 lines
1.6 KiB
Text
67 lines
1.6 KiB
Text
module completions {
|
|
|
|
def "nu-complete my-app choice" [] {
|
|
[ "first" "second" ]
|
|
}
|
|
|
|
# Tests completions
|
|
export extern my-app [
|
|
file?: string # some input file
|
|
--config(-c) # some config file
|
|
--conf # some config file
|
|
-C # some config file
|
|
choice?: string@"nu-complete my-app choice"
|
|
--help(-h) # Print help
|
|
--version(-V) # Print version
|
|
]
|
|
|
|
# tests things
|
|
export extern "my-app test" [
|
|
--case: string # the case to test
|
|
--help(-h) # Print help
|
|
--version(-V) # Print version
|
|
]
|
|
|
|
# tests other things
|
|
export extern "my-app some_cmd" [
|
|
--config: string # the other case to test
|
|
...path: string
|
|
--help(-h) # Print help
|
|
--version(-V) # Print version
|
|
]
|
|
|
|
export extern "my-app some-cmd-with-hyphens" [
|
|
--help(-h) # Print help
|
|
--version(-V) # Print version
|
|
]
|
|
|
|
export extern "my-app some-hidden-cmd" [
|
|
--help(-h) # Print help
|
|
--version(-V) # Print version
|
|
]
|
|
|
|
# Print this message or the help of the given subcommand(s)
|
|
export extern "my-app help" [
|
|
]
|
|
|
|
# tests things
|
|
export extern "my-app help test" [
|
|
]
|
|
|
|
# tests other things
|
|
export extern "my-app help some_cmd" [
|
|
]
|
|
|
|
export extern "my-app help some-cmd-with-hyphens" [
|
|
]
|
|
|
|
export extern "my-app help some-hidden-cmd" [
|
|
]
|
|
|
|
# Print this message or the help of the given subcommand(s)
|
|
export extern "my-app help help" [
|
|
]
|
|
|
|
}
|
|
|
|
export use completions *
|