From b521ba0c7a6a9eddeb0b2f7b57fdd3163eb80bfd Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 30 Jan 2019 21:29:43 +0000 Subject: [PATCH] --prefix: use CLI::Parser. --- Library/Homebrew/cmd/--prefix.rb | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/--prefix.rb b/Library/Homebrew/cmd/--prefix.rb index 4a5e0ba77c..fb98235dcf 100644 --- a/Library/Homebrew/cmd/--prefix.rb +++ b/Library/Homebrew/cmd/--prefix.rb @@ -1,13 +1,25 @@ -#: * `--prefix`: -#: Display Homebrew's install path. *Default:* `/usr/local` on macOS and `/home/linuxbrew/.linuxbrew` on Linux -#: -#: * `--prefix` : -#: Display the location in the cellar where is or would be installed. +require "cli_parser" module Homebrew module_function + def __prefix_args + Homebrew::CLI::Parser.new do + usage_banner <<~EOS + `--prefix` [] + + Display Homebrew's install path. *Default:* `/usr/local` on macOS and + `/home/linuxbrew/.linuxbrew` on Linux. + + If is provided, display the location in the cellar where + is or would be installed. + EOS + end + end + def __prefix + __prefix_args.parse + if ARGV.named.empty? puts HOMEBREW_PREFIX else