Currently, registering both subcommands and positionals to a command is not possible as the positional cannot accept the values representing a subcommand.
However in some scenarios it makes sense to support both. For example deno, bun and dart all support providing a path to a script to execute next to using the run subcommand. This also makes use of shebangs more convenient.
dart run script.dart
# same as
dart script.dart
To further restrict accidental clashes, a new argument like hybrid can be introduced.
Currently, registering both subcommands and positionals to a command is not possible as the positional cannot accept the values representing a subcommand.
However in some scenarios it makes sense to support both. For example
deno,bunanddartall support providing a path to a script to execute next to using therunsubcommand. This also makes use of shebangs more convenient.To further restrict accidental clashes, a new argument like
hybridcan be introduced.