提交 c5afd2ee 编写于 作者: C Chris Wanstrath

add -s flag to install

上级 c66ecfe0
......@@ -89,15 +89,23 @@ module Hub
'fish' => 'alias git hub'
}
silent = args.delete('-s')
if shell = args[1]
puts "Run this in your shell to start using `hub` as `git`:"
print " "
if silent.nil?
puts "Run this in your shell to start using `hub` as `git`:"
print " "
end
else
puts "usage: hub install SHELL", ""
puts "known shells:"
puts "usage: hub install [-s] SHELL", ""
puts "Known shells:"
shells.map { |key, _| key }.sort.each do |key|
puts " " + key
end
puts "", "Options:"
puts " -s Silent. Useful when using the output with eval, e.g."
puts " $ eval `hub install -s bash`"
exit
end
......
......@@ -11,6 +11,10 @@ class InstallTest < Test::Unit::TestCase
assert_includes "fish", instructions
end
def test_install_silent
assert_equal "alias git=hub\n", hub("install -s bash")
end
def test_install_bash
assert_install_command "bash", "alias git=hub"
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册