Workiva / dpx

Apache License 2.0
1 stars 0 forks source link

FEDX-970: Disallow (ignore) trailing options, as it inhibits ability to pass args to subcommand #18

Closed evanweible-wf closed 2 months ago

evanweible-wf commented 2 months ago

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 that dpx runs since the top-level dpx 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 for dpx. 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 the dpx 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.

aviary2-wf commented 2 months ago

Security Insights

No security relevant content was detected by automated scans.

Action Items

evanweible-wf commented 2 months ago

QA +1

@Workiva/release-management-p