Hi! Thanks for this shard!
I'd like to have the app print the help message if it's run without arguments and have all actions done through subcommands.
Example:
class Main < Cling::Command
def setup : Nil
@name = "main"
@description = "main description"
end
def run(arguments : Cling::Arguments, options : Cling::Options) : Nil
puts help_template
end
end
class SubcommandOne < Cling::Command
def setup : Nil
@name = "subcommand-one"
@description = "Subcommand one"
end
def run(arguments : Cling::Arguments, options : Cling::Options) : Nil
# stuff to do
end
end
main = Main.new
main.add_command(SubcommandOne.new)
main.execute(ARGV)
This works, but the help message looks like this
Usage:
main
Commands:
subcommand-one
Would it be possible to print a placeholder for the commands like this?
Usage:
main <command>
Commands:
subcommand-one
Thanks in advance!
Hi! Thanks for this shard!
I'd like to have the app print the help message if it's run without arguments and have all actions done through subcommands.
Example:
This works, but the help message looks like this
Would it be possible to print a placeholder for the commands like this?
Thanks in advance!