Builds tab-completion configurations from --help output
This repository makes use of Git Submodules to track dependencies, to avoid incomplete downloads clone with the --recurse-submodules option...
git clone --recurse-submodules [email protected]:bash-utilities/help-to-complete.gitTo update tracked Git Submodules issue the following commands...
git pull
git submodule update --init --merge --recursiveTo force upgrade of Git Submodules...
git submodule update --init --merge --recursive --remoteNote, forcing and update of Git Submodule tracked dependencies may cause instabilities and/or merge conflicts; if however everything operates as expected after an update please consider submitting a Pull Request.
Perhaps as easy as one, 2.0,...
Clone this project...
mkdir -vp ~/git/hub/bash-utilities
cd ~/git/hub/bash-utilities
git clone --recurse-submodules [email protected]:bash-utilities/help-to-complete.gitInstall via make install command...
cd ~/git/hub/bash-utilities/help-to-complete
make installUninstall via uninstall Make target...
cd ~/git/hub/bash-utilities/help-to-complete
make uninstall... Which will remove symbolic links for script(s) and manual page(s).
To update in the future use make upgrade command...
cd ~/git/hub/bash-utilities/help-to-complete
make upgradeAfter installation, documentation may be accessed via man command, eg...
man help-to-completeGenerally the only required parameter to define is --executable, eg...
sudo help-to-complete --executable script-nameHowever, it is possible to define where completion configurations are saved, as well as the option that prints help/usage information for an executable...
sudo help-to-complete --executable script-name\
--completion-dir /usr/share/bash-completion/completions\
--help-option '--help'For example to save bash completion configurations to current repository may be similar to...
mkdir -vp "${PWD}/bash-completion"
help-to-complete --executable script-name\
--completion-dir "${PWD}/bash-completion"-
-cor--clobber- Overwrites preexisting completion configuration -
-hor--help- Prints this message and exits -
-lor--license- Prints copyright for this script and exits -
-vor--verbose- Prints messages about actions -
-Vor--version- Prints version for this script and exits -
--completion-dir<directory>- Directory to that completion configuration will be saved to -
--executable<executable>- Required name of executable to parse help documentation from -
--help-option<parameter>- Option executable uses to print help/usage -
--parameter-pattern<regexp>- Regular expression for parsing parameters from help/usage output
Help/usage of target executable should be formatted similar to output of help-to-complete script, which is mostly compatible with help2man parsing requirements, eg...
<description>
Usage: <name> [OPTIONS]...
Options:
-h --help
Prints this message and exits
-l --license
Prints copyright for this script and exits
-v --verbose
Prints messages about actions
-V --version
Prints version for this script and exits
-d --directory "some/where"
Directory path used by <name>
-e --executable "ls"
Executable called within <name>
-w --words "spam|flavored|ham"
Key word modifiers
-p --pattern "^(-{1,2}[a-zA-Z]){1,}"
Regular expression
Examples:
<name> -v --words spam
Output of help-to-complete should be considered a starting-point, and depending upon executable further customization may be required.
This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.
Options for contributing to help-to-complete and bash-utilities
Start making a Fork of this repository to an account that you have write permissions for.
- Add remote for fork URL. The URL syntax is
[email protected]:<NAME>/<REPO>.git...
cd ~/git/hub/bash-utilities/help-to-complete
git remote add fork [email protected]:<NAME>/help-to-complete.git- Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/bash-utilities/help-to-complete
git commit -F- <<'EOF'
:bug: Fixes #42 Issue
**Edits**
- `<SCRIPT-NAME>` script, fixes some bug reported in issue
EOF
git push fork mainNote, the
-uoption may be used to setforkas the default remote, eg.git push -u fork mainhowever, this will also default theforkremote for pulling from too! Meaning that pulling updates fromoriginmust be done explicitly, eg.git pull origin main
- Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is
https://github.com/<NAME>/<REPO>/pull/new/<BRANCH>
Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.
Thanks for even considering it!
Via Liberapay you may on a repeating basis.
Regardless of if you're able to financially support projects such as array-splice that bash-utilities maintains, please consider sharing projects that are useful with others, because one of the goals of maintaining Open Source repositories is to provide value to the community.
Builds tab-completion configurations from `--help` output
Copyright (C) 2021 S0AndS0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
For further details review full length version of AGPL-3.0 License.