FEDX-970: Disallow (ignore) trailing options, as it inhibits ability to pass args to subcommand #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I removed the
allowTrailingOptions: false
in a recent PR, only to remember that it was supposed to be disabled. When trailing options are allowed, it becomes impossible to pass options/flags as args to the subcommand thatdpx
runs since the top-leveldpx
arg parser will try to parse them.For example:
> dpx dependency_validator --help
This should run
dependency_validator --help
and display the help output for that executable, but it actually displays the help output fordpx
. Similarly, if you tried to use a CLI flag or option of the subcommand,dpx
would fail to parse args altogether.While it's possible to workaround this by using an arg separator...
> dpx dependency_validator -- --help
... it's awkward and unintuitive.
dpx
is supposed to make it as easy to run other package executables, so we should aim to make thedpx
CLI get out of the way whenever possible and favor the underlying package executable.This PR makes that change by disallowing (ignoring) trailing options.
Note: the only real downside is that if you want to make
dpx
run in verbose mode, you have to add the--verbose
flag first, like so:> dpx --verbose dependency_validator
This is a minor inconvenience and an acceptable trade off.