Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: help and completion for TYPE_GROUP_SET #81

Open
hemna opened this issue Apr 17, 2019 · 2 comments
Open

feature request: help and completion for TYPE_GROUP_SET #81

hemna opened this issue Apr 17, 2019 · 2 comments

Comments

@hemna
Copy link

hemna commented Apr 17, 2019

I have an script that has a list of string values that are acceptable as a command.

# ARG_POSITIONAL_SINGLE([command], [The command you want to run.], [setup_everything])
# ARG_TYPE_GROUP_SET([commands], [COMMAND], [command], [add_compute,build_images,deploy_airship,deploy_osh,clean_airship,clean_airship_not_images,clean_k8s,deploy_caasp,deploy_ccp_deployer,deploy_ses,enroll_caasp_workers,patch_upstream,setup_airship,setup_caasp_workers_for_openstack,setup_everything,setup_hosts,setup_openstack,teardown,update_airship_osh], [index])

It would be nice if the help output included the list of possible values for that specific command. Currently, this is all you get...

	<command>: The command you want to run. (default: 'setup_everything')

You can't find out what the possible values are unless you give the generated script a bogus value.

Also,
The bash completion doesn't support showing those list when you try tab for the command.

@matejak matejak added the bug label Apr 17, 2019
@matejak
Copy link
Owner

matejak commented Apr 17, 2019

The bash completion that is not working is a bug, it is expected to work.

The help message request is a duplicate of #76.

@matejak matejak added this to the 2.8.1 milestone Apr 17, 2019
@matejak
Copy link
Owner

matejak commented May 12, 2019

So the completion now works only for optional arguments, positional arguments (s.a. your example) don't have the completion implemented.
This is not trivial, as the completion functionality would generally have to understand what argument is being completed. This is easy for optional args (it is enough just to look at the previous word on the command-line), but it is more complicated for positional arguments - is it the first one, second one, ...?

@matejak matejak added enhancement and removed bug labels May 12, 2019
@matejak matejak modified the milestones: 2.8.1, 2.9.0 May 12, 2019
@matejak matejak removed this from the 2.9.0 milestone Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants