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

Add flag to init for --man and --completions, default to both #368

Open
StephenBrown2 opened this issue Nov 6, 2015 · 2 comments
Open

Comments

@StephenBrown2
Copy link
Contributor

As I use zsh, I don't want rack automatically adding a source to ~/.bashrc (it fails anyways if it's not there), as that won't be used.

--man flag would only generate the man page,
--completions flag would generate the bash completions file,
both would put them in the current directory, or the proper directory (as /usr/share/man/man1/ rack.1 and /etc/bash_completion.d/rack, respectively).

Running without either flag could do what it does now, depending on #146

edit: negative grammar

@lvh
Copy link
Contributor

lvh commented Nov 18, 2015

#374 was a duplicate of this ticket. Some points made that ticket:

  • You may want to consider --no-bash-completions or --no-man-page; I I think it's a little weird that rack init --man-page would do less than rack init. @StephenBrown2 suggested:
# rack init
=
# rack init man
# rack init completion

... which seems even better to me :)

Right now, rack tries to add bash completion. If that fails, it gives up and never tries to install the man page. As a fish user; that's unfortunate -- just getting the man page would have given me working completion.

I think the longer-term behavior mentioned on that ticket, where rack tries to do something smart for zsh/fish/... instead of just giving up with the default rack init command, is probably a different ticket, though?

@StephenBrown2
Copy link
Contributor Author

I'm all for at least giving the possibility of separating out the file generation.

A secondary goal of this issue was so that I could make a PKGBUILD for Arch and put things in the proper places for Arch, which requires some finagling at the moment

  1. Move any ~/.bashrc out of the way

  2. Run rack init, then moving ~/.bashrc back

  3. Move rack.1 (which is generated even though bash_completions isn't) to /usr/share/man/man1/

  4. Delete .rack directory

  5. Download https://raw.githubusercontent.com/rackspace/rack/master/setup/commandcompletion_bash.sh to /etc/bash_completion.d/rack

  6. At this point, I'm not aware that zsh sources the bash completions directory, so I would manually add:

autoload bashcompinit && bashcompinit
source /etc/bash_completion.d/rack

to my ~/.zshrc file

@jrperritt jrperritt added this to the 1.3 milestone May 4, 2016
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

3 participants