From a558629654c28fff1ccfb8e9895485e0da79e167 Mon Sep 17 00:00:00 2001 From: Jam Date: Sun, 8 May 2016 20:39:22 -0600 Subject: gist-logs: add proper documentation, improve error handling (#217) --- Library/Homebrew/cmd/gist-logs.rb | 17 ++++++++++++----- Library/Homebrew/cmd/install.rb | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'Library') 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`] : +#: Upload logs for a failed build of to a new Gist. +#: +#: 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] " - Homebrew.failed = true - return - end + raise FormulaUnspecifiedError if ARGV.resolved_formulae.length != 1 gistify_logs(ARGV.resolved_formulae[0]) end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index d41ef66d4..9d2c7bfa1 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -2,7 +2,7 @@ #: Install . #: #: is usually the name of the formula to install, but it can be specified -#: several different ways. See [SPECIFYING FORMULAE][]. +#: in several different ways. See [SPECIFYING FORMULAE][]. #: #: If `--debug` is passed and brewing fails, open an interactive debugging #: session with access to IRB or a shell inside the temporary build directory. -- cgit v1.2.3