A command is a subclass of Dry::CLI::Command and it must respond to #call(*).
For a given command name, you can register a corresponding command.
Please note: there is no convention between the command name and the command object class name.
The manual registration assigns a command object to a command name.
#!/usr/bin/env ruby
extend Dry::CLI::Registry
end
end
end
end
end
end
end
Foo::CLI::Commands.register "hi", Foo::CLI::Commands::Hello
Foo::CLI::Commands.register "v", Version
Dry::CLI.new(Foo::CLI::Commands).call