diff options
| author | Jam | 2016-05-08 20:39:22 -0600 | 
|---|---|---|
| committer | Martin Afanasjew | 2016-05-09 04:39:22 +0200 | 
| commit | a558629654c28fff1ccfb8e9895485e0da79e167 (patch) | |
| tree | facedd6648c7927ccd66af22dda75ed944a52cdc /Library/Homebrew/cmd/gist-logs.rb | |
| parent | 815edc06862fc4c01ca6ac09a5a3a0b36cfcaa24 (diff) | |
| download | brew-a558629654c28fff1ccfb8e9895485e0da79e167.tar.bz2 | |
gist-logs: add proper documentation, improve error handling (#217)
Diffstat (limited to 'Library/Homebrew/cmd/gist-logs.rb')
| -rw-r--r-- | Library/Homebrew/cmd/gist-logs.rb | 17 | 
1 files changed, 12 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index f51e20ed3..543bd6289 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -1,3 +1,14 @@ +#:  * `gist-logs` [`--new-issue`|`-n`] <formula>: +#:     Upload logs for a failed build of <formula> to a new Gist. +#: +#:     <formula> is usually the name of the formula to install, but it can be specified +#:     in several different ways. See [SPECIFYING FORMULAE][]. +#: +#:     If `--new-issue` is passed, automatically create a new issue in the appropriate +#:     GitHub repository as well as creating the Gist. +#: +#:     If no logs are found, an error message is presented.       +  require "formula"  require "system_config"  require "net/http" @@ -161,11 +172,7 @@ module Homebrew    end    def gist_logs -    if ARGV.resolved_formulae.length != 1 -      puts "usage: brew gist-logs [--new-issue|-n] <formula>" -      Homebrew.failed = true -      return -    end +    raise FormulaUnspecifiedError if ARGV.resolved_formulae.length != 1      gistify_logs(ARGV.resolved_formulae[0])    end  | 
