Repository navigation
Further improvements to bash-completion - #126
Conversation
There was a problem hiding this comment.
I have issues with the changed script: it does not complete --help after command? IMHO it should i.e. for 'install' complete directories, partup files and all available options? I kind of highjacked the mechanism to do no further completions also after --version, so first after command it also did complete --version. I do not see an issue with filenames: you just shoudl not use a file named i.e. --help? Didn't test as touch and vim also just execute the help printout instead of generation a file...
Beside, I do not really get the reasoning behind installing in a shell subdirectory? In Ubuntu, the common completion install directory is /etc/bash_completion.d/, so here won't be any bloat or misconfig with other shells.
|
It does complete options after a command if you start with one or two dashes ( The reason for putting the completion script in a The usual place for system-wide bash completion scripts is in |
s-hemer
left a comment
There was a problem hiding this comment.
Ok, it looks like on friday I did not really get the change of path: that is just in the sources, install is still to a "bash-" subfolder anyways (if /etc/ or /usr/share/ does not matter...).
With the option completion: ok, git does is this way, potentially others as well so it is ok for me. Yet, I am still unsure if I really like it that way as to a certain extend, it looks like one cannot add options at that step...
I am fine with me adding to contributors although this PR kind of re-writes my whole contribution so far...
|
One additional comment: installing via |
No. Unfortunately, Meson cannot generate a complete Debian package by itself.
Good point. The |
The initial draft did not complete the arguments of options and mixed up several details. Rework the script so that all commands, options and positional arguments complete correctly. - Skip the arguments of -D/--debug-domains and -C/--directory when looking for the command, so that e.g. a file named like a command is not mistaken for it. - Complete only directories for -C/--directory, also in the --directory=DIR form, and nothing for -D/--debug-domains. - Complete the PACKAGE and DEVICE arguments of install by position and only offer one PACKAGE for show. - Offer the help options only directly after a command. - Add the SPDX license header and prefix all variables and functions with _partup_ to avoid polluting the shell environment. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Install the completion script as 'partup' into the bash-completion directory reported by pkg-config. Fall back to the default location below datadir if bash-completion is not installed, so that the script is available for all packaging and not only for Debian. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Meson now installs the completion script, so dh_bash-completion would only duplicate it. Drop the extra install file and the debhelper sequence addition. Keep bash-completion as a build dependency, as meson queries it with pkg-config for the install location. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Document the Bash completion script, what it completes and how to use it without installing partup. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Add the Bash completion script to the release notes of the upcoming release. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Keep shell completion scripts in a dedicated completions/ directory with one subdirectory per shell, so that scripts for other shells can be added later without cluttering the top-level directory. Name the script after the command, as it is installed, so that the meson install rule no longer needs to rename it. Update the documentation accordingly. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
When installing partup in this workflow, use sudo, as required for files owned by root. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Add Steffen Hemer as a new contributor for his work on bash completion support. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
The debian/dirs file is redundant and not needed, as the directory structure is already created by Meson Build. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Add the bash-completion package to the build container for building Debian packages. This is required for bash completion to successfully build into the Debian package. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
578b364 to
fae2de6
Compare
Improve the bash-completion for partup to support all options and commands. Use Meson to install the completions. Add an entry to the changelog and add documentation.