From ce4f86f35c6e7e8087a32afb4f1ebfe4c156962e Mon Sep 17 00:00:00 2001 From: Yossef Mendelssohn Date: Thu, 11 Oct 2012 11:59:40 -0400 Subject: [PATCH] Don't abort for help display `abort` is a quick way to print-and-quit, but asking for help isn't the same as the command failing. --- lib/boxen/cli.rb | 6 +++++- test/boxen_cli_test.rb | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/boxen/cli.rb b/lib/boxen/cli.rb index c1da734..209c463 100644 --- a/lib/boxen/cli.rb +++ b/lib/boxen/cli.rb @@ -18,7 +18,11 @@ module Boxen end def run - abort "#{flags}\n" if flags.help? + if flags.help? + puts flags + exit + end + runner.run end diff --git a/test/boxen_cli_test.rb b/test/boxen_cli_test.rb index 8efb26d..b45ec6f 100644 --- a/test/boxen_cli_test.rb +++ b/test/boxen_cli_test.rb @@ -27,6 +27,8 @@ class BoxenCLITest < Boxen::Test end def test_help + $stdout.stubs(:write) + flags = Boxen::Flags.new('--help') cli = Boxen::CLI.new(@config, flags) cli.runner.expects(:run).never