Skip to content

feat(cli): add 'concore completion' for bash, zsh and fish - #694

Open
yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-completion
Open

yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/cli-completion

Conversation

@yadavchiragg

Copy link
Copy Markdown

Why

concore has a dozen commands and options such as --type windows|posix|docker, but no shell completion.

What

concore completion <bash|zsh|fish> prints the tab-completion script generated by Click's built-in support (Click >= 8.0, which is already the minimum). One line in the shell startup file enables it, documented in the CLI README:
eval "$(concore completion zsh)"

Testing

  • tests/test_completion_command.py (7 tests): script is produced for each shell, unknown shell rejected, commands/option values/shell names are completed
  • ran the generated bash script in a real bash: va -> validate, --ty -> --type, --type <TAB> -> windows posix docker
  • existing CLI tests unchanged, ruff clean
  • zsh and fish scripts are Click's standard ones; only checked that they print

Docs

Added concore completion to concore_cli/README.md

Prints the Click-generated tab-completion script so commands, options and option values complete in the shell. Verified with real bash completion. Tests and docs included.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant