diff options
| author | Max Howell | 2011-03-13 12:54:30 +0000 | 
|---|---|---|
| committer | Max Howell | 2011-03-13 12:54:30 +0000 | 
| commit | 73c7a3aa1ba5b46eed026e4c07aa7f1930222143 (patch) | |
| tree | fc1b3b5c4df6ee7eddd31b5e37a14f2609e06774 /Library/Homebrew/cmd/help.rb | |
| parent | f828347b82efa7d7df686ca3144b2f4878a50376 (diff) | |
| download | homebrew-73c7a3aa1ba5b46eed026e4c07aa7f1930222143.tar.bz2 | |
Optimise/simplify `brew help`
Be more useful by being more concise. I referenced dozens of other mature commands’ usage to figure out what to do here.
Also separated out the help into its own command for consistency.
Diffstat (limited to 'Library/Homebrew/cmd/help.rb')
| -rw-r--r-- | Library/Homebrew/cmd/help.rb | 40 | 
1 files changed, 40 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb new file mode 100644 index 000000000..3e7cc75b9 --- /dev/null +++ b/Library/Homebrew/cmd/help.rb @@ -0,0 +1,40 @@ +HOMEBREW_HELP = <<-EOS +Example usage: +  brew install FORMULA... +  brew uninstall FORMULA... +  brew search [foo] +  brew list [FORMULA...] +  brew update +  brew outdated +  brew [info | home] [FORMULA...] + +Troubleshooting: +  brew doctor +  brew install -vd FORMULA +  brew [--env | --config] + +Brewing: +  brew create [URL [--no-fetch]] +  brew edit [FORMULA...] +  open https://github.com/mxcl/homebrew/wiki/Formula-Cookbook + +Further help: +  man brew +  brew home +EOS + +# NOTE Keep the lenth of vanilla --help less than 25 lines! +# This is because the default Terminal height is 25 lines. Scrolling sucks +# and concision is important. If more help is needed we should start +# specialising help like the gem command does. +# NOTE Keep lines less than 80 characters! Wrapping is just not cricket. +# NOTE The reason the string is at the top is so 25 lines is easy to measure! + +module Homebrew extend self +  def help +    puts HOMEBREW_HELP +  end +  def help_s +    HOMEBREW_HELP +  end +end  | 
