atomicapp icon indicating copy to clipboard operation
atomicapp copied to clipboard

cli auto-complete for atomicapp

Open surajssd opened this issue 9 years ago • 16 comments

atomicapp is missing auto-complete of commands, this would be nice feature to have.

surajssd avatar Mar 16 '16 07:03 surajssd

+1 for bash completion. @surajssd if you want, we can work on this together.

concaf avatar Mar 16 '16 08:03 concaf

@containscafeine I feel this can be a beginner friendly issue which new people who wanna contribute can work on.

surajssd avatar Mar 16 '16 10:03 surajssd

@surajssd this could be an interesting thing to have, but if we mainly run from an embedded container then we might not ever see the benefits of something like this

dustymabe avatar Mar 16 '16 10:03 dustymabe

Hi, I'm beginner to atomic project and wanna work on this issue, please guide me further.

shiminsh avatar Mar 18 '16 15:03 shiminsh

@shiminsh How docker-machine does their bash autocompletion could possibly help: https://github.com/docker/machine/blob/master/contrib/completion/bash/docker-machine.bash

cdrage avatar Mar 18 '16 19:03 cdrage

Hi, I was just browsing through the issue and gave it a shot here is the poc https://asciinema.org/a/3ygvn2uxnstvgsn3h02e4kng2 and the code which I wrote for it https://github.com/abhi1004/atomicapp_cli_completion Could you please review if it is the step in the right direction. @shiminsh were you thinking in the same direction ? @dustymabe @cdrage any suggestions ?

Regards, Abhishek

procrypt avatar Mar 22 '16 19:03 procrypt

@abhi1004 this looks pretty awesome! I am fairly new to bash completion development. do you know if it is possible to autogenerate the competion file https://github.com/abhi1004/atomicapp_cli_completion ?

dustymabe avatar Mar 23 '16 16:03 dustymabe

@dustymabe thanks for the review, I'll try to figure it out if it is possible to autogenerate the completion file.

procrypt avatar Mar 23 '16 16:03 procrypt

@abhi1004 Yeah, mine is also in same direction but you should have talked here before working on any issue, as I'm working on same.

shiminsh avatar Mar 23 '16 17:03 shiminsh

@abhi1004 that'd be awesome :) even if it's a bash script that will auto generate from atomicapp's output that'd be great.

I've been trying to google for a solution but none so far, if it's too hard then there's no worries, even large projects still have to update their autocompletion manually since there's not a solution to autogenerating it.

cdrage avatar Mar 23 '16 17:03 cdrage

@abhi1004 Yeah, mine is also in same direction but you should have talked here before working on any issue, as I'm working on same.

@shiminsh I agree. @abhi1004 @shiminsh I would like to thank you both for your interests. Do you mind working on this together?

Also feel free to try to pick up other issues that look like low hanging fruit and thanks again!

dustymabe avatar Mar 23 '16 17:03 dustymabe

@shiminsh I apologize that I have created a short poc for it, we can work on this together if you agree and please accept my apologies. @dustymabe thanks and yes I'll work on some other issue as well. @cdrage thank you for the review and I'll try if I can help to fix the issue.

procrypt avatar Mar 23 '16 17:03 procrypt

@abhi1004 and @shiminsh, Thanks for your PRs - did either of you ever investigate if there is a good way to autogenerate the bash completion files so that we don't have to maintain it seperately from the code?

dustymabe avatar Apr 04 '16 21:04 dustymabe

@dustymabe I searched a lot about it, but no luck.

procrypt avatar Apr 05 '16 03:04 procrypt

@dustymabe @shiminsh @abhi1004 I have found a Python library which auto-generates this, but I don't know how much of work this is? http://docs.openstack.org/developer/cliff/complete.html

Complete documentation of the cliff http://docs.openstack.org/developer/cliff/

surajssd avatar Apr 06 '16 15:04 surajssd

Okay, lets try this.

shiminsh avatar Apr 06 '16 16:04 shiminsh