summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-07-15 19:19:33 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-07-16 16:55:05 -0700
commit4d214d01303419325bb03a2c9266373b6581ba3e (patch)
tree492a044f28555e8c712b093febb4def7fa7c5c37
parent8061f250bba744a4f99c22dc0975f456cedda4dd (diff)
downloadbundler-4d214d01303419325bb03a2c9266373b6581ba3e.tar.gz
[CLI] Print help as the default no-args command
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--spec/bundler/cli_spec.rb7
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