feat(completion): add missing flags and dynamic experimental feature detection by vmaerten · Pull Request #2532 · go-task/task

Improve shell completion scripts with missing flags and dynamic experimental feature support

This PR updates all shell completion scripts (Bash, Zsh, Fish, PowerShell) to include missing flags and dynamically detect experimental features.

Problem

Completion scripts were missing many flags:

  • Short forms: -n, -x, -y, -a, -g, -j
  • New flags: --completion, --experiments, --insecure, --nested, --no-status, --sort, --output-group-error-only
  • Experimental flags: --force-all, --download, --offline, --timeout, --clear-cache, --expiry

Coverage before: Bash (~100% via _parse_help), Zsh (34%), Fish (30%), PowerShell (24%)

Changes

All shells:

  • Added dynamic experimental flag detection via task --experiments
  • Flags only appear when experiments are enabled (GENTLE_FORCE, REMOTE_TASKFILES)

  • Bash: Added _task_experiment_flags() function
  • Zsh: Added 18 missing flags, refactored to array-based arguments
  • Fish: Added 22 missing flags
  • PowerShell: Added 26 missing flags + short forms support

Coverage after: 100% for all shells

How it works

Each shell queries task --experiments at runtime and conditionally adds experimental flags based on enabled features.