diff --git a/CHANGELOG.rst b/CHANGELOG.rst index df84e1071..2f6f283cd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -103,6 +103,7 @@ Completions - ``az`` (:issue:`8141`) - ``qmk`` (:issue:`8180`) - ``cpupower`` + - ``dart`` - Improvements to many completions, especially for ``git`` aliases (:issue:`8129`) and subcommands (:issue:`8134`). - The ``fish_is_nth_token`` function, which is particularly useful in completions for identifying the token number within the command line, replaces various internal functions to do the same (:issue:`8008`). diff --git a/share/completions/dart.fish b/share/completions/dart.fish new file mode 100644 index 000000000..d427b618e --- /dev/null +++ b/share/completions/dart.fish @@ -0,0 +1,90 @@ +# global option +complete -c dart -s h -l help -d "Print this usage information." +complete -c dart -s v -l verbose -d "Show additional command output." +complete -c dart -l version -d "Print the Dart SDK version." +complete -c dart -l enable-analytics -d "Enable analytics." +complete -c dart -l disable-analytics -d "Disable analytics." + +# commands +complete -f -c dart -n '__fish_use_subcommand' -xa analyze -d "Analyze Dart code in a directory." +complete -f -c dart -n '__fish_use_subcommand' -xa compile -d "Compile Dart to various formats." +complete -f -c dart -n '__fish_use_subcommand' -xa create -d "Create a new Dart project." +complete -f -c dart -n '__fish_use_subcommand' -xa fix -d "Apply automated fixes to Dart source code." +complete -f -c dart -n '__fish_use_subcommand' -xa format -d "Idiomatically format Dart source code." +complete -f -c dart -n '__fish_use_subcommand' -xa migrate -d "Perform null safety migration on a project." +complete -f -c dart -n '__fish_use_subcommand' -xa pub -d "Work with packages." +complete -f -c dart -n '__fish_use_subcommand' -xa run -d "Run a Dart program." +complete -f -c dart -n '__fish_use_subcommand' -xa test -d "Run tests for a project." + +# analyze +complete -c dart -n '__fish_seen_subcommand_from analyze' -l fatal-infos -d 'Treat info level issues as fatal.' +complete -c dart -n '__fish_seen_subcommand_from analyze' -l fatal-warnings -d 'Treat warning level issues as fatal. (defaults to on)' +complete -c dart -n '__fish_seen_subcommand_from analyze' -l no-fatal-warnings -d 'Treat warning level issues as fatal. (defaults to on)' + +# compile +complete -c dart -n '__fish_seen_subcommand_from compile' -xa aot-snapshot -d 'Compile Dart to an AOT snapshot.' +complete -c dart -n '__fish_seen_subcommand_from compile' -xa exe -d 'Compile Dart to a self-contained executable.' +complete -c dart -n '__fish_seen_subcommand_from compile' -xa jit-snapshot -d 'Compile Dart to a JIT snapshot.' +complete -c dart -n '__fish_seen_subcommand_from compile' -xa js -d 'Compile Dart to JavaScript.' +complete -c dart -n '__fish_seen_subcommand_from compile' -xa kernel -d 'Compile Dart to a kernel snapshot.' + +# create +complete -c dart -n '__fish_seen_subcommand_from create' -s t -l template -d 'The project template to use. [console-simple (default), console-full, package-simple, server-shelf, web-simple]' +complete -c dart -n '__fish_seen_subcommand_from create' -l pub -d 'Whether to run \'pub get\' after the project has been created. (defaults to on)' +complete -c dart -n '__fish_seen_subcommand_from create' -l no-pub -d 'Whether to run \'pub get\' after the project has been created. (defaults to on)' +complete -c dart -n '__fish_seen_subcommand_from create' -l force -d 'Force project generation, even if the target directory already exists.' + +# fix +complete -c dart -n '__fish_seen_subcommand_from fix' -s n -d 'Preview the proposed changes but make no changes.' +complete -c dart -n '__fish_seen_subcommand_from fix' -l dry-run -d 'Preview the proposed changes but make no changes.' +complete -c dart -n '__fish_seen_subcommand_from fix' -l apply -d 'Apply the proposed changes.' + +# format +complete -c dart -n '__fish_seen_subcommand_from format' -s o -l output -d 'Set where to write formatted output.' +complete -c dart -n '__fish_seen_subcommand_from format' -l set-exit-if-changed -d 'Return exit code 1 if there are any formatting changes.' +complete -c dart -n '__fish_seen_subcommand_from format' -l fix -d 'Apply all style fixes.' +complete -c dart -n '__fish_seen_subcommand_from format' -s l -l line-length -d 'Wrap lines longer than this. (defaults to "80")' + +# migrate +complete -c dart -n '__fish_seen_subcommand_from migrate' -l apply-changes -d 'Apply the proposed null safety changes to the files on disk.' +complete -c dart -n '__fish_seen_subcommand_from migrate' -l ignore-errors -d 'Attempt to perform null safety analysis even if the project has analysis errors.' +complete -c dart -n '__fish_seen_subcommand_from migrate' -l skip-import-check -d 'Go ahead with migration even if some imported files have not yet been migrated.' +complete -c dart -n '__fish_seen_subcommand_from migrate' -l web-preview -d 'Show an interactive preview of the proposed null safety changes in a browser window. Use --no-web-preview to print proposed changes to the console. (defaults to on)' +complete -c dart -n '__fish_seen_subcommand_from migrate' -l no-web-preview -d 'Show an interactive preview of the proposed null safety changes in a browser window. Use --no-web-preview to print proposed changes to the console. (defaults to on)' +complete -c dart -n '__fish_seen_subcommand_from migrate' -l preview-hostname -d 'Run the preview server on the specified hostname. If not specified, "localhost" is used. Use "any" to specify IPv6.any or IPv4.any.(defaults to "localhost")' +complete -c dart -n '__fish_seen_subcommand_from migrate' -l preview-port -d 'Run the preview server on the specified port. If not specified, dynamically allocate a port.' +complete -c dart -n '__fish_seen_subcommand_from migrate' -l preview-port -d 'Output a machine-readable summary of migration changes.' + +# pub +complete -c dart -n '__fish_seen_subcommand_from pub' -s C -l directory -d 'Run the subcommand in the directory