diff options
author | Samuel E. Giddins <segiddins@segiddins.me> | 2015-07-15 19:19:33 -0700 |
---|---|---|
committer | Samuel E. Giddins <segiddins@segiddins.me> | 2015-07-16 16:55:05 -0700 |
commit | 4d214d01303419325bb03a2c9266373b6581ba3e (patch) | |
tree | 492a044f28555e8c712b093febb4def7fa7c5c37 | |
parent | 8061f250bba744a4f99c22dc0975f456cedda4dd (diff) | |
download | bundler-4d214d01303419325bb03a2c9266373b6581ba3e.tar.gz |
[CLI] Print help as the default no-args command
-rw-r--r-- | lib/bundler/cli.rb | 2 | ||||
-rw-r--r-- | spec/bundler/cli_spec.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 374760e65f..6ad4cb3a93 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -34,7 +34,7 @@ module Bundler check_unknown_options!(:except => [:config, :exec]) stop_on_unknown_option! :exec - default_task :install + default_command :help class_option "no-color", :type => :boolean, :desc => "Disable colorization in output" class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM", :desc => "Specify the number of times you wish to attempt network commands" diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index 32eecbc49d..26afbcb343 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -24,4 +24,11 @@ describe "bundle executable" do expect(exitstatus).to be_zero if exitstatus expect(out).to eq("Hello, world") end + + it "prints help when ARGV is empty" do + bundle :help + help_output = out + bundle '' + expect(out).to eq(help_output) + end end |