"bundle" without any arguments is equivalent to "bundle install" #1452

Closed
sampablokuper opened this Issue Sep 26, 2011 · 7 comments

6 participants

@sampablokuper

It seems to be conventional that command line programs should execute, when called without arguments, only if they are nullipotent. For instance, the command ls executes when called without arguments, and this is both useful and also, because ls is nullipotent, safe.

If a command line program is not nullipotent, then its default behaviour when called without arguments should be to behave as though it has been called together with its help option. For instance, rm, when called without arguments, instead of deleting anything, lists the arguments it takes, much as if rm -h or rm --help had been called instead.

The bundle command, by contrast, when called without any arguments, behaves as though bundle install has been been called. That is, Bundler treats the bundle and bundle install commands as synonymous equivalents.

If this is intended behaviour, then the intention is questionable insofar as it breaks the command line conventions I've outlined above, to little advantage (a terser way of calling bundle install) and an obvious disadvantage (the possibility for a user to invoke bundler install unexpectedly and thereby install or reinstall a bundle of gems on his/her machine without having wished to do so).

@radar

Running bundle with no commands will generate a new bundle if you have not yet run bundle install in your project. The worst that this would do would install a couple of new gems, which could be removed with gem uninstall <gemname> -v <version> easily enough.

If you've already run bundle install/bundle, chances are that running bundle will do nothing more than state "Your bundle is complete", i.e. a nullipotent operation.

Changing this behaviour right now would be unhelpful for the users of Bundler who are familiar with it. Yes, it breaks command-line conventions, but I don't see any reason to change it now besides that.

@indirect indirect closed this Sep 26, 2011
@indirect indirect reopened this Sep 26, 2011
@sampablokuper
@indirect
Bundler member

I agree that bundle with no commands should display the help rather than install the bundle. However, since the Bundler team has agreed to conform to SemVer, this change will take place in Bundler 2.0.

@sampablokuper
@dsjoerg

Excellent, I was trying to figure out what bundle with no arguments did. Another reason to do this one is because currently "bundle --help" doesnt tell the user what calling with no args does.

@starkcoffee

The nullipotent reason is a bit academic but probably correct. The more compelling reason is that since there are so many bundler commands, it's not completely obvious what it's behaviour is without arguments. I just had some beginners ask me what the difference is between 'bundle' and 'bundle install' and I never get this question with 'ls'

@xaviershay

Good idea, closing here (no more discussion needed, we use this tracker for bugs) but keeping on the v2 roadmap.

@xaviershay xaviershay closed this Aug 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment