Subcommand Handling #13
|
Hey, I am using This is the implementation I currently have: require 'command_mapper/command'
class Git < CommandMapper::Command
command "git" do
subcommand "log" do
option "--max-count", value: {type: Num.new()}
end
end
end
Git.run({ :log => { :max_count => 5 }})Is this how it is intended to be done? Are there any examples showcasing the usage of subcommands? Thanks in advance |
Answered by
postmodern
Jan 17, 2023
Replies: 1 comment 2 replies
|
Yes that is how you invoke a subcommand, by passing a nested Hash of options into the outer-command. All of the same execution methods can be used (ex: |
2 replies
Answer selected by
eklatzer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes that is how you invoke a subcommand, by passing a nested Hash of options into the outer-command. All of the same execution methods can be used (ex:
.run,.spawn,.capture,.popen,.sudo) to execute subcommands. Off the top of my head, there's ruby-amass which defines subcommands for the amass CLI.