Compare commits

...

7 Commits

Author SHA1 Message Date
Shohei YOSHIDA 8d93e4c1ee
Merge pull request #1223 from zsh-users/update-golang
Update golang completion to version 1.26.0
2026-02-15 23:29:28 +09:00
Shohei YOSHIDA 3429cd2c1f
Merge pull request #1222 from zsh-users/update-flutter
Update flutter and dart completions
2026-02-15 23:29:09 +09:00
Shohei YOSHIDA 4dbdbd4f8b
Update 'go tool pprof' options 2026-02-13 15:06:34 +09:00
Shohei YOSHIDA 5a5edf6914
update fix subcommand for go 1.26 2026-02-12 16:57:28 +09:00
Shohei YOSHIDA 39b0b06c15
Update flutter completions to version 3.41 2026-02-12 15:58:10 +09:00
Shohei YOSHIDA d4af3659cc
update dart completion to version 3.11 2026-02-12 15:49:35 +09:00
Shohei YOSHIDA 46c88449e6
Support new subcommand 'widget-preview' completion 2026-02-12 10:10:04 +09:00
3 changed files with 320 additions and 172 deletions

View File

@ -24,7 +24,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for dart 3.9.0 (https://dart.dev/) # Completion script for dart 3.11.0 (https://dart.dev/)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -362,6 +362,7 @@ _dart_pub() {
(add|get|remove|upgrade) (add|get|remove|upgrade)
opts+=( opts+=(
'--precompile[Build executables in immediate dependencies]' '--precompile[Build executables in immediate dependencies]'
'--no-example[Do not run "example/" if it exists]'
) )
;| ;|
(get) (get)
@ -373,6 +374,7 @@ _dart_pub() {
opts+=( opts+=(
'(-f --force)'{-f,--force}'[Publish without confirmation if there are no errors]' '(-f --force)'{-f,--force}'[Publish without confirmation if there are no errors]'
'--skip-validation[Publish without validation and resolution]' '--skip-validation[Publish without validation and resolution]'
'--ignore-warnings[Do not treat warnings as fatal]'
) )
;| ;|
(upgrade) (upgrade)

View File

@ -25,7 +25,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for the Flutter.io sdk's cli tool 3.35.1 (https://flutter.dev) # Completion script for the Flutter.io sdk's cli tool 3.41.1 (https://flutter.dev)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -106,16 +106,15 @@ _flutter() {
(assemble) (assemble)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
\*{-d,--define=}'[Allows passing configuration to a target]:configuration' \ \*{-D,--dart-define=}'[Additional key-value pairs that will be available as constants]:define' \
'--performance-measurement-file[Output individual target performance to a JSON file]' \
{-i,--input=}'[Allows passing additional input]: :' \
'--depfile=[A file path where a depfile will be written]: :_path_files' \
'--build-inputs=[A file path where a newline-separated file containing all inputs used will be written after a build]: :_path_files' \
'--build-outputs=[A file path where a newline-separated file containing all outputs used will be written after a build]: :_path_files' \
'(-o --output)'{-o,--output=}'[A directory where output files will be written]: :_path_files -/' \
'*--dart-define=[Additional key-value pairs that will be available as constants]:' \
'--dart-define-from-file=[The path of a json format file where flutter define a global constant pool]: :_files -g "*.(json|env)"' \ '--dart-define-from-file=[The path of a json format file where flutter define a global constant pool]: :_files -g "*.(json|env)"' \
'--resource-pool-size=[The maximum number of concurrent tasks the build system will run]:number:' \ '--performance-measurement-file[Output individual target performance to a JSON file]' \
{-i,--input=}'[Allows passing additional input]::input' \
'--depfile=[A file path where a depfile will be written]:file:_files' \
'--build-inputs=[A file path where a newline-separated file containing all inputs used will be written after a build]:files:_files' \
'--build-outputs=[A file path where a newline-separated file containing all outputs used will be written after a build]:files:_files' \
'(-o --output)'{-o,--output=}'[A directory where output files will be written]:dir:_files -/' \
'--resource-pool-size=[The maximum number of concurrent tasks the build system will run]:number' \
&& ret=0 && ret=0
;; ;;
(attach) (attach)
@ -126,15 +125,15 @@ _flutter() {
'(-t --target)'{-t,--target=}'[The main entry-point file of the application, as run on the device.(defaults to "lib/main.dart")]::_files -g "*.dart"' \ '(-t --target)'{-t,--target=}'[The main entry-point file of the application, as run on the device.(defaults to "lib/main.dart")]::_files -g "*.dart"' \
'--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \ '--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \
'--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \ '--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \
'*--dart-define=[Additional key-value pairs that will be available as constants]:' \ \*{-D,--dart-define=}'[Additional key-value pairs that will be available as constants]:define' \
'--dart-define-from-file=[The path of a json format file where flutter define a global constant pool]: :_files -g "*.(json|env)"' \ '--dart-define-from-file=[The path of a json format file where flutter define a global constant pool]: :_files -g "*.(json|env)"' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \ '--device-user=[Identifier number for a user or work profile on Android only]:id' \
'--debug-url=[The URL at which the observatory is listening]:url:' \ '--debug-url=[The URL at which the observatory is listening]:url' \
'--app-id=[The package name (Android) or bundle identifier (iOS) for the app]:app_id:' \ '--app-id=[The package name (Android) or bundle identifier (iOS) for the app]:app_id' \
'--pid-file=[Specify a file to write the process id to]: :_files' \ '--pid-file=[Specify a file to write the process id to]:file:_files' \
'(--no-track-widget-creation --track-widget-creation)--track-widget-creation[Track widget creation location(defaults on)]' \ '(--no-track-widget-creation --track-widget-creation)--track-widget-creation[Track widget creation location(defaults on)]' \
'(--no-track-widget-creation --track-widget-creation)--no-track-widget-creation[Not track widget creation locations]' \ '(--no-track-widget-creation --track-widget-creation)--no-track-widget-creation[Not track widget creation locations]' \
'--dds-port=[When this value is provided, the Dart Development Service (DDS) will be bound to the provided port]:port:' \ '--dds-port=[When this value is provided, the Dart Development Service (DDS) will be bound to the provided port]:port' \
'(--no-dds --dds)--dds[Enable the Dart Developer Service]' \ '(--no-dds --dds)--dds[Enable the Dart Developer Service]' \
'(--no-dds --dds)--no-dds[Disable the Dart Developer Service]' \ '(--no-dds --dds)--no-dds[Disable the Dart Developer Service]' \
'--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \ '--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \
@ -144,8 +143,8 @@ _flutter() {
(bash-completion) (bash-completion)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
'(--no-overwrite --overwrite)--overwrite[Overwritten completion setup if it already exists]' \ '(--no-overwrite --overwrite)--overwrite[Overwrite completion setup if it already exists]' \
'(--overwrite --no-overwrite)--no-overwrite[Not overwritten completion setup if it already exists]' \ '(--overwrite --no-overwrite)--no-overwrite[Not overwrite completion setup if it already exists]' \
&& ret=0 && ret=0
;; ;;
(build) (build)
@ -153,13 +152,14 @@ _flutter() {
;; ;;
(config) (config)
_arguments \ _arguments \
'(-h --help)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
'--list[List all settings and their current values]' \ '--list[List all settings and their current values]' \
'--clear-ios-signing-cert[Clear the saved development certificate choice used to sign apps for iOS device deployment]' \ '--clear-ios-signing-cert[Clear the saved development certificate choice used to sign apps for iOS device deployment]' \
'--android-sdk=[The Android SDK directory]: :_path_files -/' \ '--select-ios-signing-settings[Complete prompt to select and save code signing settings to sign apps for iOS]' \
'--android-studio-dir=[The Android Studio install directory]: :_path_files -/' \ '--android-sdk=[The Android SDK directory]:dir:_files -/' \
'--jdk-dir=[The Java Development Kit installation directory]: :_path_files -/' \ '--android-studio-dir=[The Android Studio install directory]:dir:_files -/' \
'--build-dir=[The relative path to override a projects build directory]: :_path_files -/' \ '--jdk-dir=[The Java Development Kit installation directory]:dir:_files -/' \
'--build-dir=[The relative path to override a projects build directory]:dir:_files -/' \
'(--no-enable-web --enable-web)--enable-web[Enable Flutter for web]' \ '(--no-enable-web --enable-web)--enable-web[Enable Flutter for web]' \
'(--no-enable-web --enable-web)--no-enable-web[Disable Flutter for web]' \ '(--no-enable-web --enable-web)--no-enable-web[Disable Flutter for web]' \
'(--no-enable-linux-desktop --enable-linux-desktop)--enable-linux-desktop[Enable support for desktop on Linux]' \ '(--no-enable-linux-desktop --enable-linux-desktop)--enable-linux-desktop[Enable support for desktop on Linux]' \
@ -182,43 +182,43 @@ _flutter() {
'(--no-cli-animations --cli-animations)--no-cli-animations[Disable animations in the command line interface]' \ '(--no-cli-animations --cli-animations)--no-cli-animations[Disable animations in the command line interface]' \
'(--no-enable-native-assets --enable-native-assets)--enable-native-assets[Enable native assets compilation and bundling]' \ '(--no-enable-native-assets --enable-native-assets)--enable-native-assets[Enable native assets compilation and bundling]' \
'(--no-enable-native-assets --enable-native-assets)--no-enable-native-assets[Disable native assets compilation and bundling]' \ '(--no-enable-native-assets --enable-native-assets)--no-enable-native-assets[Disable native assets compilation and bundling]' \
'(--no-enable-flutter-preview --enable-flutter-preview)--enable-flutter-preview[Enable Flutter preview prebuilt device]' \ '(--no-enable-dart-data-assets --enable-dart-data-assets)--enable-dart-data-assets[Enable Dart data assets building and bundling]' \
'(--no-enable-flutter-preview --enable-flutter-preview)--no-enable-flutter-preview[Disable Flutter preview prebuilt device]' \ '(--no-enable-dart-data-assets --enable-dart-data-assets)--no-enable-dart-data-assets[Disable Dart data assets building and bundling]' \
'(--no-enable-swift-package-manager --enable-swift-package-manager)--enable-swift-package-manager[Enable support for Swift Package Manager]' \ '(--no-enable-swift-package-manager --enable-swift-package-manager)--enable-swift-package-manager[Enable support for Swift Package Manager]' \
'(--no-enable-swift-package-manager --enable-swift-package-manager)--no-enable-swift-package-manager[Disable support for Swift Package Manager]' \ '(--no-enable-swift-package-manager --enable-swift-package-manager)--no-enable-swift-package-manager[Disable support for Swift Package Manager]' \
'(--no-omit-legacy-version-file --omit-legacy-version-file)--omit-legacy-version-file[Enable stops writing the legacy version file]' \
'(--no-omit-legacy-version-file --omit-legacy-version-file)--no-omit-legacy-version-file[Disable stops writing the legacy version file]' \
'(--no-enable-windowing --enable-windowing)--enable-windowing[Enable for windowing]' \
'(--no-enable-windowing --enable-windowing)--no-enable-windowing[Disable for windowing]' \
'(--no-enable-lldb-debugging --enable-lldb-debugging)--enable-lldb-debugging[Enable support for debugging with LLDB]' \
'(--no-enable-lldb-debugging --enable-lldb-debugging)--no-enable-lldb-debugging[Disable support for debugging with LLDB]' \
'(--no-enable-uiscene-migration --enable-uiscene-migration)--enable-uiscene-migration[Enable support for migration to UIScene lifecycle]' \
'(--no-enable-uiscene-migration --enable-uiscene-migration)--no-enable-uiscene-migration[Disable support for migration to UIScene lifecycle]' \
'--clear-features[Remove all configured features and restore them to the default values]' \ '--clear-features[Remove all configured features and restore them to the default values]' \
&& ret=0 && ret=0
;; ;;
(create) (create)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
'(--pub --no-pub)--pub[Whether to run "flutter packages get" after the project has been created. (defaults to on)]' \ '(--pub --no-pub)--pub[Run "flutter packages get" after the project has been created. (defaults to on)]' \
'(--pub --no-pub)--no-pub[Whether to run "flutter packages get" after the project has been created. (defaults to on)]' \ '(--pub --no-pub)--no-pub[Do not run "flutter packages get" after the project has been created]' \
'(--offline --no-offline)--offline[Offline mode when "flutter packages get" is run]' \ '(--offline --no-offline)--offline[Run "flutter packages get" in offline mode]' \
'(--offline --no-offline)--no-offline[Offline mode when "flutter packages get" is run]' \ '(--offline --no-offline)--no-offline[Do not run "flutter packages get" in offline mode]' \
'(--overwrite --no-overwrite)--overwrite[When performing operations, overwrite existing files]' \ '(--overwrite --no-overwrite)--overwrite[When performing operations, overwrite existing files]' \
'(--overwrite --no-overwrite)--no-overwrite[When performing operations, not overwrite existing files]' \ '(--overwrite --no-overwrite)--no-overwrite[When performing operations, not overwrite existing files]' \
"--description=[The description to use for your new Flutter project. (defaults to 'A new Flutter project.')]::" \ "--description=[The description to use for your new Flutter project(defaults to 'A new Flutter project.')]::" \
"--org=[The organization responsible for new Flutter project, in reverse domain name notation.(defaults to 'com.example')]::" \ "--org=[The organization responsible for new Flutter project, in reverse domain name notation.(defaults to 'com.example')]::" \
'--project-name=[The project name for this new Flutter project]:name:' \ '--project-name=[The project name for this new Flutter project]:name:' \
'(-i --ios-language)'{-i,--ios-language=}'[iOS project language]: :_flutter_ios_languages' \ '(-i --ios-language)'{-i,--ios-language=}'[iOS project language]: :_flutter_ios_languages' \
'(-a --android-language)'{-a,--android-language=}'[Android project language]: :_flutter_android_languages' \ '(-a --android-language)'{-a,--android-language=}'[Android project language]: :_flutter_android_languages' \
'--platforms=[The platforms supported by this project]:platforms:_flutter_platforms' \ '--platforms=[The platforms supported by this project]:platforms:_flutter_platforms' \
'(-t --template=)'{-t,--template=}'[Specify the type of project to create]: :_flutter_project_templates' \ '(-t --template=)'{-t,--template=}'[Specify the type of project to create]: :_flutter_project_templates' \
'(-s --sample=)'{-s,--sample=}'[Specifies the Flutter code sample to use as the "main.dart" for an application]:id:' \
'(-e --empty)'{-e,--empty}'[Specifies creating using an application template with a main.dart that is minimal]' \ '(-e --empty)'{-e,--empty}'[Specifies creating using an application template with a main.dart that is minimal]' \
'--list-samples=[Specifies a JSON output file for a listing of Flutter code samples that can be created with "--sample"]: :_path_files' \
&& ret=0 && ret=0
;; ;;
(custom-devices) (custom-devices)
_flutter_custom_devices && ret=0 _flutter_custom_devices && ret=0
;; ;;
(daemon)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'--listen-on-tcp-port=[If specified, the daemon will be listening for commands on the specified port instead of stdio]:port:' \
&& ret=0
;;
(debug-adapter) (debug-adapter)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
@ -232,7 +232,6 @@ _flutter() {
(devices) (devices)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
'--machine[Output device information in machine readable structured JSON format]' \
"--device-timeout=[Time in seconds to wait for devices to attach]:seconds:" \ "--device-timeout=[Time in seconds to wait for devices to attach]:seconds:" \
'--device-connection=[Discover devices based on connection type]:type:_flutter_device_connection_types' \ '--device-connection=[Discover devices based on connection type]:type:_flutter_device_connection_types' \
&& ret=0 && ret=0
@ -251,26 +250,23 @@ _flutter() {
'--release[Build a release version of your app]' \ '--release[Build a release version of your app]' \
'*--dart-define=[Additional key-value pairs that will be available as constants]:' \ '*--dart-define=[Additional key-value pairs that will be available as constants]:' \
'--dart-define-from-file=[The path of a json or .env file containing key-value pairs]: :_files -g "*.(json|env)"' \ '--dart-define-from-file=[The path of a json or .env file containing key-value pairs]: :_files -g "*.(json|env)"' \
'*--web-define=[Additional key-value pairs that will be available as template variables in web/index.html]' \
'--flavor[Build a custom app flavor as defined by platform-specific build setup]:flavor' \ '--flavor[Build a custom app flavor as defined by platform-specific build setup]:flavor' \
'--web-renderer=[The renderer implementation to use when building for the web]: :_flutter_web_renderers' \
'--no-web-resources-cdn[Do not use Web static resources hosted on a CDN]' \ '--no-web-resources-cdn[Do not use Web static resources hosted on a CDN]' \
'--use-application-binary=[Specify a pre-built application binary to use when running]:app:_files -g "*.apk"' \ '--use-application-binary=[Specify a pre-built application binary to use when running]:app:_files -g "*.apk"' \
'--trace-startup[Start tracing during startup]' \ '--trace-startup[Start tracing during startup]' \
'(--cache-startup-profile --no-cache-startup-profile)--cache-startup-profile[Caches the CPU profile collected before the first frame for startup analysis]' \ '(--cache-startup-profile --no-cache-startup-profile)--cache-startup-profile[Caches the CPU profile collected before the first frame for startup analysis]' \
'(--cache-startup-profile --no-cache-startup-profile)--no-cache-startup-profile[Not caches the CPU profile collected before the first frame for startup analysis]' \ '(--cache-startup-profile --no-cache-startup-profile)--no-cache-startup-profile[Not caches the CPU profile collected before the first frame for startup analysis]' \
'--verbose-system-logs[Include verbose logging from the Flutter engine]' \ '--verbose-system-logs[Include verbose logging from the Flutter engine]' \
'--cache-sksl[Cache the shader in the SkSL format instead of in binary or GLSL formats]' \
'--dump-skp-on-shader-compilation[Cache the shader in the SkSL format instead of in binary or GLSL formats]' \
'--purge-persistent-cache[Removes all existing persistent caches]' \ '--purge-persistent-cache[Removes all existing persistent caches]' \
'--route[Which route to load when running the app]' \ '--route[Which route to load when running the app]' \
'(--no-start-paused --start-paused)--start-paused[Start in a paused mode and wait for a debugger to connect]' \ '(--no-start-paused --start-paused)--start-paused[Start in a paused mode and wait for a debugger to connect]' \
'(--no-start-paused --start-paused)--no-start-paused[Not tart in a paused mode and wait for a debugger to connect]' \ '(--no-start-paused --start-paused)--no-start-paused[Not start in a paused mode and wait for a debugger to connect]' \
'--endless-trace-buffer[Enable tracing to an infinite buffer, instead of a ring buffer]' \ '--endless-trace-buffer[Enable tracing to an infinite buffer, instead of a ring buffer]' \
'--trace-systrace[Enable tracing to the system tracer]' \ '--trace-systrace[Enable tracing to the system tracer]' \
'--trace-to-file=[Write the timeline trace to a file at the specified path]:file:_files' \ '--trace-to-file=[Write the timeline trace to a file at the specified path]:file:_files' \
'--trace-skia[Enable tracing of Skia code]' \ '--trace-skia[Enable tracing of Skia code]' \
'--no-enable-dart-profiling[Disable the Dart VM sampling CPU profiler]' \ '--no-enable-dart-profiling[Disable the Dart VM sampling CPU profiler]' \
'--skia-deterministic-rendering[provide completely deterministic Skia rendering]' \
*{-a,--dart-entrypoint-args=}'[Pass a list of arguments to the Dart entrypoint at application startup]: :' \ *{-a,--dart-entrypoint-args=}'[Pass a list of arguments to the Dart entrypoint at application startup]: :' \
'--wasm[Compile to WebAssembly rather than JavaScript]' \ '--wasm[Compile to WebAssembly rather than JavaScript]' \
'--web-tls-cert-path=[The certificate that host will use to serve using TLS connection]:cert:_files' \ '--web-tls-cert-path=[The certificate that host will use to serve using TLS connection]:cert:_files' \
@ -279,8 +275,8 @@ _flutter() {
'(-t --target=)'{-t,--target=}'[The main entry-point file of the application, as run on the device.(defaults to "lib/main.dart")]: :_files -g "*.dart"' \ '(-t --target=)'{-t,--target=}'[The main entry-point file of the application, as run on the device.(defaults to "lib/main.dart")]: :_files -g "*.dart"' \
'--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \ '--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \
'--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \ '--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \
'(--no-pub --pub)--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ '(--no-pub --pub)--pub[Run "flutter packages get" before executing this command. (default: on)]' \
'(--no-pub --pub)--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ '(--no-pub --pub)--no-pub[Do not run "flutter packages get" before executing this command]' \
'(--no-track-widget-creation --track-widget-creation)--track-widget-creation[Track widget creation locations(defaults on)]' \ '(--no-track-widget-creation --track-widget-creation)--track-widget-creation[Track widget creation locations(defaults on)]' \
'(--no-track-widget-creation --track-widget-creation)--no-track-widget-creation[Not track widget creation locations]' \ '(--no-track-widget-creation --track-widget-creation)--no-track-widget-creation[Not track widget creation locations]' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \ '--device-user=[Identifier number for a user or work profile on Android only]:id:' \
@ -296,8 +292,8 @@ _flutter() {
'(--no-keep-app-running --keep-app-running)--keep-app-running[Will keep the Flutter application running when done testing]' \ '(--no-keep-app-running --keep-app-running)--keep-app-running[Will keep the Flutter application running when done testing]' \
'--use-existing-app=[Connect to an already running instance via the given observatory URL]' \ '--use-existing-app=[Connect to an already running instance via the given observatory URL]' \
'--driver=[The test file to run on the host]: :_files' \ '--driver=[The test file to run on the host]: :_files' \
'--build[If necessary, build the app before running. (defaults to on)]' \ '(--no-build --build)--build[If necessary, build the app before running. (defaults to on)]' \
'--no-build[If necessary, not build the app before running]' \ '(--no-build --build)--no-build[If necessary, not build the app before running]' \
'--screenshot=[Directory location to write screenshots on test failure]::_path_files -/' \ '--screenshot=[Directory location to write screenshots on test failure]::_path_files -/' \
'--driver-port=[The port where Webdriver server is launched at(default to "4444")]:port:' \ '--driver-port=[The port where Webdriver server is launched at(default to "4444")]:port:' \
'(--no-headless --headless)--headless[Launch driver browser in headless mode(defaults to on)]' \ '(--no-headless --headless)--headless[Launch driver browser in headless mode(defaults to on)]' \
@ -307,9 +303,8 @@ _flutter() {
'(--no-android-emulator --android-emulator)--android-emulator[Perform Flutter Driver testing using an Android Emulator]' \ '(--no-android-emulator --android-emulator)--android-emulator[Perform Flutter Driver testing using an Android Emulator]' \
'(--no-android-emulator --android-emulator)--no-android-emulator[Not perform Flutter Driver testing using an Android Emulator]' \ '(--no-android-emulator --android-emulator)--no-android-emulator[Not perform Flutter Driver testing using an Android Emulator]' \
'--chrome-binary=[Location of the Chrome binary]::_files' \ '--chrome-binary=[Location of the Chrome binary]::_files' \
'--write-sksl-on-exit[Attempts to write an SkSL file when the drive process is finished to the provided file, overwriting it if necessary]' \ '*--test-arguments=[Additional arguments to pass to the Dart VM running The test script]:arg' \
'*--test-arguments=[Additional arguments to pass to the Dart VM running The test script]: :' \ '--profile-memory=[Launch devtools and profile application memory, writing the output data as JSON]:file:_files -g "*.json"' \
'--profile-memory=[Launch devtools and profile application memory, writing the output data as JSON]::_files -g "*.json"' \
'--timeout=[Timeout the test after the given number of seconds]:seconds' \ '--timeout=[Timeout the test after the given number of seconds]:seconds' \
&& ret=0 && ret=0
;; ;;
@ -337,8 +332,6 @@ _flutter() {
'(--no-use-deferred-loading --use-deferred-loading)--use-deferred-loading[Generate the Dart localization file as deferred]' \ '(--no-use-deferred-loading --use-deferred-loading)--use-deferred-loading[Generate the Dart localization file as deferred]' \
'(--no-use-deferred-loading --use-deferred-loading)--no-use-deferred-loading[Not generate the Dart localization file as deferred]' \ '(--no-use-deferred-loading --use-deferred-loading)--no-use-deferred-loading[Not generate the Dart localization file as deferred]' \
'--gen-inputs-and-outputs-list=[the tool generates a JSON file containing the tools inputs and outputs]::_path_files -/' \ '--gen-inputs-and-outputs-list=[the tool generates a JSON file containing the tools inputs and outputs]::_path_files -/' \
'(--no-synthetic-package --synthetic-package)--synthetic-package[Generate files as a synthetic package]' \
'(--no-synthetic-package --synthetic-package)--no-synthetic-package[Not generate files as a synthetic package]' \
'--project-dir=[the directory of the root Flutter project]::_path_files -/' \ '--project-dir=[the directory of the root Flutter project]::_path_files -/' \
'(--no-required-resource-attributes --required-resource-attributes)--required-resource-attributes[Requires all resource ids to contain a corresponding resource attribute]' \ '(--no-required-resource-attributes --required-resource-attributes)--required-resource-attributes[Requires all resource ids to contain a corresponding resource attribute]' \
'(--no-required-resource-attributes --required-resource-attributes)--no-required-resource-attributes[Requires all resource ids to contain a corresponding resource attribute]' \ '(--no-required-resource-attributes --required-resource-attributes)--no-required-resource-attributes[Requires all resource ids to contain a corresponding resource attribute]' \
@ -404,9 +397,10 @@ _flutter() {
'--debug[Build a debug version of your app (default mode)]' \ '--debug[Build a debug version of your app (default mode)]' \
'--profile[Build a version of your app specialized for performance profiling]' \ '--profile[Build a version of your app specialized for performance profiling]' \
'--release[Build a release version of your app]' \ '--release[Build a release version of your app]' \
'*--dart-define=[Additional key-value pairs that will be available as constants]: ' \ \*{-D,--dart-define=}'[Additional key-value pairs that will be available as constants]:define' \
'--dart-define-from-file=[The path of a json format file where flutter define a global constant pool]: :_files -g "*.(json|env)"' \
'*--web-define=[Additional key-value pairs that will be available as template variables in web/index.html]' \
'--flavor[Build a custom app flavor as defined by platform-specific build setup]:flavor' \ '--flavor[Build a custom app flavor as defined by platform-specific build setup]:flavor' \
'--web-renderer=[The renderer implementation to use when building for the web]: :_flutter_web_renderers' \
'--no-web-resources-cdn[Do not use Web static resources hosted on a CDN]' \ '--no-web-resources-cdn[Do not use Web static resources hosted on a CDN]' \
'--use-application-binary=[Specify a pre-built-application binary to use when running]: :_files' \ '--use-application-binary=[Specify a pre-built-application binary to use when running]: :_files' \
'--trace-startup[Start tracing during startup]' \ '--trace-startup[Start tracing during startup]' \
@ -414,42 +408,42 @@ _flutter() {
'(--cache-startup-profile --no-cache-startup-profile)--no-cache-startup-profile[Not caches the CPU profile collected before the first frame for startup analysis]' \ '(--cache-startup-profile --no-cache-startup-profile)--no-cache-startup-profile[Not caches the CPU profile collected before the first frame for startup analysis]' \
'--verbose-system-logs[Include verbose logging from the Flutter engine]' \ '--verbose-system-logs[Include verbose logging from the Flutter engine]' \
'--cache-sksl[Cache the shader in the SkSL format instead of in binary or GLSL formats]' \ '--cache-sksl[Cache the shader in the SkSL format instead of in binary or GLSL formats]' \
'--dump-skp-on-shader-compilation[Cache the shader in the SkSL format instead of in binary or GLSL formats]' \
'--purge-persistent-cache[Removes all existing persistent caches]' \ '--purge-persistent-cache[Removes all existing persistent caches]' \
'--route[Which route to load when running the app]' \ '--route[Which route to load when running the app]' \
'(--no-start-paused --start-paused)--start-paused[Start in a paused mode and wait for a debugger to connect]' \ '(--no-start-paused --start-paused)--start-paused[Start in a paused mode and wait for a debugger to connect]' \
'(--no-start-paused --start-paused)--no-start-paused[Not start in a paused mode and wait for a debugger to connect]' \ '(--no-start-paused --start-paused)--no-start-paused[Not start in a paused mode and wait for a debugger to connect]' \
'--endless-trace-buffer[Enable tracing to an infinite buffer, instead of a ring buffer]' \ '--endless-trace-buffer[Enable tracing to an infinite buffer, instead of a ring buffer]' \
'--trace-systrace[Enable tracing to the system tracer]' \ '--trace-systrace[Enable tracing to the system tracer]' \
'--trace-to-file=[Write the timeline trace to a file at the specified path]:file:_files' \
'--trace-skia[Enable tracing of Skia code]' \ '--trace-skia[Enable tracing of Skia code]' \
'--no-enable-dart-profiling[Disable the Dart VM sampling CPU profiler]' \ '--no-enable-dart-profiling[Disable the Dart VM sampling CPU profiler]' \
'--enable-software-rendering[Enable rendering using the Skia software backend]' \ '--enable-software-rendering[Enable rendering using the Skia software backend]' \
'--skia-deterministic-rendering[When combined with --enable-software-rendering, provides 100% deterministic Skia rendering]' \ \*{-a,--dart-entrypoint-args=}'[Pass a list of arguments to the Dart entrypoint at application startup]: :' \
*{-a,--dart-entrypoint-args=}'[Pass a list of arguments to the Dart entrypoint at application startup]: :' \
'--wasm[Compile to WebAssembly rather than JavaScript]' \ '--wasm[Compile to WebAssembly rather than JavaScript]' \
'--web-tls-cert-path=[The certificate that host will use to serve using TLS connection]:cert:_files' \ '--web-tls-cert-path=[The certificate that host will use to serve using TLS connection]:cert:_files' \
'--web-tls-cert-key-path=[The certificate key that host will use to authenticate cert]:key:_files' \ '--web-tls-cert-key-path=[The certificate key that host will use to authenticate cert]:key:_files' \
'--web-launch-url=[The URL to provide to the browser]: :' \ '--web-launch-url=[The URL to provide to the browser]: :' \
'(-t= --target=)'{-t=,--target=}'[The main entry-point file of the application, as run on the device.(defaults to "lib/main.dart")]: :_files -g "*.dart"' \ '(-t --target=)'{-t,--target=}'[The main entry-point file of the application, as run on the device(default: "lib/main.dart")]: :_files -g "*.dart"' \
'--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \ '--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \
'--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \ '--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ '(--no-pub --pub)--pub[Run "flutter packages get" before executing this command(default: on)]' \
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \ '(--no-pub --pub)--no-pub[Do not run "flutter packages get" before executing this command]' \
'--track-widget-creation[Track widget creation locations. (defaults to on)]' \ '(--no-track-widget-creation --track-widget-creation)--track-widget-creation[Track widget creation locations. (defaults to on)]' \
'--no-track-widget-creation[Not rack widget creation locations. (defaults to on)]' \ '(--no-track-widget-creation --track-widget-creation)--no-track-widget-creation[Not track widget creation locations]' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \ '--device-user=[Identifier number for a user or work profile on Android only]:id' \
'--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \ '--device-timeout=[Time in seconds to wait for devices to attach]:seconds' \
'--device-connection=[Discover devices based on connection type]: :_flutter_device_connection_types' \ '--device-connection=[Discover devices based on connection type]:type:_flutter_device_connection_types' \
'--dds-port=[When this value is provided, the Dart Development Service (DDS) will be bound to the provided port]:port:' \
'(--no-dds --dds)--dds[Enable the Dart Developer Service]' \ '(--no-dds --dds)--dds[Enable the Dart Developer Service]' \
'(--no-dds --dds)--no-dds[Disable the Dart Developer Service]' \ '(--no-dds --dds)--no-dds[Disable the Dart Developer Service]' \
'--dds-port=[When this value is provided, the Dart Development Service (DDS) will be bound to the provided port]:port:' \ '(--no-android-skip-build-dependency-validation --android-skip-build-dependency-validation)--android-skip-build-dependency-validation[Skip version checking during Android builds]' \
'(--no-android-skip-build-dependency-validation --android-skip-build-dependency-validation)--no-android-skip-build-dependency-validation[Skip version checking during Android builds]' \
*{-P,--android-project-arg=}'[Additional arguments specified as key=value that are passed directly to the gradle project via the -P flag]: :' \ *{-P,--android-project-arg=}'[Additional arguments specified as key=value that are passed directly to the gradle project via the -P flag]: :' \
'--multidex[indicates that the app should be built with multidex support(defaults to on)]' \ '--android-project-cache-dir[Specify the project-specific cache directory]:dir:_file -/' \
'--no-multidex[indicates that the app should not be built with multidex support(defaults to on)]' \
'--ignore-deprecation[Indicates that the app should ignore deprecation warnings and continue to build using deprecated APIs]' \ '--ignore-deprecation[Indicates that the app should ignore deprecation warnings and continue to build using deprecated APIs]' \
'--no-await-first-frame-when-tracing[Just dump the trace as soon as the application is running]' \ '--no-await-first-frame-when-tracing[Just dump the trace as soon as the application is running]' \
'--use-test-fonts[Enable (and default to) the "Ahem" font]' \ '(--no-use-test-fonts --use-test-fonts)--use-test-fonts[Enable (and default to) the "Ahem" font]' \
'--no-use-test-fonts[Not enable (and default to) the "Ahem" font]' \ '(--no-use-test-fonts --use-test-fonts)--no-use-test-fonts[Not enable (and default to) the "Ahem" font]' \
'--no-build[Do not build the app before running]' \ '--no-build[Do not build the app before running]' \
'--no-hot[Run without support for hot reloading]' \ '--no-hot[Run without support for hot reloading]' \
'--pid-file=[Specify a file to write the process id to]: :_files' \ '--pid-file=[Specify a file to write the process id to]: :_files' \
@ -481,9 +475,8 @@ _flutter() {
'(--pub --no-pub)--no-pub[Not to run "flutter packages get" before executing this command]' \ '(--pub --no-pub)--no-pub[Not to run "flutter packages get" before executing this command]' \
'(--track-widget-creation --no-track-widget-creation)--track-widget-creation[Track widget creation locations]' \ '(--track-widget-creation --no-track-widget-creation)--track-widget-creation[Track widget creation locations]' \
'(--track-widget-creation --no-track-widget-creation)--no-track-widget-creation[Not track widget creation locations]' \ '(--track-widget-creation --no-track-widget-creation)--no-track-widget-creation[Not track widget creation locations]' \
'*--dart-define=[Additional key-value pairs that will be available as constants]:' \ \*{-D,--dart-define=}'[Additional key-value pairs that will be available as constants]:define' \
'--dart-define-from-file=[The path of a json format file where flutter define a global constant pool]: :_files -g "*.(json|env)"' \ '--dart-define-from-file=[The path of a json format file where flutter define a global constant pool]: :_files -g "*.(json|env)"' \
'--web-renderer=[The renderer implementation to use when building for the web]: :_flutter_web_renderers' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \ '--device-user=[Identifier number for a user or work profile on Android only]:id:' \
'--flavor[Build a custom app flavor as defined by platform-specific build setup]:flavor' \ '--flavor[Build a custom app flavor as defined by platform-specific build setup]:flavor' \
'--name=[A regular expression matching substrings of the names of tests to run]' \ '--name=[A regular expression matching substrings of the names of tests to run]' \
@ -491,12 +484,15 @@ _flutter() {
*{-t,--tags=}'[Run only tests associated with the specified tags]:tag:' \ *{-t,--tags=}'[Run only tests associated with the specified tags]:tag:' \
*{-x,--exclude-tags=}'[Run only tests that do not have the specified tags]:tag:' \ *{-x,--exclude-tags=}'[Run only tests that do not have the specified tags]:tag:' \
'--start-paused[Start in a paused mode and wait for a debugger to connect]' \ '--start-paused[Start in a paused mode and wait for a debugger to connect]' \
'(--no-fail-fast --fail-fast)--fail-fast[Stop running tests after the first failure]' \
'(--no-fail-fast --fail-fast)--no-fail-fast[Do not stop running tests after the first failure]' \
'(--no-run-skipped --run-skipped)--run-skipped[Run skipped tests instead of skipping them]' \ '(--no-run-skipped --run-skipped)--run-skipped[Run skipped tests instead of skipping them]' \
'(--no-run-skipped --run-skipped)--no-run-skipped[Not run skipped tests instead of skipping them]' \ '(--no-run-skipped --run-skipped)--no-run-skipped[Not run skipped tests instead of skipping them]' \
'--coverage[Whether to collect coverage information]' \ '--coverage[Whether to collect coverage information]' \
'--merge-coverage[Whether to merge coverage data with "coverage/lcov.base.info" (Requires lcov)]' \ '--merge-coverage[Whether to merge coverage data with "coverage/lcov.base.info" (Requires lcov)]' \
'--branch-coverage[Whether to collect branch coverage information]' \ '--branch-coverage[Whether to collect branch coverage information]' \
'--coverage-path=[Where to store coverage information (if coverage is enabled). (defaults to "coverage/lcov.info")]::_files' \ '--coverage-path=[Where to store coverage information (if coverage is enabled). (defaults to "coverage/lcov.info")]::_files' \
'--coverage-package=[A regular expression matching packages names to include in the coverage report]:pattern' \
'--update-goldens[Whether "matchesGoldenFile()" calls within your test methods should update the golden files]' \ '--update-goldens[Whether "matchesGoldenFile()" calls within your test methods should update the golden files]' \
'(-j --concurrency)'{-j,--concurrency=}'[The number of concurrent test processes to run]:nums:' \ '(-j --concurrency)'{-j,--concurrency=}'[The number of concurrent test processes to run]:nums:' \
'(--test-assets --no-test-assets)--test-assets[Build the assets bundle for testing]' \ '(--test-assets --no-test-assets)--test-assets[Build the assets bundle for testing]' \
@ -504,14 +500,14 @@ _flutter() {
'--test-randomize-ordering-seed[The seed to randomize the execution order of test cases within test files]' \ '--test-randomize-ordering-seed[The seed to randomize the execution order of test cases within test files]' \
'--total-shards[Tests can be sharded with the "--total-shards" and "--shard-index" arguments]' \ '--total-shards[Tests can be sharded with the "--total-shards" and "--shard-index" arguments]' \
'--shard-index[Tests can be sharded with the "--total-shards" and "--shard-index" arguments]' \ '--shard-index[Tests can be sharded with the "--total-shards" and "--shard-index" arguments]' \
{-r,--reporter=}'[Set how to print test results]: :(compact expanded github json silent)' \ {-r,--reporter=}'[Set how to print test results]: :(compact expanded failures-only github json silent)' \
'--file-reporter[Enable an additional reporter writing test results to a file]' \ '--file-reporter[Enable an additional reporter writing test results to a file]' \
'--timeout=[The default test timeout, specified either in seconds (e.g. "60s"). Defaults to "30s"]:seconds:' \ '--timeout=[The default test timeout, specified either in seconds (e.g. "60s"). Defaults to "30s"]:seconds:' \
'--ignore-timeouts[Ignore all timeouts]' \ '--ignore-timeouts[Ignore all timeouts]' \
'--wasm[Compile to WebAssembly rather than JavaScript]' \ '--wasm[Compile to WebAssembly rather than JavaScript]' \
'--dds-port=[the Dart Development Service (DDS) will be bound to the provided port]:port:' \
'(--no-dds --dds)--dds[Enable the Dart Developer Service]' \ '(--no-dds --dds)--dds[Enable the Dart Developer Service]' \
'(--no-dds --dds)--no-dds[Disable the Dart Developer Service]' \ '(--no-dds --dds)--no-dds[Disable the Dart Developer Service]' \
'--dds-port=[the Dart Development Service (DDS) will be bound to the provided port]:port:' \
&& ret=0 && ret=0
;; ;;
(upgrade) (upgrade)
@ -521,6 +517,9 @@ _flutter() {
'--verify-only[Checks for any new Flutter updates, without actually fetching them]' \ '--verify-only[Checks for any new Flutter updates, without actually fetching them]' \
&& ret=0 && ret=0
;; ;;
(widget-preview)
_flutter_widget_preview && ret=0
;;
(*) (*)
_arguments \ _arguments \
'(- *)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
@ -564,6 +563,7 @@ _flutter_root_commands() {
'symbolize:Symbolize a stack trace from an AOT-compiled Flutter app.' 'symbolize:Symbolize a stack trace from an AOT-compiled Flutter app.'
'test:Run Flutter unit tests for the current project.' 'test:Run Flutter unit tests for the current project.'
'upgrade:Upgrade your copy of Flutter.' 'upgrade:Upgrade your copy of Flutter.'
'widget-preview:Manage the widget preview environment'
) )
_describe -t commands 'command' commands "$@" _describe -t commands 'command' commands "$@"
} }
@ -574,7 +574,7 @@ _flutter_build() {
_arguments -C \ _arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \ '(- *)'{-h,--help}'[Print this usage information]' \
'1: :_flutter_build_entities' \ '1: :_flutter_build_subcommands' \
'*:: :->args' \ '*:: :->args' \
&& ret=0 && ret=0
@ -637,8 +637,6 @@ _flutter_build() {
'--asset-dir[The output directory for the kernel_blob.bin file]: :_files -/' '--asset-dir[The output directory for the kernel_blob.bin file]: :_files -/'
) )
;; ;;
(fuchsia)
;;
(ios) (ios)
opts+=( opts+=(
'--code-size-directory=[The location to write code size analysis files]: :_files -/' '--code-size-directory=[The location to write code size analysis files]: :_files -/'
@ -647,6 +645,13 @@ _flutter_build() {
'--simulator[Build for the iOS simulator instead of the device]' '--simulator[Build for the iOS simulator instead of the device]'
) )
;; ;;
(ios-framework|macos-framework)
opts+=(
'--cocoapods[Produce a Flutter.podspec instead of an engine Flutter.xcframework]'
'--plugins[Produce frameworks for the plugins]'
'--static[Build plugins as static frameworks]'
)
;;
(linux) (linux)
opts+=( opts+=(
'(--no-analyze-size)--analyze-size[Produce additional profile information for artifact output size]' '(--no-analyze-size)--analyze-size[Produce additional profile information for artifact output size]'
@ -698,19 +703,20 @@ _flutter_build() {
return ret return ret
} }
(( $+functions[_flutter_build_entities] )) || (( $+functions[_flutter_build_subcommands] )) ||
_flutter_build_entities() { _flutter_build_subcommands() {
local -a entities=( local -a entities=(
"aar:Build a repository containing an AAR and a POM file." "aar:Build a repository containing an AAR and a POM file"
"apk:Build an Android APK file from your app." "apk:Build an Android APK file from your app"
"appbundle:Build an Android App Bundle file from your app." "appbundle:Build an Android App Bundle file from your app"
"bundle:Build the Flutter assets directory from your app." "bundle:Build the Flutter assets directory from your app"
"fuchsia:Build the Fuchsia target." "ios:Build an iOS application bundle"
"ios:Build an iOS application bundle (Mac OS X host only)." "ios-framework:Produces .xcframeworks for a Flutter project for existing, plain iOS Xcode projects"
"linux:Build a Linux desktop application." "linux:Build a Linux desktop application"
"macos:Build a macOS desktop application." "macos:Build a macOS desktop application"
"macos-framework:Produces .xcframeworks for a Flutter project for existing, plain macOS Xcode projects"
"web:Build a web application bundle" "web:Build a web application bundle"
"windows:Build a Windows desktop application." "windows:Build a Windows desktop application"
) )
_describe -t entities 'entity' entities "$@" _describe -t entities 'entity' entities "$@"
} }
@ -758,43 +764,6 @@ _flutter_custom_devices_subcommands() {
_describe -t subcmds 'subcommands' subcmds "$@" _describe -t subcmds 'subcommands' subcmds "$@"
} }
(( $+functions[_flutter_project_templates] )) ||
_flutter_project_templates() {
local -a templates=(
"app:(default) Generate a Flutter application"
"module:Generate a shareable Flutter project containing modular Dart code"
"package:Generate a shareable Flutter project containing modular Dart code"
"plugin:Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation for Android, for iOS code, or for both"
"plugin_ffi:Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation through dart:ffi for Android, iOS, Linux, macOS, Windows, or any combination of these"
"skeleton:Generate a List View / Detail View Flutter application that follows community best practices"
)
_describe -t templates 'template' templates "$@"
}
(( $+functions[_flutter_platforms] )) ||
_flutter_platforms() {
local -a platforms=("ios" "android" "windows" "linux" "macos" "web")
_values -s , "platforms" $platforms
}
(( $+functions[_flutter_ios_languages] )) ||
_flutter_ios_languages() {
local -a languages=(
"objc:Objective-C"
"swift:(default) Swift"
)
_describe -t languages 'language' languages "$@"
}
(( $+functions[_flutter_android_languages] )) ||
_flutter_android_languages() {
local -a languages=(
"java:Java"
"kotlin:(default) Kotlin"
)
_describe -t languages 'language' languages "$@"
}
(( $+functions[_flutter_pub] )) || (( $+functions[_flutter_pub] )) ||
_flutter_pub() { _flutter_pub() {
local ret=1 local ret=1
@ -874,6 +843,7 @@ _flutter_pub() {
'(-f --force)'{-f,--force}'[Publish without confirmation if there are no errors]' \ '(-f --force)'{-f,--force}'[Publish without confirmation if there are no errors]' \
'--skip-validation[Publish without validation and resolution]' \ '--skip-validation[Publish without validation and resolution]' \
'(-C --directory)'{-C,--directory=}'[Run this in the given directory]:dir:_files -/' \ '(-C --directory)'{-C,--directory=}'[Run this in the given directory]:dir:_files -/' \
'--ignore-warnings[Do not treat warnings as fatal]' \
&& ret=0 && ret=0
;; ;;
(run) (run)
@ -896,6 +866,7 @@ _flutter_pub() {
'--precompile[Build executables in immediate dependencies]' \ '--precompile[Build executables in immediate dependencies]' \
'--unlock-transitive[Also upgrades the transitive dependencies of the listed dependencies]' \ '--unlock-transitive[Also upgrades the transitive dependencies of the listed dependencies]' \
'--major-versions[Upgrades packages to their latest resolvable versions]' \ '--major-versions[Upgrades packages to their latest resolvable versions]' \
'--no-example[Do not run in "example/" if it exists]' \
'(-C --directory)'{-C,--directory=}'[Run this in the given directory]:dir:_files -/' \ '(-C --directory)'{-C,--directory=}'[Run this in the given directory]:dir:_files -/' \
&& ret=0 && ret=0
;; ;;
@ -1091,6 +1062,97 @@ _flutter_pub_token_subcommand() {
_describe -t subcommands 'subcommand' subcommands "$@" _describe -t subcommands 'subcommand' subcommands "$@"
} }
(( $+functions[_flutter_widget_preview] )) ||
_flutter_widget_preview() {
local ret=1
_arguments -C \
'(- *)'{-h,--help}'[Print this usage information]' \
\*{-v,--verbose}'[Noisy logging, including all shell commands executed]' \
'(-d --device-id)'{-d,--device-id}'[Target device id or name]:id_or_name' \
'(- *)--version[Report the version of this tool]' \
'(--enable-analytics --disable-analytics)--enable-analytics[Enable telemetry reporting each time a flutter or dart command runs]' \
'(--enable-analytics --disable-analytics)--disable-analytics[Disable telemetry reporting each time a flutter or dart command runs]' \
'--suppress-analytics[Suppress analytics reporting for the current CLI invocation]' \
'1: :_flutter_widget_preview_subcommand' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(clean)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
&& ret=0
;;
(start)
_arguments \
'(- *)'{-h,--help}'[Print this usage information]' \
'(--pub --no-pub)--pub[Run "flutter packages get" after the project has been created]' \
'(--pub --no-pub)--no-pub[Do not run "flutter packages get" after the project has been created]' \
'(--offline --no-offline)--offline[Run "flutter packages get" in offline mode]' \
'(--offline --no-offline)--no-offline[Do not run "flutter packages get" in offline mode]' \
'(--web-server --no-web-server)--web-server[Serve the widget preview environment using the web-server device instead of browser]' \
'(--web-server --no-web-server)--no-web-server[Do not serve the widget preview environment using the web-server device]' \
&& ret=0
;;
esac
;;
esac
return ret
}
(( $+functions[_flutter_widget_preview_subcommand] )) ||
_flutter_widget_preview_subcommand() {
local -a subcommands=(
"clean:Cleans up widget preview state"
"start:Starts the widget preview environment"
)
_describe -t subcommands 'subcommand' subcommands "$@"
}
# Utilities
(( $+functions[_flutter_project_templates] )) ||
_flutter_project_templates() {
local -a templates=(
"app:(default) Generate a Flutter application"
"module:Generate a shareable Flutter project containing modular Dart code"
"package:Generate a shareable Dart/Flutter project containing modular Dart code"
"package_ffi:Generate a shareable Dart/Flutter project containing an API in Dart with FFI"
"plugin:Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation for Android, for iOS code, or for both"
"plugin_ffi:Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation through dart:ffi for Android, iOS, Linux, macOS, Windows, or any combination of these"
"skeleton:Generate a List View / Detail View Flutter application that follows community best practices"
)
_describe -t templates 'template' templates "$@"
}
(( $+functions[_flutter_platforms] )) ||
_flutter_platforms() {
local -a platforms=("ios" "android" "windows" "linux" "macos" "web" "darwin")
_values -s , "platforms" $platforms
}
(( $+functions[_flutter_ios_languages] )) ||
_flutter_ios_languages() {
local -a languages=(
"objc:Objective-C"
"swift:(default) Swift"
)
_describe -t languages 'language' languages "$@"
}
(( $+functions[_flutter_android_languages] )) ||
_flutter_android_languages() {
local -a languages=(
"java:Java"
"kotlin:(default) Kotlin"
)
_describe -t languages 'language' languages "$@"
}
(( $+functions[_flutter_web_renderers] )) || (( $+functions[_flutter_web_renderers] )) ||
_flutter_web_renderers() { _flutter_web_renderers() {
local -a renderers=( local -a renderers=(

View File

@ -30,7 +30,7 @@
# Description # Description
# ----------- # -----------
# #
# Completion script for go 1.25.0 (https://go.dev/). # Completion script for go 1.26.0 (https://go.dev/).
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Authors # Authors
@ -312,20 +312,45 @@ __go_packages() {
fi fi
} }
__go_fix_names() { __go_fix_analyzers() {
local -a fix_names=( local -a fix_analyzers=(
'buildtag[remove +build comments from modules using Go 1.18 or later]' "any[replace interface{} with any]"
'cftype[fixes initializers and casts of C.*Ref and JNI types]' "buildtag[check //go:build and // +build directives]"
'context[Change imports of golang.org/x/net/context to context]' "fmtappendf[replace \[\]byte(fmt.Sprintf) with fmt.Appendf]"
'egl[fixes initializers of EGLDisplay]' "forvar[remove redundant re-declaration of loop variables]"
'eglconf[fixes initializers of EGLConfig]' "hostport[check format of addresses passed to net.Dial]"
'gotypes[change imports of oglang.org/x/tools/go{exact,types} to go/{constant,types}]' "inline[apply fixes based on 'go:fix inline' comment directives]"
"jni[fixes initializers of JNI's jobject and subtypes]" "mapsloop[replace explicit loops over maps with calls to maps package]"
'netipv6zone[adapt element key to IPAddr, UPDAddr, TCPAddr composite literals]' "minmax[replace if/else statements with calls to min or max]"
'printerconfig[add element keys to Config composite literals]' "newexpr[simplify code by using go1.26's new(expr)]"
"omitzero[suggest replacing omitempty with omitzero for struct fields]"
"plusbuild[remove obsolete //+build comments]"
"rangeint[replace 3-clause for loops with for-range over integers]"
"reflecttypefor[replace reflect.TypeOf(x) with TypeFor\[T\]()]"
"slicescontains[replace loops with slices.Contains or slices.ContainsFunc]"
"slicessort[replace sort.Slice with slices.Sort for basic types]"
"stditerators[use iterators instead of Len/At-style APIs]"
"stringsbuilder[replace += with strings.Builder]"
"stringscut[replace strings.Index etc. with strings.Cut]"
"stringscutprefix[replace HasPrefix/TrimPrefix with CutPrefix]"
"stringsseq[replace ranging over Split/Fields with SplitSeq/FieldsSeq]"
"testingcontext[replace context.WithCancel with t.Context in tests]"
"waitgroup[replace wg.Add(1)/go/wg.Done() with wg.Go]"
) )
_values -s ',' 'fix name' $fix_names _values 'analyzer' $fix_analyzers
}
__go_pprof_symbolize_types() {
local -a symbolize_types=(
"none[Do not attempt symbolization]"
"local[Examine only local binaries]"
"fastlocal[Only get function names from local binaries]"
"remote[Do not examine local binaries]"
"force[Force re-symbolization]"
)
_values 'symbolize_type' $symbolize_types
} }
if [[ "$service" = -value-* ]]; then if [[ "$service" = -value-* ]]; then
@ -399,6 +424,38 @@ case $state in
'why:explain why packages or modules are needed' 'why:explain why packages or modules are needed'
'help:get more information about a command' 'help:get more information about a command'
) )
local -a fix_flags=(
'-fixtool=[specify fix analyzer]:analyzer:__go_fix_analyzers'
'-diff[display diffs instead of rewriting files]'
'-fixtool=[select analysis tool]:analyzer:'
'(- *)-V[print version and exit]'
'-any[enable any analysis]'
'-buildtag[enable buildtag analysis]'
'-c[display offending line with this many lines of content(default: -1)]:num'
'-fix[apply all suggested fixes]'
'-flags[print analyzer flags in JSON]'
'-fmtappendf[enable fmtappendf analysis]'
'-forvar[enable forvar analysis]'
'-hostport[enable hostport analysis]'
'-inline[enable inline analysis]'
'-json[emit JSON output]'
'-mapsloop[enable mapsloop analysis]'
'-minmax[enable minmax analysis]'
'-newexpr[enable newexpr analysis]'
'-omitzero[enable omitzero analysis]'
'-plusbuild[enable plusbuild analysis]'
'-rangeint[enable rangeint analysis]'
'-reflecttypefor[enable reflecttypefor analysis]'
'-slicescontains[enable slicescontains analysis]'
'-slicessort[enable slicessort analysis]'
'-stditerators[enable stditerators analysis]'
'-stringsbuilder[enable stringsbuilder analysis]'
'-stringscut[enable stringscut analysis]'
'-stringscutprefix[enable stringscutprefix analysis]'
'-stringsseq[enable stringsseq analysis]'
'-testingcontext[enable testingcontext analysis]'
'-waitgroup[enable waitgroup analysis]'
)
case $words[1] in case $words[1] in
(build) (build)
@ -532,10 +589,7 @@ case $state in
(fix) (fix)
_arguments \ _arguments \
'-C[change to directory before running the command]: :_files -/' \ '-C[change to directory before running the command]: :_files -/' \
'-diff[display diffs instead of rewriting files]' \ $fix_flags[@] \
'-force[force these fixes to run even if the code looks updated]:fix_names:__go_fix_names' \
'-go[go language version for files]:version' \
'-r[restrict the rewrites to this comma-separated list]:fix_names:__go_fix_names' \
'*:importpaths:__go_packages' '*:importpaths:__go_packages'
;; ;;
@ -572,7 +626,6 @@ case $state in
(install) (install)
_arguments \ _arguments \
${build_flags[@]} \ ${build_flags[@]} \
'-json[emit install output in JSON suitable for automated processing]' \
'*:importpaths:__go_packages' '*:importpaths:__go_packages'
;; ;;
@ -602,7 +655,7 @@ case $state in
;; ;;
(mod) (mod)
_arguments \ _arguments -C \
"1: :{_describe 'command' mod_commands}" \ "1: :{_describe 'command' mod_commands}" \
'*:: :->args' '*:: :->args'
@ -639,8 +692,8 @@ case $state in
'-e[attempt to proceed despite errors encountered while loading packages]' \ '-e[attempt to proceed despite errors encountered while loading packages]' \
'-x[print the commands download executes]' \ '-x[print the commands download executes]' \
'-diff[not to modify go.mod or go.sum but instead print necessary changes as a unified diff]' \ '-diff[not to modify go.mod or go.sum but instead print necessary changes as a unified diff]' \
'-go[update the go directive in the go.mod file to the given version]:goversion' \ '-go=[update the go directive in the go.mod file to the given version]:goversion' \
'-compat[preserves additional checksums needed for the indicated Go version]:version' '-compat=[preserves additional checksums needed for the indicated Go version]:version'
;; ;;
(vendor) (vendor)
_arguments \ _arguments \
@ -712,6 +765,7 @@ case $state in
else else
_arguments \ _arguments \
"-c[compile but don't run test]" \ "-c[compile but don't run test]" \
'-artifacts[save test artifacts in the directory specified by -outputdir]' \
'-bench[run benchmarks matching the regular expression]:regexp' \ '-bench[run benchmarks matching the regular expression]:regexp' \
'-benchmem[print memory allocation statistics for benchmarks]' \ '-benchmem[print memory allocation statistics for benchmarks]' \
'-benchtime[run benchmarks for t rime]:t' \ '-benchtime[run benchmarks for t rime]:t' \
@ -908,12 +962,12 @@ case $state in
;; ;;
(fix) (fix)
if [[ $words[2] == "help" ]]; then
__go_fix_analyzers
else
_arguments \ _arguments \
'(* -)-help[show help message]' \ "*:args:{ _alternative ':subcommand:(help)' _files }"
'-diff[display diffs instead of rewriting files]' \ fi
'-force[force fixes to run even if the code looks updated]:string:__go_fix_names' \
'-r[restrict the rewrites]:string:__go_fix_names' \
'*:files:_files'
;; ;;
(link) (link)
@ -995,15 +1049,17 @@ case $state in
':files:_files' ':files:_files'
;; ;;
pprof) (pprof)
_arguments \ _arguments \
'-callgrind[outputs a graph in callgrind format]' \ '-callgrind[outputs a graph in callgrind format]' \
'-comments[output all profile comments]' \
'-disasm=[output annotated assembly]:p' \ '-disasm=[output annotated assembly]:p' \
'-dot[outputs a graph in DOT format]' \ '-dot[outputs a graph in DOT format]' \
'-eog[visualize graph through eog]' \ '-eog[visualize graph through eog]' \
'-evince[visualize graph through evince]' \ '-evince[visualize graph through evince]' \
'-gif[outputs a graph image in GIF format]' \ '-gif[outputs a graph image in GIF format]' \
'-gv[visualize graph through gv]' \ '-gv[visualize graph through gv]' \
'-kcachegrind[visualize report in KCachegrind]' \
'-list=[output annotated source for functions matching regexp]:p' \ '-list=[output annotated source for functions matching regexp]:p' \
'-pdf[outputs a graph in PDF format]' \ '-pdf[outputs a graph in PDF format]' \
'-peek=[output callers/callees of functions matching regexp]:p' \ '-peek=[output callers/callees of functions matching regexp]:p' \
@ -1015,23 +1071,61 @@ case $state in
'-tags[outputs all tags in the profile]' \ '-tags[outputs all tags in the profile]' \
'-text[outputs top entries in text form]' \ '-text[outputs top entries in text form]' \
'-top[outputs top entries in text form]' \ '-top[outputs top entries in text form]' \
'-topproto[outputs top entries in compresses protobuf format]' \
'-traces[outputs all profile samples in text form]' \
'-tree[outputs a text rendering of call graph]' \ '-tree[outputs a text rendering of call graph]' \
'-web[visualize graph through web browser]' \ '-web[visualize graph through web browser]' \
'-weblist=[output annotated source in HTML]:p' \ '-weblist=[output annotated source in HTML]:p' \
'-call_tree[generate a context-sensitive call tree]' \
'-compact_labels[show minimal headers]' \
'-divide_by=[scale all samples by dividing them by f]:f' \
'-drop_negative[ignore negative differences]' \
'-edgefraction=[hide edges below <f>*total]:f' \
'-focus=[restricts to paths going through a node matching regexp]:r' \
'-hide=[skips nodes matching regexp]:regexp' \
'-ignore=[skips paths going through any nodes matching regexp]:r' \
'-intel_syntax[show assembly in Intel syntax]' \
'-mean[average sample value over first value]' \
'-nodecount=[max number of nodes to show]:n' \
'-nodefraction=[hide nodes below <f>*total]:f' \
'-noinlines[ignore inlines]' \
'-normalize[scales profile based on the base profile]' \
'-output=[generate output on file f (stdout by default)]:f' \ '-output=[generate output on file f (stdout by default)]:f' \
'-prune_from[drops any functions below the matched frame]' \
'-relative_percentages[show percentages relative to focused subgraph]' \
'-sample_index[index of sample value to display]' \
'-show=[only show nodes matching regexp]:regexp' \
'-show-from=[drops functions above the highest matched frame]:regexp' \
'-show-columns[show column numbers at the source code line level]' \
'-source_path=[search path for source files]:path:_files -/' \
'-tagfocus=[restrict to samples tagged with key:value matching regexp]:r' \
'-taghide=[skip tags matching this regexp]:regexp' \
'-tagignore=[discard samples tagged with key:value matching regexp]:regexp' \
'-tagleaf[add pseudo stack frames for labels key/value pairs at the callstack leaf]' \
'-tagroot[add pseudo stack frames for labels key/value pairs at the callstack root]' \
'-trim[honor nodefraction/edgefraction/nodecount defaults]' \
'-trim_path[path to trim from source paths before search]:path:_files -/' \
'-unit=[convert all samples to unit u for display]:u' \
'-functions[report at function level (default)]' \ '-functions[report at function level (default)]' \
'-filefunctions[aggregate at the file function level]' \
'-files[report at source file level]' \ '-files[report at source file level]' \
'-lines[report at source line level]' \ '-lines[report at source line level]' \
'-addresses[report at address level]' \ '-addresses[report at address level]' \
'-base[show delta from this profile]:profile' \
'-drop_negative[ignore negative differences]' \
'-cum[sort by cumulative data]' \ '-cum[sort by cumulative data]' \
'-flat[sort entries based on own weight]' \
'-seconds=[length of time for dynamic profiles]:n' \ '-seconds=[length of time for dynamic profiles]:n' \
'-nodecount=[max number of nodes to show]:n' \ '-timeout=[timeout in seconds for profile collection]:seconds' \
'-nodefraction=[hide nodes below <f>*total]:f' \ '-buildid=[override build id for main binary in profile]:id' \
'-edgefraction=[hide edges below <f>*total]:f' \ '-add_comment=[free-form annotation to add to the profile]:comment' \
'-sample_index[index of sample value to display]' \ '-diff_base=[source of base profile for comparison]:source:_files' \
'-mean[average sample value over first value]' \ '-base[show delta from this profile]:profile' \
'-symbolize=[controls source of symbol information]:source:__go_pprof_symbolize_types' \
'-tls_cert=[TLS client certificate file for fetchign profile and symbols]:file:_files' \
'-tls_key=[TLS private key file for fetching profile and symbols]:file:_files' \
'-tls_ca=[TLS CA certs file for fetching profile and symbols]:file:_files' \
'-http=[provide web interface at host:port]:host_port' \
'-no_browser[skip opening a browser for the interactive web UI]' \
'-tools=[search path for object tools]:path:_files -/' \
'-inuse_space[display in-use memory size]' \ '-inuse_space[display in-use memory size]' \
'-inuse_objects[display in-use object counts]' \ '-inuse_objects[display in-use object counts]' \
'-alloc_space[display allocated memory size]' \ '-alloc_space[display allocated memory size]' \
@ -1039,16 +1133,6 @@ case $state in
'-total_delay[display total delay at each region]' \ '-total_delay[display total delay at each region]' \
'-contentions[display number of delays at each region]' \ '-contentions[display number of delays at each region]' \
'-mean_delay[display mean delay at each region]' \ '-mean_delay[display mean delay at each region]' \
'-runtime[show runtime call frames in memory profiles]' \
'-focus=[restricts to paths going through a node matching regexp]:r' \
'-ignore=[skips paths going through any nodes matching regexp]:r' \
'-tagfocus=[restrict to samples tagged with key:value matching regexp]:r' \
'-tagignore=[discard samples tagged with key:value matching regexp]' \
'-call_tree[generate a context-sensitive call tree]' \
'-unit=[convert all samples to unit u for display]:u' \
'-divide_by=[scale all samples by dividing them by f]:f' \
'-buildid=[override build id for main binary in profile]:id' \
'-tools=[search path for object-level tools]:path' \
'-help[help message]' \ '-help[help message]' \
'*:files:_files' '*:files:_files'
;; ;;