From a60debf6245c863171d4cfb10b788deb0f45a8db Mon Sep 17 00:00:00 2001 From: Auca Coyan Date: Thu, 29 Feb 2024 17:23:17 -0300 Subject: [PATCH] :sparkles: add `cargo-make` completions (#769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi! I added cargo make completions 😄 ![image](https://github.com/nushell/nu_scripts/assets/30557287/8d8d64e8-82a7-4d20-8879-f401a00bf6f5) --- .../cargo-make/cargo-make-completions.nu | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 custom-completions/cargo-make/cargo-make-completions.nu diff --git a/custom-completions/cargo-make/cargo-make-completions.nu b/custom-completions/cargo-make/cargo-make-completions.nu new file mode 100644 index 00000000..8c198677 --- /dev/null +++ b/custom-completions/cargo-make/cargo-make-completions.nu @@ -0,0 +1,51 @@ +alias makers = cargo make +alias "carg-make make" = cargo make + +export extern "cargo make" [ + task?: string@"nu-complete tasks" # task to run + --help(-h) # Print help information + --version(-V) # Print version information + --makefile: path # The optional toml file containing the tasks definitions + --task(-t): string@"nu-complete tasks" # The task name to execute (can omit the flag if the task name is the last argument) [default: default] + --profile(-p): string # The profile name (will be converted to lower case) [default: development] + # --profile(-p): string@"nu-complete profiles" # The profile name (will be converted to lower case) [default: development] + --cwd: path # Will set the current working directory. The search for the makefile will be from this directory if defined. + --no-workspace # Disable workspace support (tasks are triggered on workspace and not on members) + --no-on-error # Disable on error flow even if defined in config sections + --allow-private # Allow invocation of private tasks + --skip-init-end-tasks # If set, init and end tasks are skipped + --skip-tasks: string # Skip all tasks that match the provided regex (example: pre.*|post.*) + --env-file: path # Set environment variables from provided file + --env(-e): string # Set environment variables + --loglevel(-l): string@"nu-complete loglevels" # The log level (verbose, info, error, off) [default: info] + --verbose(-v) # Sets the log level to verbose (shorthand for --loglevel verbose) + --quiet # Sets the log level to error (shorthand for --loglevel error) + --silent # Sets the log level to off (shorthand for --loglevel off) + --no-color # Disables colorful output + --time-summary # Print task level time summary at end of flow + --experimental # Allows access unsupported experimental predefined tasks. + --disable-check-for-updates # Disables the update check during startup + --output-format: string@"nu-complete output-format" # The print/list steps format (some operations do not support all formats) (default, short-description, markdown, markdown-single-page, markdown-sub-section, autocomplete) + --output-file: path # The list steps output file name + --hide-uninteresting # Hide any minor tasks such as pre/post hooks. + --print-steps # Only prints the steps of the build in the order they will be invoked but without invoking them + --list-all-steps # Lists all known steps + --list-category-steps: string # List steps for a given category + --diff-steps # Runs diff between custom flow and prebuilt flow (requires git) +] + +def "nu-complete tasks" [] { + open Makefile.toml | get tasks | columns +} + +def "nu-complete profiles" [] { + # TODO +} + +def "nu-complete loglevels" [] { + ['verbose', 'info', 'error', 'off'] +} + +def "nu-complete output-format" [] { + ['default', 'short-description', 'markdown', 'markdown-single-page', 'markdown-sub-section', 'autocomplete'] +} \ No newline at end of file