Is there a way to specify a default subcommand in
Core.Command? E.g., if I run
main.native arg1 arg2 I would like to have the behavior
main.native [default subcommand] arg1 arg2 if
arg1 is not a valid subcommand. Instead, the default behavior is the help message and “unknown subcommand”:
$ ./main.native arg1 arg2 Description main.native SUBCOMMAND === subcommands === foo Do foo version print version information help explain a given subcommand (perhaps recursively) unknown subcommand arg1
This is sensible in most cases. I just wonder if the interface makes any provisions for overriding this behavior (I couldn’t find any).
It looks like
Command silently catches the
Failure raised by
unknown subcommand, so wrapping
try...with as a way to get around this doesn’t work.