From 312fdaa892bce745f909215f81f3257d170c0f5a Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Tue, 19 Apr 2016 03:04:49 +0200 Subject: --version: move help to documentation comment This implies that `--version` is treated in most places like a regular command, e.g. being suggested in shell completion. Also fix the help text that claimed output goes to standard error, while it actually goes to standard output. --- Library/Homebrew/cmd/--version.rb | 12 ++++++++++++ Library/Homebrew/manpages/brew.1.md.erb | 3 --- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 Library/Homebrew/cmd/--version.rb (limited to 'Library') diff --git a/Library/Homebrew/cmd/--version.rb b/Library/Homebrew/cmd/--version.rb new file mode 100644 index 000000000..9a571abe1 --- /dev/null +++ b/Library/Homebrew/cmd/--version.rb @@ -0,0 +1,12 @@ +#: * `--version`: +#: Print the version number of Homebrew to standard output and exit. + +module Homebrew + def __version + # As a special case, `--version` is implemented directly in `brew.rb`. This + # file merely serves as a container for the documentation. It also catches + # the case where running `brew --version` with additional arguments would + # produce a rather cryptic message about a non-existent `--version` command. + raise UsageError + end +end diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index b6726089e..92acb86ee 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -50,9 +50,6 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note <%= commands.join("\n") %> - * `--version`: - Print the version number of brew to standard error and exit. - ## EXTERNAL COMMANDS Homebrew, like `git`(1), supports external commands. These are executable -- cgit v1.2.3