aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMartin Afanasjew2016-04-19 03:04:49 +0200
committerMartin Afanasjew2016-04-20 13:45:26 +0200
commit312fdaa892bce745f909215f81f3257d170c0f5a (patch)
treef0be39751a737b6500f278d836d306a68a3c9c7b /Library/Homebrew/cmd
parent76f04799692ac896908bf2db21b9bad16769c2e3 (diff)
downloadbrew-312fdaa892bce745f909215f81f3257d170c0f5a.tar.bz2
--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.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/--version.rb12
1 files changed, 12 insertions, 0 deletions
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