Open luislavena opened 8 months ago
I think this behaviour is just an omission and all arguments should be forwarded entirely to the subcommand.
Thank you for the confirmation @straight-shoota, Since there is no specs around that behavior, I'm going to draft something for the integration tests and see if I can make it work.
Once again thank you for your response. ❤️ ❤️ ❤️
Hello folks,
When creating an external shards subcommand (using
shards-xxx
executable):https://github.com/crystal-lang/shards/blob/master/src/cli.cr#L101-L105
Noticed it does not pass to the invoked executable the already processed commands like
--production
,--without-development
,--verbose
or--quiet
, as these were already parsed by OptionParser.You can confirm this with the following sample executable script:
Name it
shards-dummy
, make it executable and place it in$PATH
and when invoked, notice certain options where already processed:This differs from the behavior of
build
orrun
, which passes all-
starting options directly to it. Additionally, the impact of--production
or--without-development
is not validated (something that is done by build and run by doing a check or install).Since there hasn't been lot of discussion on this subject, I wanted to check first what is the expected behavior:
--production
or--without-development
?--verbose
and--quiet
Last but not least, this also impacts
--help
, as any custom subcommand cannot provide their own help information as this is short-circuit here, but perhaps that is a separate issue.I wanted to confirm what are the expectations before proposing a PR with changes.
Thank you in advance for your responses! ❤️ ❤️ ❤️