feat(completions): add bash and zsh completions#20
Open
CheapFuck wants to merge 1 commit into
Open
Conversation
Add shell completion scripts for bash and zsh under user/local/share/towel/completions/ (installed to ~/.local/share/towel/completions/ by the existing copy step). Completions cover the subcommands (create/enter/exec/export/install/ remove/update), the top-level -h/--help and -v/--version options, and the per-subcommand flags. Package-name positions are left to default completion to avoid slow container/dnf queries. Document how to enable them for bash and zsh in the README. Closes codam-coding-college#5
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.
Closes #5.
Adds shell completion scripts for bash and zsh.
What
user/local/share/towel/completions/towel.bashand.../_towel.They are installed to
~/.local/share/towel/completions/automatically by the existingtowel_install_from_dircopy step (the wholeuser/local/share/toweltree is copied during./install).create enter exec export install remove update-h/--help,-v/--versionupdate --check/--apply/--no-auto-check/--auto-check/-y/--yes/--quiet,install -y/--yes,remove -y/--yes/-h/--help)execcompletes the command to run inside the containerinstall/export) are intentionally left to default completion to avoid slow container/dnfqueries.fpathbeforecompinit).Notes
completions/, notbin/, so they are outside the CIshellcheck/shfmtglob (bin/towelandbin/towel-*). This is deliberate: the zsh#compdeffile is not POSIX/bash and would not pass plainshellcheck. The existing CI set still passes (verified locally withshellcheck -xandshfmt -d)..bashrc/.zshrc(especiallycompinit), to avoid intruding on user shell config. Happy to wire it into./installif you prefer.