Merge pull request #7184 from dawidd6/cli-parser-comma-array-name-chomp

cli/parser: chomp '=' from comma_array flag name
This commit is contained in:
Mike McQuaid 2020-03-23 13:21:51 +00:00 committed by GitHub
commit 5e63d0cef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -95,6 +95,7 @@ module Homebrew
end end
def comma_array(name, description: nil) def comma_array(name, description: nil)
name = name.chomp "="
description = option_to_description(name) if description.nil? description = option_to_description(name) if description.nil?
process_option(name, description) process_option(name, description)
@parser.on(name, OptionParser::REQUIRED_ARGUMENT, Array, *wrap_option_desc(description)) do |list| @parser.on(name, OptionParser::REQUIRED_ARGUMENT, Array, *wrap_option_desc(description)) do |list|

View File

@ -40,7 +40,7 @@ module Homebrew
description: "Print the pull request URL instead of opening in a browser." description: "Print the pull request URL instead of opening in a browser."
switch "--no-fork", switch "--no-fork",
description: "Don't try to fork the repository." description: "Don't try to fork the repository."
comma_array "--mirror=", comma_array "--mirror",
description: "Use the specified <URL> as a mirror URL. If <URL> is a comma-separated list "\ description: "Use the specified <URL> as a mirror URL. If <URL> is a comma-separated list "\
"of URLs, multiple mirrors will be added." "of URLs, multiple mirrors will be added."
flag "--version=", flag "--version=",