2022-10-31 12:11:01 +00:00
|
|
|
module completions {
|
|
|
|
|
2022-11-01 04:03:16 +00:00
|
|
|
def "nu-complete my-app choice" [] {
|
2022-10-31 12:11:01 +00:00
|
|
|
[ "first" "second" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Tests completions
|
|
|
|
export extern my-app [
|
2022-11-02 10:40:20 +00:00
|
|
|
file?: string # some input file
|
2024-02-16 20:57:54 +00:00
|
|
|
--config(-c) # some config file with another line
|
|
|
|
--conf # some config file with another line
|
|
|
|
-C # some config file with another line
|
2022-11-01 04:03:16 +00:00
|
|
|
choice?: string@"nu-complete my-app choice"
|
2023-05-23 13:50:43 +00:00
|
|
|
--help(-h) # Print help
|
2023-01-24 08:26:54 +00:00
|
|
|
--version(-V) # Print version
|
2022-10-31 12:11:01 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# tests things
|
|
|
|
export extern "my-app test" [
|
2022-11-02 10:40:20 +00:00
|
|
|
--case: string # the case to test
|
2023-05-23 13:50:43 +00:00
|
|
|
--help(-h) # Print help
|
2023-01-24 08:26:54 +00:00
|
|
|
--version(-V) # Print version
|
2022-10-31 12:11:01 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# tests other things
|
|
|
|
export extern "my-app some_cmd" [
|
2022-11-02 10:40:20 +00:00
|
|
|
--config: string # the other case to test
|
2022-11-02 03:58:54 +00:00
|
|
|
...path: string
|
2023-05-23 13:50:43 +00:00
|
|
|
--help(-h) # Print help
|
2023-01-24 08:26:54 +00:00
|
|
|
--version(-V) # Print version
|
2022-10-31 12:11:01 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
export extern "my-app some-cmd-with-hyphens" [
|
2023-05-23 13:50:43 +00:00
|
|
|
--help(-h) # Print help
|
2023-01-24 08:26:54 +00:00
|
|
|
--version(-V) # Print version
|
2022-10-31 12:11:01 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
export extern "my-app some-hidden-cmd" [
|
2023-05-23 13:50:43 +00:00
|
|
|
--help(-h) # Print help
|
2023-01-24 08:26:54 +00:00
|
|
|
--version(-V) # Print version
|
2022-10-31 12:11:01 +00:00
|
|
|
]
|
|
|
|
|
2023-05-23 13:50:43 +00:00
|
|
|
# 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" [
|
|
|
|
]
|
|
|
|
|
2022-10-31 12:11:01 +00:00
|
|
|
}
|
|
|
|
|
2023-09-11 09:40:59 +00:00
|
|
|
export use completions *
|