mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00
✨ add flutter
completions (#792)
Just a barebones `flutter` command and `flutter pub` commands, the most used ones
This commit is contained in:
parent
c2ef662e48
commit
191636af9c
1 changed files with 41 additions and 0 deletions
41
custom-completions/flutter/flutter-completions.nu
Normal file
41
custom-completions/flutter/flutter-completions.nu
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
export extern "flutter" [
|
||||||
|
command?: string@"nu-complete flutter commands"
|
||||||
|
--help(-h) # Print this usage information.
|
||||||
|
--verbose(-v) # Noisy logging, including all shell commands executed.
|
||||||
|
--device-id(-d) # Target device id or name (prefixes allowed).
|
||||||
|
--version # Reports the version of this tool.
|
||||||
|
--enable-analytics # Enable telemetry reporting each time a flutter or dart command runs.
|
||||||
|
--disable-analytics # Disable telemetry reporting each time a flutter or dart command runs, until it is re-enabled.
|
||||||
|
--suppress-analytics # Suppress analytics reporting for the current CLI invocation.
|
||||||
|
]
|
||||||
|
|
||||||
|
def "nu-complete flutter commands" [] {
|
||||||
|
^flutter --help
|
||||||
|
| into string
|
||||||
|
| str replace --regex --multiline '(Manage[\s\S]*(?=Flutter SDK))' ''
|
||||||
|
| lines
|
||||||
|
| filter { str starts-with " " }
|
||||||
|
| each { str trim }
|
||||||
|
| parse "{value} {description}"
|
||||||
|
| str trim
|
||||||
|
}
|
||||||
|
|
||||||
|
export extern "flutter create" [
|
||||||
|
project: string # project to create
|
||||||
|
]
|
||||||
|
|
||||||
|
export extern "flutter pub" [
|
||||||
|
command?: string@"nu-complete pub commands"
|
||||||
|
]
|
||||||
|
|
||||||
|
def "nu-complete pub commands" [] {
|
||||||
|
^flutter pub --help
|
||||||
|
| into string
|
||||||
|
| str replace --regex --multiline '(Commands[\s\S]*(?=Available subcommands))' ''
|
||||||
|
| lines
|
||||||
|
| filter { str starts-with " " }
|
||||||
|
| each { str trim }
|
||||||
|
| parse "{value} {description}"
|
||||||
|
| str trim
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue