Skip to content

Forward options after -- in osism openstack - #2964

Merged
berendt merged 1 commit into
mainfrom
openstack-passthrough-double-dash
Dec 1, 2026
Merged

berendt merged 1 commit into
mainfrom
openstack-passthrough-double-dash

Conversation

@ideaship

@ideaship ideaship commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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 list ran openstack server list without debug output, and osism openstack server list --help printed 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 --, as osism openstack stress already does:

  • osism openstack -- --debug server list runs openstack --debug server list.
  • osism openstack -- server list --help shows the OpenStack command's help.
  • A -- anywhere else is an OpenStack end-of-options marker and is forwarded unchanged, so osism openstack server show -- -name keeps working. The OpenStack CLI never accepts a leading --, so no existing command line changes meaning.
  • --cloud between the leading -- and the next -- is rejected, since cloud setup only honours it before the leading --.

The tests run the real osism entry point as well, so cliff's handling of these options is covered and not only the command's parser.

Related:

🤖 Generated with Claude Code

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>
@ideaship ideaship self-assigned this Dec 1, 2026
@ideaship
ideaship marked this pull request as ready for review December 1, 2026 15:08
@ideaship
ideaship requested a review from berendt December 1, 2026 15:08
@berendt
berendt merged commit a9d36d6 into main Dec 1, 2026
3 checks passed
@berendt
berendt deleted the openstack-passthrough-double-dash branch December 1, 2026 15:13
@github-project-automation github-project-automation Bot moved this from New to Done in Human Board Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants