Skip to content

Main command without actions #15

Description

@BigBoyBarney

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:

classMain < Cling::Commanddefsetup : Nil@name="main"@description="main description"enddefrun(arguments : Cling::Arguments, options : Cling::Options) : Nilputs help_template
endendclassSubcommandOne < Cling::Commanddefsetup : Nil@name="subcommand-one"@description="Subcommand one"enddefrun(arguments : Cling::Arguments, options : Cling::Options) : Nil# stuff to doendend
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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions