Repository navigation
Forward options after -- in osism openstack - #2964
Merged
Merged
Conversation
cliff's app-level parser takes its own global options (--debug,
-h/--help, -v, -q, --version, --log-file) wherever they appear on the
command line. "osism openstack --debug server list" therefore ran
"openstack server list" without debug output, and "osism openstack
server list --help" printed the help of the osism wrapper instead of
the help of the OpenStack command.
The app-level parser leaves arguments after a "--" alone. The
passthrough forwarded that "--" verbatim, though, and openstackclient
rejects a command line that starts with it ("'-- --debug server list'
is not an openstack command"), so there was no way to reach these
options at all.
The passthrough parser now removes a leading "--", so "osism openstack
-- --debug server list" runs "openstack --debug server list". Because
the OpenStack CLI never accepts a leading "--", this cannot change the
meaning of an existing command line. A "--" anywhere else is still an
OpenStack end-of-options marker and is forwarded unchanged, so
"osism openstack server show -- -name" keeps working.
A --cloud between the leading "--" and the next "--" is rejected:
cloud setup only honours --cloud before the leading "--", and
forwarding it would hand an unknown option to the OpenStack CLI. After
a forwarded "--", --cloud is a literal argument and passes through.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Roger Luethi <luethi@osism.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
cliff's app-level parser takes its own global options (
--debug,-h/--help,-v,-q,--version,--log-file) wherever they appear.osism openstack --debug server listranopenstack server listwithout debug output, andosism openstack server list --helpprinted the wrapper's help instead of the OpenStack command's. Putting the options after a--kept them away from cliff, but the passthrough forwarded the--itself, and openstackclient rejects a command line that starts with one.The passthrough now removes a leading
--, asosism openstack stressalready does:osism openstack -- --debug server listrunsopenstack --debug server list.osism openstack -- server list --helpshows the OpenStack command's help.--anywhere else is an OpenStack end-of-options marker and is forwarded unchanged, soosism openstack server show -- -namekeeps working. The OpenStack CLI never accepts a leading--, so no existing command line changes meaning.--cloudbetween the leading--and the next--is rejected, since cloud setup only honours it before the leading--.The tests run the real
osismentry point as well, so cliff's handling of these options is covered and not only the command's parser.Related:
osism openstackand the requirements to use it are missing from the documentation issues#1438🤖 Generated with Claude Code