Skip to content

Completions integration - #3978

Merged
igaw merged 3 commits into
linux-nvme:masterfrom
Micron-TPG-OSS:completions-integration
Sep 5, 2026
Merged

Completions integration#3978
igaw merged 3 commits into
linux-nvme:masterfrom
Micron-TPG-OSS:completions-integration

Conversation

@jimmunn

@jimmunn jimmunn commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Wires the completion generator into meson and adds a CI gate so the committed bash/zsh/PowerShell scripts can't silently drift from the CLI.

  • meson compile -C <dir> update-completions regenerates the committed bash-nvme-completion.sh, _nvme, and nvme-completion.ps1 from the built nvme binary; check-completions runs the same generation read-only.
  • New "Check completions" CI workflow runs check-completions and fails when the committed files are out of sync.
  • Regeneration documented in CONTRIBUTING.md and completions/README (Linux/all-plugins build required — reduced -Dplugins= builds omit commands).
  • Includes a regen so the new gate passes green on this branch.

Design note — why two targets instead of the accessor pattern: I used two direct targets, update-completions and check-completions, so neither needs a build option or reconfigure. The accessor generator needs its configure-time boolean (-Dcheck-accessors=true) because it flips several targets at once; completions generate in one step, so a dedicated check target is simpler.

Add completions/meson.build (update-completions and check-completions
run_targets plus the shell test suites), a Check completions CI workflow
that fails on drift, and document the regeneration process in
CONTRIBUTING.md and completions/README.

Signed-off-by: Jim Munn <jlmunn@micron.com>
Refresh the committed bash, zsh, and PowerShell completions so they
match the current CLI and pass the check-completions gate.

Signed-off-by: Jim Munn <jlmunn@micron.com>
@igaw

igaw commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Looks good.

Could also move these two instruction from
~/meson.build to ~/completions/meson.build?

    install_data(
        'completions/bash-nvme-completion.sh',
        rename: 'nvme',
        install_dir: datadir / 'bash-completion/completions',
    )
    install_data(
        'completions/_nvme',
        install_dir: datadir / 'zsh/site-functions',
    )

Then completion related stuff is in one meson.build file.

Relocate the bash and zsh install_data rules from the top-level
meson.build so all completion-related build logic lives in one file.

Signed-off-by: Jim Munn <jlmunn@micron.com>
@jimmunn

jimmunn commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

@igaw , good idea on moving the meson instructions. I've done that and committed. By the way, I will be out next week. If there are any other minor changes you want and you don't want to wait, you may want to make them yourself. I'll be back on Monday, September 14th.

@igaw
igaw merged commit 920c875 into linux-nvme:master Sep 5, 2026
30 of 31 checks passed
@igaw

igaw commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks! Enjoy!

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