-
-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Could autocompletions be made so that when trying to autocomplete a flag, only allowed values for it are shown?
As an example, given the following command:
commands:
- name: deploy
args:
- name: name
required: true
help: Name of the service
repeatable: true
allowed: [ a, b, c ]
flags:
- long: --stage
short: -s
help: Stage to manage
arg: stage
allowed:
- dev
- test
- prod
Autocompletions will be as follows:
./cli deploy <TAB>
--help a test
--stage b prod
-h c
-s dev
Triggering autocomplete for the -s flag will result in the same autocompletions being shown:
./cli deploy -s <TAB>
--help a test
--stage b prod
-h c
-s dev
Would be clearer if:
- when autocompleting a command, show possible flags and allowed values for the positional argument
- when autocompleting a flag, show possible values for the flag only
Example:
For the command:
./cli deploy <TAB>
--help a
--stage b
-h c
-s
For the flag
./cli deploy -s <TAB>
dev
test
prod
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request