Just get the flag names

This commit is contained in:
sophia 2021-01-27 10:56:45 -06:00 committed by Paul Hinze
parent dc64d85adf
commit 854a2a4022
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 1 additions and 7 deletions

View File

@ -20,9 +20,6 @@ module Vagrant
# outside of command implementations to the local option
# parser instances in use
class OptionParser < ::OptionParser
attr_reader :flags
def initialize(*_)
super
Vagrant.default_cli_options.each do |opt_proc|

View File

@ -42,7 +42,7 @@ module VagrantPlugins
}.map { |o|
Hashicorp::Vagrant::Sdk::Command::Flag.new(
description: o.desc.join(" "),
long_name: o.long.first,
long_name: o.switch_name,
short_name: o.short.first,
type: o.is_a?(OptionParser::Switch::NoArgument) ?
Hashicorp::Vagrant::Sdk::Command::Flag::Type::BOOL :
@ -50,9 +50,6 @@ module VagrantPlugins
)
}
# Clean our option data out of the thread
Thread.current.thread_variable_set(:command_options, nil)
Hashicorp::Vagrant::Sdk::Command::FlagsResp.new(
flags: flags
)