Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bash completions #384

Merged
merged 2 commits into from
Oct 5, 2023
Merged

Conversation

wismill
Copy link
Member

@wismill wismill commented Sep 29, 2023

WIP. This is the first time I write bash completion, be kind!

@wismill wismill added enhancement Indicates new feature requests cli labels Sep 29, 2023
@wismill wismill added this to the 1.6.0 milestone Sep 29, 2023
Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

Nice, I've missed this a few times. I only ever wrote one completion script but I forgot almost everything about it.

scripts/completion.sh Outdated Show resolved Hide resolved
scripts/completion.sh Outdated Show resolved Hide resolved
@wismill
Copy link
Member Author

wismill commented Oct 3, 2023

Free desktop Gitlab is down atm.

@wismill wismill force-pushed the scripts/bash-completion branch from fc984bd to 9e98701 Compare October 3, 2023 08:31
@bluetech
Copy link
Member

bluetech commented Oct 3, 2023

Great work as always. For the meson hookup you can check out systemd's implementation for reference.

Add missing `--help` and `--short` entries.
@wismill wismill force-pushed the scripts/bash-completion branch from 9e98701 to adebb5a Compare October 3, 2023 16:47
@wismill
Copy link
Member Author

wismill commented Oct 3, 2023

Added meson install entry and reworked the commit messages.

@wismill wismill marked this pull request as ready for review October 3, 2023 16:51
@wismill wismill requested review from whot and bluetech October 3, 2023 16:51
Copy link
Contributor

@whot whot left a comment

Choose a reason for hiding this comment

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

This LGTM, thanks. A few style nitpicks but that's about it, feel free to merge when those are addressed (or not :)

meson.build Outdated Show resolved Hide resolved
meson.build Outdated Show resolved Hide resolved
meson.build Show resolved Hide resolved
tools/xkbcli-completion.sh Outdated Show resolved Hide resolved
tools/xkbcli-completion.sh Outdated Show resolved Hide resolved
tools/xkbcli-completion.sh Outdated Show resolved Hide resolved
tools/xkbcli-completion.sh Outdated Show resolved Hide resolved
tools/xkbcli-completion.sh Outdated Show resolved Hide resolved
tools/xkbcli-completion.sh Outdated Show resolved Hide resolved
@wismill wismill requested a review from whot October 4, 2023 08:06
@wismill wismill force-pushed the scripts/bash-completion branch from eb8f500 to 6b38024 Compare October 4, 2023 08:10
Copy link
Contributor

@whot whot left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

meson_options.txt Outdated Show resolved Hide resolved
tools/xkbcli-bash-completion.sh Outdated Show resolved Hide resolved
- Add bash completion script. It parses the commands help messages to
  provide the completions, thus any new subcommand or option will be
  supported, as long as it has its entry in the help messages. This
  should result in low maintenancei effort.
- Add installation entry in Meson. The path can be configured using
  the following options:
  - `enable-bash-completion` to enable the installation;
  - `bash-completion-path` to control the installation path. It will
    default to: `share/bash-completion/completions`.

TODO: completion for other shells, such as zsh?
@wismill wismill force-pushed the scripts/bash-completion branch from e5d8888 to aa08702 Compare October 5, 2023 04:21
@wismill wismill merged commit 1c1542d into xkbcommon:master Oct 5, 2023
4 checks passed
@wismill wismill deleted the scripts/bash-completion branch October 5, 2023 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants