From 4d214d01303419325bb03a2c9266373b6581ba3e Mon Sep 17 00:00:00 2001 From: "Samuel E. Giddins" Date: Wed, 15 Jul 2015 19:19:33 -0700 Subject: [CLI] Print help as the default no-args command --- lib/bundler/cli.rb | 2 +- spec/bundler/cli_spec.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1