cvogt / cbt

CBT - fun, fast, intuitive, compositional, statically checked builds written in Scala
Other
488 stars 60 forks source link

When I type wrong subcommand, both exception stack trace and nice answer is shown #586

Open buzden opened 6 years ago

buzden commented 6 years ago

Consider I forgot spelling of createBuild subcommand and I typed cbt tools help in a belief that it prints a list of possible subcommands.

This command actually leads to printing both a list of possible subcommands for the tools command and list of possible first-level commands. This is great!

But additionally, it prints an exception stack trace

Exception in thread "main" java.lang.RuntimeException:  no method `help` in
        at cbt.Lib$$anonfun$cbt$Lib$$callInternal$1$$anonfun$apply$9$$anonfun$apply$14.apply(Lib.scala:171)
        ...

I really believe, it is not the intended behaviour as soon as the system known all possible list of subcommands, is it?