mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-02-20 08:20:34 -05:00
Add dummy endpoint for subcommands
This commit is contained in:
parent
893e37711e
commit
1f432350ea
3 changed files with 19 additions and 0 deletions
|
|
@ -338,6 +338,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|||
add_message "hashicorp.vagrant.sdk.Command.ExecuteResp" do
|
||||
optional :exit_code, :int64, 1
|
||||
end
|
||||
add_message "hashicorp.vagrant.sdk.Command.SubcommandResp" do
|
||||
repeated :commands, :string, 1
|
||||
end
|
||||
add_message "hashicorp.vagrant.sdk.Command.Arguments" do
|
||||
repeated :flags, :message, 1, "hashicorp.vagrant.sdk.Command.Arguments.Flag"
|
||||
repeated :args, :string, 2
|
||||
|
|
@ -611,6 +614,7 @@ module Hashicorp
|
|||
Command::SynopsisResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Command.SynopsisResp").msgclass
|
||||
Command::FlagsResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Command.FlagsResp").msgclass
|
||||
Command::ExecuteResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Command.ExecuteResp").msgclass
|
||||
Command::SubcommandResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Command.SubcommandResp").msgclass
|
||||
Command::Arguments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Command.Arguments").msgclass
|
||||
Command::Arguments::Flag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Command.Arguments.Flag").msgclass
|
||||
Command::Arguments::Flag::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("hashicorp.vagrant.sdk.Command.Arguments.Flag.Type").enummodule
|
||||
|
|
|
|||
|
|
@ -149,6 +149,8 @@ module Hashicorp
|
|||
rpc :Flags, ::Hashicorp::Vagrant::Sdk::FuncSpec::Args, ::Hashicorp::Vagrant::Sdk::Command::FlagsResp
|
||||
rpc :ExecuteSpec, ::Google::Protobuf::Empty, ::Hashicorp::Vagrant::Sdk::FuncSpec
|
||||
rpc :Execute, ::Hashicorp::Vagrant::Sdk::FuncSpec::Args, ::Hashicorp::Vagrant::Sdk::Command::ExecuteResp
|
||||
rpc :SubcommandSpec, ::Google::Protobuf::Empty, ::Hashicorp::Vagrant::Sdk::FuncSpec
|
||||
rpc :Subcommands, ::Hashicorp::Vagrant::Sdk::FuncSpec::Args, ::Hashicorp::Vagrant::Sdk::Command::SubcommandResp
|
||||
end
|
||||
|
||||
Stub = Service.rpc_stub_class
|
||||
|
|
|
|||
|
|
@ -67,6 +67,19 @@ module VagrantPlugins
|
|||
end
|
||||
end
|
||||
|
||||
def subcommand_spec(*args)
|
||||
return SDK::FuncSpec.new
|
||||
end
|
||||
|
||||
def subcommands(req, ctx)
|
||||
ServiceInfo.with_info(ctx) do |info|
|
||||
|
||||
end
|
||||
SDK::Command::SubcommandResp.new(
|
||||
commands: ["test", "thing"],
|
||||
)
|
||||
end
|
||||
|
||||
def augment_cmd_class(cmd_cls)
|
||||
# Create a new anonymous class based on the command class
|
||||
# so we can modify the setup behavior
|
||||
|
|
|
|||
Loading…
Reference in a new issue