1build icon indicating copy to clipboard operation
1build copied to clipboard

Add bash completion for 1build

Open AdeshAtole opened this issue 5 years ago • 4 comments

Description

We can have command completion for commands in 1build.yaml Would help improving productivity

Acceptance Criteria

Command completion for commands defined in 1build.yaml (for bash to start with)

Notes

https://github.com/spf13/cobra/blob/master/bash_completions.md

AdeshAtole avatar Jun 13 '19 12:06 AdeshAtole

Does it include suggesting multiple commands or a user has to type enough letters for us to define a single command and then it is displayed?

Example – I type 1build and hit a tab – it displays a full list of commands and then optionally I can navigate through them with the tab. Or I type 1build b and it completes to 1build build because it is the only command starting with B letter.

We can also choose to move iteratively with the end goal of those suggested multiple options.

gopinath-langote avatar Jun 14 '19 09:06 gopinath-langote

@gopinath-langote

I type 1build and hit a tab – it displays a full list of commands and then optionally I can navigate through them with the tab. Or I type 1build b and it completes to 1build build because it is the only command starting with B letter.

Both cases, except for navigating through them using tab. If user has typed enough characters to distinguish the command, it will get completed, else matching commands will be shown.

We can start with bash and then extend support to other shells if needed.

AdeshAtole avatar Jun 14 '19 13:06 AdeshAtole

@gopinath-langote @landpro Let me know if I can pick this up

AdeshAtole avatar Jun 15 '19 13:06 AdeshAtole

@AdeshAtole Thanks for feature suggestion. this feature is important and very useful for developers.

feel free to open the PR.

gopinath-langote avatar Jun 16 '19 09:06 gopinath-langote