tocc icon indicating copy to clipboard operation
tocc copied to clipboard

CLI: Auto complete for all the arguments

Open aidin36 opened this issue 9 years ago • 4 comments

There can be auto-complete for all the arguments of CLI. For example, when I write tocc --tag and press the tab, it complete the command to tocc --tags-statistics.

It can also be more smarter. Have you seen git auto-complete? If you type git checkout iss and press tab, it will complete to git checkout issue12 (assume that you have a issue12 branch). Tocc's CLI can auto-complete things like tags, for example when I write tocc --query tag=bo and press double tab, it can list all available tags started with bo.

aidin36 avatar Nov 13 '14 04:11 aidin36

Is this possible? I thought that tocc would not be executed until after you have typed the whole command line and hit enter. Before that, isn't the shell running, which knows nothing about tocc? Is there something I don't understand here?

DThiebaud avatar Jan 10 '15 22:01 DThiebaud

Upon investigation: yes, it can be done. It is done in bash, using bash auto-completion. See http://tldp.org/LDP/abs/html/tabexpansion.html

DThiebaud avatar Jan 10 '15 22:01 DThiebaud

(-: Thanks for the research.

Should I assign this to you? Are you going to work on it?

aidin36 avatar Jan 12 '15 18:01 aidin36

On 1/12/2015 1:03 PM, Aidin Gharibnavaz wrote:

(-: Thanks for the research.

Should I assign this to you? Are you going to work on it?

— Reply to this email directly or view it on GitHub https://github.com/aidin36/tocc/issues/103#issuecomment-69614672.

I'm busy right now. I'll take the task in a couple of weeks if no one picks it up first.

DThiebaud avatar Jan 12 '15 18:01 DThiebaud