From 231db68806f69a3b99e0ac10dd5b9a8cb514b351 Mon Sep 17 00:00:00 2001 From: Kamlesh Date: Mon, 20 Jul 2020 00:13:15 -0400 Subject: [PATCH 1/2] Update new completions for Flutter closes https://github.com/zsh-users/zsh-completions/issues/682 Add new completions for the Flutter CLI --- src/_flutter | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/_flutter b/src/_flutter index c63a5d9..1d813f1 100644 --- a/src/_flutter +++ b/src/_flutter @@ -340,7 +340,31 @@ _arguments -C -A "-*" \ '(-h --help)'{-h,--help}'[Print this usage information.]' \ && ret=0 ;; - + (assemble) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; + (attach) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; + (bash-completion) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; + (emulators) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; + (version) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; esac ;; esac @@ -380,7 +404,12 @@ _root_commands() { 'test:Run Flutter unit tests for the current project.' 'trace:Start and stop tracing for a running Flutter app.' 'update-packages:Update the packages inside the Flutter repo.' - 'upgrade:Upgrade your copy of Flutter.') + 'upgrade:Upgrade your copy of Flutter.' + 'assemble:Assemble and build flutter resources.' + 'attach:Attach to a running application.' + 'bash-completion:Output command line shell completion setup scripts.' + 'emulators:List, launch and create emulators.' + 'version:List or switch flutter versions.') _describe -t commands 'command' commands "$@" } From 31c76d90a7e626f3d3bd65590e0dc8acda7dc545 Mon Sep 17 00:00:00 2001 From: Kamlesh Date: Mon, 20 Jul 2020 22:38:46 -0400 Subject: [PATCH 2/2] incporporated code review comments incporporated code review comments from @syohex --- src/_flutter | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/_flutter b/src/_flutter index 1d813f1..a2ba6c4 100644 --- a/src/_flutter +++ b/src/_flutter @@ -86,6 +86,21 @@ _arguments -C -A "-*" \ '--no-preamble[When analyzing the flutter repository, display the number of files that will be analyzed. (defaults to on)]' \ && ret=0 ;; + (assemble) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; + (attach) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; + (bash-completion) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; (build) _arguments -C \ '1: :_build_entities' \ @@ -169,6 +184,11 @@ _arguments -C -A "-*" \ '--no-preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \ && ret=0 ;; + (emulators) + _arguments -C \ + '(-h --help)'{-h,--help}'[Print this usage information.]' \ + && ret=0 + ;; (format) _arguments -C \ '(-h --help)'{-h,--help}'[Print this usage information.]' \ @@ -340,26 +360,6 @@ _arguments -C -A "-*" \ '(-h --help)'{-h,--help}'[Print this usage information.]' \ && ret=0 ;; - (assemble) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (attach) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (bash-completion) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; - (emulators) - _arguments -C \ - '(-h --help)'{-h,--help}'[Print this usage information.]' \ - && ret=0 - ;; (version) _arguments -C \ '(-h --help)'{-h,--help}'[Print this usage information.]' \ @@ -380,6 +380,9 @@ _root_commands() { local commands; commands=( "analyze:Analyze the project's Dart code." + 'assemble:Assemble and build flutter resources.' + 'attach:Attach to a running application.' + 'bash-completion:Output command line shell completion setup scripts.' 'build:Flutter build commands.' 'channel:List or switch flutter channels.' 'clean:Delete the build/ directory.' @@ -389,6 +392,7 @@ _root_commands() { 'devices:List all connected devices.' 'doctor:Show information about the installed tooling.' 'drive:Runs Flutter Driver tests for the current project.' + 'emulators:List, launch and create emulators.' 'format:Format one or more dart files.' 'fuchsia_reload:Hot reload on Fuchsia.' 'help:Display help information for flutter.' @@ -405,10 +409,6 @@ _root_commands() { 'trace:Start and stop tracing for a running Flutter app.' 'update-packages:Update the packages inside the Flutter repo.' 'upgrade:Upgrade your copy of Flutter.' - 'assemble:Assemble and build flutter resources.' - 'attach:Attach to a running application.' - 'bash-completion:Output command line shell completion setup scripts.' - 'emulators:List, launch and create emulators.' 'version:List or switch flutter versions.') _describe -t commands 'command' commands "$@" }