rackspace / rack

A CLI for Rackspace (unmaintained)
Other
81 stars 57 forks source link

Don't auto-stick the source setup in the users ~/.bash_profile #146

Open rgbkrk opened 9 years ago

rgbkrk commented 9 years ago

Rather than knowing/understanding where people want to put the sourceing (OS X assuming mostly ~/.bash_profile with some caveats), have rack init spit back what to source:

$ rack init
Add the following line to your ~/.bashrc or ~/.bash_profile

source /Users/kyle6475/.rack/bash_autocomplete

Thoughts?

jrperritt commented 9 years ago

I think rack init should take care of everything for you and users who want a custom setup can follow the instructions in the docs to set it up.

kenperkins commented 9 years ago

How would this work on windows?

rgbkrk commented 9 years ago

It currently dumps out Command completion not available for Windows.

rgbkrk commented 9 years ago

I think rack init should take care of everything for you and users who want a custom setup can follow the instructions in the docs to set it up.

The problem isn't that I don't want to make it easy, the problem is that when/where things get sourced is inconsistent.

At a terminal on OS X, run a new bash shell

$ bash
$  

Then try to autocomplete on rack. It won't work.

Why is this important? Well, for things like kitematic, various editors, etc. they'll drop you into a new bash shell with what comes from ~/.bashrc but not ~/.bash_profile. This is why people end up making their ~/.bash_profile consist solely of:

source $HOME/.bashrc

On a new Mac, this confuses the hell out of people for why sometimes things get sourced and sometimes they don't.

rtgoodwin commented 9 years ago

"Would you like to insert this into your .bashrc, so it will be available in the terminal from now on? [Y/n]"

Give them the option, default to Y. Informs, saves user trouble, puts it in best place.

rgbkrk commented 9 years ago

I like the Y/n option.

jrperritt commented 9 years ago

:+1:

kenperkins commented 9 years ago

I'm not convinced there is anything to do here that makes it trivial to solve all cases. I'm going to move this to post-public-beta unless there is a compelling argument against.

StephenBrown2 commented 8 years ago

:+1: to this. I like bash init generating the files, I don't like it modifying my .bashrc.

If it's going to put stuff in places it should put them in the right place: /etc/bash_completion.d/ as rack for completions and /usr/share/man/man1/ for rack.1

Otherwise provide instructions and let me do it myself.

lvh commented 8 years ago

I like the interactive thing.