-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
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-oneWould it be possible to print a placeholder for the commands like this?
Usage:
main <command>
Commands:
subcommand-oneThanks in advance!
devnote-dev
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers