Skip to content

contrib/completions: sync bash completion with current CLI#5299

Open
immanuwell wants to merge 1 commit into
opencontainers:mainfrom
immanuwell:fix-bash-completion-drift
Open

contrib/completions: sync bash completion with current CLI#5299
immanuwell wants to merge 1 commit into
opencontainers:mainfrom
immanuwell:fix-bash-completion-drift

Conversation

@immanuwell

Copy link
Copy Markdown

bash completion drifted from the current CLI a bit.

Repro on current main:

  1. Load the bash completion.
  2. Try tab-completing these:
    • runc fe
    • runc run --k
    • runc run --d
    • runc delete --f
    • runc exec --t
    • runc list --format
  3. You hit wrong or missing suggestions:
    • features is missing
    • --keep is missing
    • --detatch is suggested
    • --format, is suggested for delete
    • --tty, is suggested for exec
    • text is suggested for list --format, but help says table|json

This syncs the completion script with the current --help output, adds the missing entries, and adds a small regression test.

Pretty small fix, but nice QoL. easy to hit when you tab around.

@kolyshkin kolyshkin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, although runc features is not really targeted to be used from CLI (it's for upper-level runtime to query what's available and what's not).

Comment thread contrib/completions/bash/runc
@kolyshkin

Copy link
Copy Markdown
Contributor

@immanuwell your test cases are failing. I am also unsure if it makes sense to perform such kind of tests.

@immanuwell immanuwell force-pushed the fix-bash-completion-drift branch 2 times, most recently from e5b08af to 99333c1 Compare June 14, 2026 05:22
@immanuwell

Copy link
Copy Markdown
Author

@kolyshkin I addressed all your suggestions, PTAL

@immanuwell immanuwell requested a review from kolyshkin June 14, 2026 05:25
Sync bash completion with the current CLI surface, including missing and corrected flags, plus a regression test for the observed completion drift.

Signed-off-by: immanuwell <pchpr.00@list.ru>
@kolyshkin kolyshkin force-pushed the fix-bash-completion-drift branch from 99333c1 to 7f2523e Compare June 14, 2026 18:34
@kolyshkin

Copy link
Copy Markdown
Contributor

Basically, same feedback:

  • not sure if runc features need to be exposed to bash-completion;
  • not sure if such integration tests make sense (I mean, we're checking that some specific options are hardcoded -- will it ever help to catch a regression, or what?).

To me, a good test would be some check that if a new option is ever added, it's also mentioned in bash completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants