Fetch command banner and remove switch characters
This commit is contained in:
parent
5e6fe71a37
commit
1a32e8c2f9
@ -93,15 +93,15 @@ module VagrantPlugins
|
|||||||
hlp_msg = ""
|
hlp_msg = ""
|
||||||
flags = []
|
flags = []
|
||||||
else
|
else
|
||||||
hlp_msg = options.help
|
hlp_msg = options.banner
|
||||||
# Now we can build our list of flags
|
# Now we can build our list of flags
|
||||||
flags = options.top.list.find_all { |o|
|
flags = options.top.list.find_all { |o|
|
||||||
o.is_a?(OptionParser::Switch)
|
o.is_a?(OptionParser::Switch)
|
||||||
}.map { |o|
|
}.map { |o|
|
||||||
SDK::Command::Flag.new(
|
SDK::Command::Flag.new(
|
||||||
description: o.desc.join(" "),
|
description: o.desc.join(" "),
|
||||||
long_name: o.switch_name,
|
long_name: o.switch_name.to_s.gsub(/^-/, ''),
|
||||||
short_name: o.short.first,
|
short_name: o.short.first.to_s.gsub(/^-/, ''),
|
||||||
type: o.is_a?(OptionParser::Switch::NoArgument) ?
|
type: o.is_a?(OptionParser::Switch::NoArgument) ?
|
||||||
SDK::Command::Flag::Type::BOOL :
|
SDK::Command::Flag::Type::BOOL :
|
||||||
SDK::Command::Flag::Type::STRING
|
SDK::Command::Flag::Type::STRING
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user