Skip to content
This repository has been archived by the owner on May 22, 2018. It is now read-only.

add boxen autocomplete #81

Merged
merged 1 commit into from
Jan 14, 2014
Merged

add boxen autocomplete #81

merged 1 commit into from
Jan 14, 2014

Conversation

grosser
Copy link
Contributor

@grosser grosser commented Dec 19, 2013

@dgoodlad

tab completion for boxen, knows all commands + servies + commands that accept directories

boxen -<TAB>
--debug             --future-parser     --no-color          --profile           --stealth
--disable-service   --help              --no-fde            --projects          --token
--disable-services  --homedir           --no-issue          --report            --user
--enable-service    --list-services     --no-pull           --restart-service   -?
--enable-services   --logfile           --noop              --restart-services  -h
--env               --login             --pretend           --srcdir

boxen --restart-service<TAB>
--restart-service   --restart-services

boxen --restart-service <TAB>
dnsmasq          memcached        nginx            solr
indexer          mysql            redis

@dgoodlad
Copy link
Contributor

I really like the idea of supplying autocomplete scripts for the boxen CLI! However, I've got a few things which make me hesitate to merge this as-is:

  1. CLI-next boxen#134 is likely to obsolete this implementation pretty quickly
  2. Please correct me if I'm wrong, but is this bash-specific? How would that env script behave in, for example, zsh?
  3. I'm not a huge fan of booting Ruby to do tab-completion, and would much prefer to see a native shell implementation

@@ -0,0 +1,38 @@
#!/usr/bin/env ruby
# used via see team/manifests/engineering.pp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably talking about something in your org's private repo?

@grosser
Copy link
Contributor Author

grosser commented Dec 20, 2013

1: Will be easy to adjust, core features stay the same, just a few new
arrays to look through
2: It's bash specific atm, but zsh should also be able to hook into it,
until any zsh user cares enough to do a PR it can stay bash only (type
complete &&)
3: Bash is just much harder to do/test/debug/contribute for other
ruby-hackers etc, and booting up ruby is super fast as long as no rubygems
are involved (0.15s on my system -> no noticeable delay).
-> we get a good solution now and if someone really cares for the 0.15s
delay they can reimplement it.

On Thu, Dec 19, 2013 at 9:10 PM, David Goodlad notifications@gh.neting.ccwrote:

I really like the idea of supplying autocomplete scripts for the boxen
CLI! However, I've got a few things which make me hesitate to merge this
as-is:

  1. CLI-next boxen#134 CLI-next boxen#134 is likely
    to obsolete this implementation pretty quickly
  2. Please correct me if I'm wrong, but is this bash-specific? How
    would that env script behave in, for example, zsh?
  3. I'm not a huge fan of booting Ruby to do tab-completion, and would
    much prefer to see a native shell implementation


Reply to this email directly or view it on GitHubhttps://github.com//pull/81#issuecomment-30989274
.

@grosser
Copy link
Contributor Author

grosser commented Dec 23, 2013

@wfarr @rafaelfranca would love to hear your opinions on this / how far away cli-next is ?

@dgoodlad
Copy link
Contributor

@grosser That all sounds fine. cli-next is soon, but not right away, so I'm totally happy to roll this in first. If it has to be deprecated temporarily when we roll cli-next out, so be it :)

One last thing, though: How do you feel about extracting it into its own class within this module – e.g. boxen::bash_completion? Then if you and your team decide they all want it, you can throw include boxen::bash_completion into your site.pp. Sound good?

@grosser
Copy link
Contributor Author

grosser commented Dec 23, 2013

Sounds good at #1.
Making it a class sounds fine to me, but I'd love to have it on by default,
so that new users instantly get this "wow that's neat" experience when
using it. If there are any concerns/downsides to having an extra
completion, then that's a different story ... do you know anything that
would be bad about it ? / maybe add and see if anyone opens an issue / does
not want it ?

On Sun, Dec 22, 2013 at 9:39 PM, David Goodlad notifications@gh.neting.ccwrote:

@grosser https://github.com/grosser That all sounds fine. cli-next is
soon, but not right away, so I'm totally happy to roll this in first. If it
has to be deprecated temporarily when we roll cli-next out, so be it :)

One last thing, though: How do you feel about extracting it into its own
class within this module – e.g. boxen::bash_completion? Then if you and
your team decide they all want it, you can throw include
boxen::bash_completion into your site.pp. Sound good?


Reply to this email directly or view it on GitHubhttps://github.com//pull/81#issuecomment-31105132
.

@grosser
Copy link
Contributor Author

grosser commented Jan 6, 2014

hmm can I haz merge ?

@grosser
Copy link
Contributor Author

grosser commented Jan 10, 2014

bump

dgoodlad added a commit that referenced this pull request Jan 14, 2014
@dgoodlad dgoodlad merged commit 535cc65 into boxen:master Jan 14, 2014
@dgoodlad
Copy link
Contributor

Released in 3.3.8

@grosser
Copy link
Contributor Author

grosser commented Jan 14, 2014

Thx! :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants