--version: use CLI::Parser.
This commit is contained in:
parent
7b90539943
commit
dbd8de7148
@ -1,10 +1,22 @@
|
|||||||
#: * `--version`:
|
require "cli_parser"
|
||||||
#: Print the version number of Homebrew to standard output and exit.
|
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
|
def __version_args
|
||||||
|
Homebrew::CLI::Parser.new do
|
||||||
|
usage_banner <<~EOS
|
||||||
|
`--version`
|
||||||
|
|
||||||
|
Print the version number of Homebrew, Homebrew/homebrew-core and Homebrew/homebrew-cask
|
||||||
|
(if tapped) to standard output and exit.
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def __version
|
def __version
|
||||||
|
__version_args.parse
|
||||||
|
|
||||||
odie "This command does not take arguments." if ARGV.any?
|
odie "This command does not take arguments." if ARGV.any?
|
||||||
|
|
||||||
puts "Homebrew #{HOMEBREW_VERSION}"
|
puts "Homebrew #{HOMEBREW_VERSION}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user