diff --git a/.dir-locals.el b/.dir-locals.el index c46f181a119..56279deefb8 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,10 +1,10 @@ -;; bash-completion shell-script mode additional settings for Emacs +;;; Directory Local Variables +;;; For more information see (info "(emacs) Directory Variables") -((sh-mode . ((sh-indent-comment . t) - ;; Somewhat fragile, waiting for flycheck-sh-bash-args - (eval . (setq flycheck-command-wrapper-function - (lambda (command) - (append (butlast command 1) - '("-O" "extglob") - (last command))))) - ))) +((python-mode + (eval add-hook 'before-save-hook 'blacken-buffer nil t)) + (sh-mode + (mode . shfmt-on-save) + (shfmt-arguments "-s") + (flycheck-sh-bash-args "-O" "extglob") + (sh-indent-comment . t))) diff --git a/.editorconfig b/.editorconfig index 93f55b832ef..89fd9136286 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,15 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true max_line_length = 79 +# for shfmt +function_next_line = true +switch_case_indent = true [Makefile.am] indent_style = tab + +[*.{yml,yaml}] +indent_size = 2 + +[COMMIT_EDITMSG] +max_line_length = 72 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..b6505b69824 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,41 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +## Describe the bug + + + +## To reproduce + + + +1. cd to '...' +2. Type '....' +3. See problem + +## Expected behavior + + + +## Versions (please complete the following information) + +- [ ] Operating system name/distribution and version: +- [ ] bash version, `echo "$BASH_VERSION"`: +- [ ] bash-completion version, `(IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}")`: + +## Additional context + + + +## Debug trace + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..89f9eab4100 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,24 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +## Describe the feature/solution + + + +## Maintenance (please complete the following information) + + + +- [ ] This is a request for new completion +- [ ] Link to upstream project query about shipping the completion: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000000..e4fc0abecb3 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,147 @@ +name: ci + +on: + pull_request: + push: + branches: + - master + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: pip-${{hashFiles('test/requirements*.txt')}} + - uses: actions/cache@v2 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{hashFiles('.pre-commit-config.yaml')}} + - name: Install dependencies + run: | + python3 -m venv venv # for venv-run + source venv/bin/activate + python3 -m pip install -Ur test/requirements-dev.txt + - name: Run checks + run: | + source venv/bin/activate + + # Commit message checks + + tmpdir=$(mktemp -d) + trap "rm -r '$tmpdir'" EXIT + commits_json=$tmpdir/commits.json + commit_txt=$tmpdir/message.txt + + # For push, commits are available directly in github.event.commits. + # For pull_request they're not: grab them from API, transform fields + # we want to a similar structure as pushes are. + if [[ "${{github.event.commits}}" ]]; then + cat <<\EOF >"$commits_json" + ${{toJSON(github.event.commits)}} + EOF + else + curl -fSsL ${{github.event.pull_request.commits_url}} | \ + jq '[.[] | {id: .sha, message: .commit.message}]' >"$commits_json" + fi + + git config user.name $(git log -1 --format=format:%an) + git config user.email $(git log -1 --format=format:%ae) + rc=0 + for id in $(jq --raw-output '.[].id' <"$commits_json"); do + jq --raw-output ".[] | select(.id==\"$id\") | .message" \ + <"$commits_json" >"$commit_txt" + echo "Linting commit $id message..." + set +e + pre-commit run gitlint \ + --color=always \ + --hook-stage=commit-msg \ + --commit-msg-filename="$commit_txt" + ((rc+=$?)) + set -e + done + + # Other pre-commit checks + + set +e + pre-commit run --color=always --all-files + ((rc+=$?)) + set -e + + exit $rc + + distcheck: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - dist: alpine + - dist: centos7 + - dist: debian10 + - dist: debian10 + bsd: true + network: none + - dist: fedoradev + - dist: ubuntu14 + steps: + - uses: actions/checkout@v2 + - uses: GoogleCloudPlatform/release-please-action@v2 + with: + release-type: simple + id: release + if: github.event_name == 'push' && matrix.dist == 'alpine' + - name: Do release preparations + run: | + version=$(cat version.txt) + sed -i -re "s/^(BASH_COMPLETION_VERSINFO=).*/\\1(${version//./ })/" bash_completion + sed -i -re "s/^(AC_INIT\(.*\[)[0-9.]+(\].*)/\\1$version\\2/" configure.ac + git config user.name $(git log -1 --format=format:%an) + git config user.email $(git log -1 --format=format:%ae) + git commit --message="chore: bump release in dist files" bash_completion configure.ac + git tag --force ${{steps.release.outputs.tag_name}} + git push + git push --tags --force + if: steps.release.outputs.release_created + # A "container" workflow config would be cleaner here, but comes with + # some restrictions/oddities: changes root's $HOME to /github/home + # without changing the actual home dir that can cause some problems, + # and does not provide a way to run with --network none. + # fedoradev unconfined: https://bugzilla.redhat.com/1900021 + - name: Run main build + run: >- + docker run + --rm + --tty + --env CI=true + --env DIST=${{matrix.dist}} + --env BSD=${{matrix.bsd}} + --env PYTESTFLAGS=--verbose + --env NETWORK=$NETWORK + ${NETWORK:+--network $NETWORK} + $(test $DIST = fedoradev && echo --security-opt seccomp=unconfined) + --volume $PWD:/usr/src/bash-completion + --workdir /usr/src/bash-completion + ghcr.io/scop/bash-completion/test:${{matrix.dist}} + test/docker/entrypoint.sh + env: + DIST: ${{matrix.dist}} + NETWORK: ${{matrix.network}} + - name: Upload release assets + run: | + set -x + upload_url="${{steps.release.outputs.upload_url}}" + tarball="bash-completion-$(cat version.txt).tar.xz" + curl \ + --header "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" \ + --header "Accept: application/vnd.github.v3+json" \ + --header "Content-Type: application/x-xz-compressed-tar" \ + --data-binary "@$tarball" \ + "${upload_url%{*}?name=$tarball" + if: steps.release.outputs.release_created + - uses: actions/upload-artifact@v2 + with: + path: bash-completion-*.tar.xz + if: matrix.dist == 'alpine' diff --git a/.github/workflows/update-docker-images.yml b/.github/workflows/update-docker-images.yml new file mode 100644 index 00000000000..113017c4af8 --- /dev/null +++ b/.github/workflows/update-docker-images.yml @@ -0,0 +1,43 @@ +name: update-docker-images + +# Update Docker images when the set of commands required present for testing +# change. This is not perfect as it would be good to have the new commands +# installed already at PR time, and at least at time the change lands in the +# default branch. That way it'd be tested immediately then with images +# containing it, instead of later along with some other, completely unrelated +# change. + +on: + push: + paths: + - test/test-cmd-list.txt + - test/docker/*/Dockerfile + - test/docker/*/install-packages.sh + workflow_dispatch: + +jobs: + update-test-image: + runs-on: ubuntu-latest + if: github.repository_owner == 'scop' && github.ref == 'refs/heads/master' + strategy: + matrix: + include: + - dist: alpine + - dist: centos7 + - dist: debian10 + - dist: fedoradev + - dist: ubuntu14 + steps: + - uses: actions/checkout@v2 + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{github.repository_owner}} + password: ${{secrets.GITHUB_TOKEN}} + - uses: docker/build-push-action@v2 + with: + context: test + file: test/docker/${{matrix.dist}}/Dockerfile + tags: | + ghcr.io/scop/bash-completion/test:${{matrix.dist}} + push: true diff --git a/.gitignore b/.gitignore index 00489c94dfb..3f59210eca0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,23 @@ -*.tar* *.swp +*.tar* +*~ +.pytest_cache/ Makefile Makefile.in -aclocal.m4 -autom4te.cache -config.log -config.status -configure -install-sh -missing -doc/*.xml -*~ -doc/html* -bash_completion.sh -bash-completion.pc -bash-completion-config.cmake -bash-completion-config-version.cmake __pycache__/ -.pytest_cache/ +pytestdebug.log +/.python-version +/aclocal.m4 +/autom4te.cache +/bash-completion-config-version.cmake +/bash-completion-config.cmake +/bash-completion.pc +/bash_completion.sh +/config.log +/config.status +/configure +/configure.lineno +/doc/*.xml +/doc/html* +/install-sh +/missing diff --git a/.gitlint b/.gitlint new file mode 100644 index 00000000000..d79518bca71 --- /dev/null +++ b/.gitlint @@ -0,0 +1,10 @@ +[general] +ignore = body-is-missing +ignore-fixup-commits = false +ignore-revert-commits = false +ignore-squash-commits = false +ignore-stdin = true +contrib = contrib-title-conventional-commits + +[ignore-body-lines] +regex = ^(Co-authored-by:|(Refs )?https?://) diff --git a/.perltidyrc b/.perltidyrc new file mode 100644 index 00000000000..9f681d2ff2a --- /dev/null +++ b/.perltidyrc @@ -0,0 +1,6 @@ +--perl-best-practices +--maximum-line-length=79 +--paren-tightness=2 +--cuddled-else +--warning-output +--converge diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..9daf7fdae4b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,145 @@ +default_stages: [commit] + +repos: + + - repo: https://github.com/jorisroovers/gitlint + rev: v0.17.0 + hooks: + - id: gitlint + stages: [commit-msg] + + - repo: https://github.com/scop/pre-commit-shfmt + rev: v3.4.0-1 + hooks: + - id: shfmt-docker + types: [text] + files: ^(bash_completion|completions/.+|test/(config/bashrc|update-test-cmd-list)|.+\.sh(\.in)?)$ + exclude: ^completions/(\.gitignore|Makefile.*)$ + + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.8.0.1 + hooks: + - id: shellcheck + args: [-f, gcc] + types: [text] + files: ^(bash_completion|completions/.+|test/(config/bashrc|update-test-cmd-list)|.+\.sh(\.in)?)$ + exclude: ^completions/(\.gitignore|Makefile.*)$ + require_serial: false # We disable SC1090 anyway, so parallel is ok + + - repo: local + hooks: + - id: update-test-cmd-list + name: update-test-cmd-list + language: script + entry: test/update-test-cmd-list + files: ^test/t/.+\.py$ + pass_filenames: false + + - repo: https://github.com/psf/black + rev: 21.11b1 + hooks: + - id: black + types: [text] + files: ^(helpers/python|.+\.py)$ + exclude: ^completions/ + + - repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + args: [--config=test/setup.cfg] + additional_dependencies: + # Splitting dashes and items on separate lines is intentional, + # enables Renovate's pip_requirements manager to update this file. + - + pycodestyle ==2.8.0 + - + pyflakes ==2.4.0 + - + flake8-bugbear ==21.4.3 + types: [text] + files: ^(helpers/python|.+\.py)$ + exclude: ^completions/ + + - repo: https://github.com/PyCQA/isort + rev: 5.9.3 + hooks: + - id: isort + args: [--filter-files, --settings-path=test/setup.cfg] + + - repo: local + hooks: + - id: mypy + name: mypy + language: python + additional_dependencies: + - + venv-run ==0.1.0 + entry: venv-run mypy + args: [--config-file=test/setup.cfg] + types: [python] + # Intentionally not run on helpers/python (we support very old versions) + exclude: ^completions/|^test/fixtures/pytest/ + + - repo: https://github.com/asottile/pyupgrade + rev: v2.24.0 + hooks: + - id: pyupgrade + args: [--py36-plus, --keep-percent-format] + exclude: ^completions/ + + - repo: https://github.com/perltidy/perltidy + rev: "20210717" + hooks: + - id: perltidy + types: [text] + files: ^(helpers/perl|.+\.p[ml])$ + + - repo: local + hooks: + - id: perlcritic + name: perlcritic + language: perl + additional_dependencies: [PETDANCE/Perl-Critic-1.140.tar.gz] + entry: perlcritic + args: [--quiet, --verbose, "5"] + types: [text] + files: ^(helpers/perl|.+\.p[ml])$ + + - repo: https://github.com/jackdewinter/pymarkdown + rev: 0.9.0 + hooks: + - id: pymarkdown + entry: pymarkdown + args: + - --config=.pymarkdown.json + - scan + exclude: ^CHANGELOG\.md$ + + - repo: local + hooks: + - id: asciidoctor + name: asciidoctor + language: docker_image + entry: asciidoctor/docker-asciidoctor:1.15 asciidoctor + args: + - --out-file + - /dev/null + - --failure-level + - WARN + - --doctype + - book + - doc/main.txt + pass_filenames: false + files: ^doc/.*\.txt$ + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: check-case-conflict + + - repo: https://github.com/crate-ci/typos + rev: v1.0.11 + hooks: + - id: typos + exclude: ^(CHANGELOG\.md|test/(test-cmd-list\.txt|fixtures/.+))$ diff --git a/.pymarkdown.json b/.pymarkdown.json new file mode 100644 index 00000000000..89fcc97b021 --- /dev/null +++ b/.pymarkdown.json @@ -0,0 +1,17 @@ +{ + "plugins": { + "first-line-heading": { + "//": "Does not work with GitHub issue templates", + "enabled": false + }, + "no-inline-html": { + "//": "https://github.com/jackdewinter/pymarkdown/issues/22", + "enabled": false, + "allowed_elements": "!--,kbd" + }, + "ul-indent": { + "//": "Disabled for lists in FAQ/A", + "enabled": false + } + } +} diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 00000000000..f53310f3903 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,14 @@ +shell=bash +enable=deprecate-which +enable=require-double-brackets +disable=SC1090 # not really fixable usually (ever?) +disable=SC2034 # for localizing variables set in called functions +disable=SC2128 # intentional style choice +disable=SC2206 # suggested alternatives fail in posix mode or use temp files +disable=SC2207 # suggested alternatives fail in posix mode or use temp files + +# These disables are to be investigated and decided + +disable=SC2016 +disable=SC2086 +disable=SC2155 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7a73d6ed16c..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: generic - -sudo: required - -services: - - docker - -env: - - DIST=centos6 - - DIST=fedoradev - - DIST=ubuntu14 - - DIST=ubuntu14 BSD=true NETWORK=none - - DIST=tools - -before_install: - - docker build -t bash-completion:$DIST -f test/docker/Dockerfile-$DIST . - -script: - - docker run - -e CI=true -e DIST=$DIST -e BSD=$BSD - ${NETWORK:+--network $NETWORK} - -t bash-completion:$DIST test/docker/docker-script.sh diff --git a/AUTHORS b/AUTHORS index 4b547f10891..ee2daef7c74 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,4 +4,4 @@ Guillame Rousse (Mandriva) Igor Murzov Mike Kelly (Exherbo) Santiago M. Mola (Exherbo) -Ville Skyttä (Fedora/Red Hat) +Ville Skyttä diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000000..4829ca51b02 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,1745 @@ +## 2.11 (2020-07-25) + +* lilo: add -B and -E completions ([7dd16ad](https://www.github.com/scop/bash-completion/commit/7dd16adf6ae409ee76256ac8b73977e9a88e341e)) +* lilo: honor -C when completing labels ([5b12f1d](https://www.github.com/scop/bash-completion/commit/5b12f1d49bf036f99ccd97df2c3effee63fb04d8)) +* lilo: don't complete on commented out labels ([ad6a349](https://www.github.com/scop/bash-completion/commit/ad6a3496c3517534e5791334094cc23ec7f09437)) +* test/dnssec-keygen: allow more alternatives in algorithm completion ([0f80613](https://www.github.com/scop/bash-completion/commit/0f80613bd8a554c6aece24cf694a4ba9a11e57ba)) +* test/wol: don't fail MAC test if test system has /etc/ethers entries ([8130f87](https://www.github.com/scop/bash-completion/commit/8130f87b4e035e3b439ce2f06bdb6bb495288e15)) +* : complete commands when prefixed with a backslash ([1e029e8](https://www.github.com/scop/bash-completion/commit/1e029e81dc0a121f575d35c925cc878448feccc4)) +* ipcalc: new completion ([1307b7a](https://www.github.com/scop/bash-completion/commit/1307b7ae9f809aec4d1cda74a13878c1947eb095)) +* README.md: add introduction ([3e941a6](https://www.github.com/scop/bash-completion/commit/3e941a643097d080277af00924e34ef925c4c41f)) +* chromium-browser, firefox: complete on *.txt (#379) ([d705123](https://www.github.com/scop/bash-completion/commit/d7051234afee6cc164b59660dade18f34fb0d52f)) +* test/ipcalc: fix tests with busybox ipcalc ([ba3b2ea](https://www.github.com/scop/bash-completion/commit/ba3b2ea05632e07920c4670d0297af557ba717c5)) +* lilo: work around shellcheck false positive ([42dbeef](https://www.github.com/scop/bash-completion/commit/42dbeefb8a681e52f381218c2b69e586537ab6e4)) +* test: port remaining finger, sftp, ssh, and xhost cases to pytest+pexpect ([aab32df](https://www.github.com/scop/bash-completion/commit/aab32df7ec7a9bff6059560d58c0c7088a983bd4)) +* test: port some scp test cases to pytest+pexpect ([f4f365d](https://www.github.com/scop/bash-completion/commit/f4f365dd6c619b41f9947eb3e53a120fd5173cbe)) +* test: fix spurious hosts fixture failure without avahi-browse installed ([b2c12be](https://www.github.com/scop/bash-completion/commit/b2c12be995eb4cb9aea931abb5f8c90a9f96907c)) +* test: remove some no longer needed tcl/expect code ([f066c67](https://www.github.com/scop/bash-completion/commit/f066c676f2145acb4df84461ba75847af35d2e9f)) +* test: port some _known_hosts_real unit tests to pytest+pexpect ([30aefd3](https://www.github.com/scop/bash-completion/commit/30aefd3ee918d2a2c70d24eeb37e7c36004d3ea8)) +* test: host helper lint and usage fixes ([bd3d509](https://www.github.com/scop/bash-completion/commit/bd3d509f04fe6ca0ef9477293006fada716aebca)) +* cryptsetup: add luksChangeKey arg completion (#380) ([5bb526a](https://www.github.com/scop/bash-completion/commit/5bb526a0b6f1af02b32464879c71a1fd5a5e4104)) +* tsig-keygen: new completion ([399771d](https://www.github.com/scop/bash-completion/commit/399771d6f19d839069f0eb45001887a04231885e)) +* test/upgradepkg: port remaining test case to pytest+pexpect ([3a0e9c1](https://www.github.com/scop/bash-completion/commit/3a0e9c1e78d33571f272d327c7f4fbb8dca250d8)) +* test/tsig-keygen: require command for test_options ([9f0ae30](https://www.github.com/scop/bash-completion/commit/9f0ae306200cbf5cc6e62f72f77ea8a774ea41e3)) +* test/chown,sudo: parametrize special case test, improve xfail targeting ([2f34e86](https://www.github.com/scop/bash-completion/commit/2f34e86d988733515e21b3050d4f4ab603b9adc4)) +* test: remove some no longer needed old test suite code ([8b3007f](https://www.github.com/scop/bash-completion/commit/8b3007f7315e7313add3518599ce44c288c48aa6)) +* test/cd: convert remaining test case to pytest+pexpect ([c23c807](https://www.github.com/scop/bash-completion/commit/c23c8079fb1d78f03acb5c183b85264f6c9e06db)) +* test/cd: make dir_at_point produce better debuggable failures ([a6cfbcd](https://www.github.com/scop/bash-completion/commit/a6cfbcdc729a640b1b89af4cd4c8f3d713d51a47)) +* nmap: parse options from -h output ([e99577a](https://www.github.com/scop/bash-completion/commit/e99577a3e7f7c571a61074242ab21e0245bfe3dd)) +* nmap: handle options split on equals sign ([c51ccb7](https://www.github.com/scop/bash-completion/commit/c51ccb76d1f4fa08f1260e8d204d3622dce76f4e)) +* openssl: support getting digest list from more recent openssl versions ([fe90e2a](https://www.github.com/scop/bash-completion/commit/fe90e2aef9364d2361bdc9ae57f06690de52a596)) +* openssl: parse available options from $command -help ([9e03fc5](https://www.github.com/scop/bash-completion/commit/9e03fc5ca07ecc7cbb863b2affdd06f8bbf8b415)) +* openssl: complete -writerand with filenames ([548feef](https://www.github.com/scop/bash-completion/commit/548feef55be93a99c488e31051f524a0e4c5549b)) +* totem: reuse kaffeine completions (#372) ([e4d5eba](https://www.github.com/scop/bash-completion/commit/e4d5ebadf2a7ae61162defb7d6045fb8bff3f0da)) +* test/cd: remove unused import ([9a9f09f](https://www.github.com/scop/bash-completion/commit/9a9f09fd175b859b53c014137b8c91722ef158f1)) +* test/totem: add basic test case ([9c33f68](https://www.github.com/scop/bash-completion/commit/9c33f68a04e0ec6766cb224ab025efbd42ca54e7)) +* extra/make-changelog: run through black ([c85e5b1](https://www.github.com/scop/bash-completion/commit/c85e5b16aed3e49b2a3445e67b5143c305c37883)) +* : python type hint fixes and improvements ([d1dee07](https://www.github.com/scop/bash-completion/commit/d1dee0769275e68d39ef4c49983f4c7c89534b8f)) +* test: drop redundant black args from docker runs ([eedaa1c](https://www.github.com/scop/bash-completion/commit/eedaa1c56c09d00d39347d4b4b12c5a9d2920b1f)) +* pre-commit: add config with black, flake8, and mypy ([3b82089](https://www.github.com/scop/bash-completion/commit/3b8208985813bb424bc58a2d013eda08c50f7591)) +* test: install black for Python 3.6 too ([3f1d1ee](https://www.github.com/scop/bash-completion/commit/3f1d1ee9e41f1976181fb9f8b7a8039ee42f0219)) +* test: add flake8-bugbear ([1dddc81](https://www.github.com/scop/bash-completion/commit/1dddc81eb7363dfefde6f3b595efaa8d12e05691)) +* test: add isort to pre-commit, run it ([092d20a](https://www.github.com/scop/bash-completion/commit/092d20a8c592cc801cd7604e7a2f6907a787fbf2)) +* test: shellcheck tweaks ([e0c9c5e](https://www.github.com/scop/bash-completion/commit/e0c9c5e67ffb9d3f5c4076ffd667fb4a9b6dafbe)) +* test: run pre-commit in tools container ([0a5d616](https://www.github.com/scop/bash-completion/commit/0a5d61699c25dc13fc7eec0a18a9e1ff87411dbe)) +* jarsigner: complete on *.apk too (#386) ([64449ed](https://www.github.com/scop/bash-completion/commit/64449edf99377f66739c4ce51eeaec077687b52b)) +* python: support executables with minor version (#389) ([bd3eba8](https://www.github.com/scop/bash-completion/commit/bd3eba8182e9cc72d838ea655a8c2aa25a3272fc)) +* _known_hosts_real: check that ruptime is present before calling (#390) ([6217345](https://www.github.com/scop/bash-completion/commit/62173450aa686bed5431342410eb6edd21c33e6d)) +* ip: improve completion of route subcommands (#326) ([9982cc3](https://www.github.com/scop/bash-completion/commit/9982cc34d6ea684720f171dcdfa1a20a0b5a81e3)) +* test: fix CompletionResult.__eq__ UnboundLocalError ([0e1fe15](https://www.github.com/scop/bash-completion/commit/0e1fe15aa71cd4fafe571613f9a77b17b71fbcc6)) +* copyright: add 2020 ([0055238](https://www.github.com/scop/bash-completion/commit/00552386675b8589943dc50748ab00e272979796)) +* printenv: new completion ([014b3f2](https://www.github.com/scop/bash-completion/commit/014b3f2a0e13e87f25f31fd0ccacbf09ba3bcec2)) +* _xinetd_services: look up from $BASHCOMP_XINETDDIR, add some unit tests ([ea1cfa1](https://www.github.com/scop/bash-completion/commit/ea1cfa1da4cd793f66e298dadc9b5b5a916d5a63)) +* test: ignore flake8 messages that are in black's domain ([6dae998](https://www.github.com/scop/bash-completion/commit/6dae998a9e8870fff5f9511383c5becc8005e7b1)) +* test: move shellcheck to pre-commit ([e908d02](https://www.github.com/scop/bash-completion/commit/e908d02129cf641784fcd14f0e3105bf573aaed3)) +* test: move perltidy to pre-commit, run with --converge ([15aacc9](https://www.github.com/scop/bash-completion/commit/15aacc96cb1c767f162836b121d18d7ecc744a55)) +* test: require openssl command for option argument tests ([4c64a1b](https://www.github.com/scop/bash-completion/commit/4c64a1bd293b6fe1b5ed182ac8306ed2036b2603)) +* git: trigger docker rebuild on pre-commit config change ([ffc5adf](https://www.github.com/scop/bash-completion/commit/ffc5adfb8f1d312bfc77664dc3144289e978d0ae)) +* test: split dependencies requiring Python 3.6.1+ to requirements-dev.txt ([009bf22](https://www.github.com/scop/bash-completion/commit/009bf2228c68894629eb6fd17b3dc0f1f6d67615)) +* test: upgrade mypy to 0.770 ([383cbad](https://www.github.com/scop/bash-completion/commit/383cbad64934208df355cb5c1d6f29026b3f3ebe)) +* printenv: indentation fixes ([3ac9f0a](https://www.github.com/scop/bash-completion/commit/3ac9f0a24331d0768ce16bdce4977694f037ed1e)) +* test/printenv: require command for arg completion test ([afc9052](https://www.github.com/scop/bash-completion/commit/afc9052be4990f41675766935933e95a2f8f9a20)) +* test/ldd: xfail if --help is not implemented ([71b465a](https://www.github.com/scop/bash-completion/commit/71b465a89801e60fc9c5172004e0d92353999adc)) +* test/python: add testcase for submodule completion ([900824d](https://www.github.com/scop/bash-completion/commit/900824d9162b42399c17331cbbcfe6bce56665b4)) +* pre-commit: run most python checks on helpers/python too ([5ed40e0](https://www.github.com/scop/bash-completion/commit/5ed40e089f5e5f33a125dc145f6d678fef0584ca)) +* lintian: complete paths for Ubuntu's .ddeb and Debian's buildinfo files (#397) ([0988831](https://www.github.com/scop/bash-completion/commit/0988831a7a4fea73e5d61e64dd657d69779cf8e3)) +* ip: add support for netns (#391) ([a2ccfa6](https://www.github.com/scop/bash-completion/commit/a2ccfa6bb0438cdb88ef1e551448e839bf70f99f)) +* apt-get etc: use _apt_cache_packages from apt-cache ([d90fbe3](https://www.github.com/scop/bash-completion/commit/d90fbe3bfd7e53c365897fa584edc9d2d0a2e9bf)) +* : whitespace tweaks ([3c87811](https://www.github.com/scop/bash-completion/commit/3c87811d8917852a132771e5c92b1e76886e493e)) +* : argument interation improvements ([ec6995c](https://www.github.com/scop/bash-completion/commit/ec6995cadc3ab24246e363b4cbc2452091cd4d28)) +* test/aptitude: add some test cases ([762ee12](https://www.github.com/scop/bash-completion/commit/762ee12d24db419f02fc026e063962dde82e7275)) +* aptitude: parse options list from --help, hardcode less ([27219f8](https://www.github.com/scop/bash-completion/commit/27219f8e76970e7780062d6746ab609792bb7e3d)) +* aptitude: add some option arg (non)completions ([826b333](https://www.github.com/scop/bash-completion/commit/826b3336cfa25696b0886908609c29f87a37f8e4)) +* crontab, wodim: silence shellcheck SC2191 and SC2192 ([e81f690](https://www.github.com/scop/bash-completion/commit/e81f6908ffbbe8477f636e5ca68ffda0748c12de)) +* bash_completion: address shellcheck SC2220 ([a167497](https://www.github.com/scop/bash-completion/commit/a167497e3ea2136b51e62cb04851cb3178f9c332)) +* : address shellcheck SC2221 and SC2222 ([365fa76](https://www.github.com/scop/bash-completion/commit/365fa76e2b587bd6c9c39154433b9ced38fe091d)) +* smartctl: hush shellcheck SC2054 false positives ([0ad46d6](https://www.github.com/scop/bash-completion/commit/0ad46d6042d6dec1b28f3212551d668a1febe8d4)) +* mplayer: address shellcheck SC1078 false positive ([a6e5e99](https://www.github.com/scop/bash-completion/commit/a6e5e9953ee275b67aae8a1f34e3fdc3fa340e38)) +* java, pkgadd, sysbench: address shellcheck SC2124 ([5757fd4](https://www.github.com/scop/bash-completion/commit/5757fd4a3693da792f61ff600a0072218b4162dd)) +* chronyc, wvdial: address shellcheck SC2178 ([cddf99a](https://www.github.com/scop/bash-completion/commit/cddf99a63b9bd4d561691299a3eb04aa56e60fa1)) +* pkgadd: indentation fix ([523387e](https://www.github.com/scop/bash-completion/commit/523387e2891cf17dbf79767d0ee521c6946af46c)) +* sysbench: add --test= deprecation TODO ([9caf5c9](https://www.github.com/scop/bash-completion/commit/9caf5c99b64803be50d15421460978bfe33a85be)) +* protoc: complete all --*_out without more specific handling with dirs ([a10adf2](https://www.github.com/scop/bash-completion/commit/a10adf25a75bab2d9cd1eb5805e73d12149cb287)) +* test: don't run shellcheck on completions/.gitignore ([3f0d77f](https://www.github.com/scop/bash-completion/commit/3f0d77f079901c080d10cc2331c6def42648278e)) +* _known_hosts_real, op: address shellcheck SC2184 ([7fdd0a5](https://www.github.com/scop/bash-completion/commit/7fdd0a5582a0830d02575e290133b26f089c24e2)) +* test/aptitude: require command where necessary ([72a59a6](https://www.github.com/scop/bash-completion/commit/72a59a6a604a3fba297484732bc3eac66a702969)) +* test/printenv: xfail if --help doesn't contain options (e.g. busybox) ([2eccac4](https://www.github.com/scop/bash-completion/commit/2eccac4327e835f4ea553fe0fadf2f6103c24055)) +* insmod, modinfo, modprobe: support xz compressed modules (#401) ([2c6a522](https://www.github.com/scop/bash-completion/commit/2c6a52236026a8e3307faca7b897ae368489391d)) +* test: upgrade shellcheck to 0.7.1 ([6af1710](https://www.github.com/scop/bash-completion/commit/6af1710fcbf8ec1108a394a7d611394590957911)) +* quote_readline: fix $ret leak ([3f340bf](https://www.github.com/scop/bash-completion/commit/3f340bf8d7f63f86987a3c947db272ccd296487e)) +* info, java: address shellcheck SC2153 ([460f1b1](https://www.github.com/scop/bash-completion/commit/460f1b105f7ea3e6b26016cf61d6449c6b504c12)) +* man, perl, route, tipc: address shellcheck SC2053 ([0fcfa65](https://www.github.com/scop/bash-completion/commit/0fcfa6592bf6d4085c1e37f6d0dd00510c805a1f)) +* tipc: comment grammar and spelling fixes ([22b015e](https://www.github.com/scop/bash-completion/commit/22b015ec167cfe9cb8da1fc399067dc2d0a55f71)) +* renice: address shellcheck SC2254 ([5f25641](https://www.github.com/scop/bash-completion/commit/5f2564100ed436d4eb2dc7a664a2706304e80b66)) +* test/run: address shellcheck SC2164 ([49ac2d9](https://www.github.com/scop/bash-completion/commit/49ac2d9ffcc8cc2c58984ae1e38f360478ea80ed)) +* _upvar, _upvars, _variables, rpm: address shellcheck SC1083 ([e043fac](https://www.github.com/scop/bash-completion/commit/e043fac649b50c7c0e5d0a8d49ce8bd93a139322)) +* mutt: address shellcheck SC2088 ([2404e97](https://www.github.com/scop/bash-completion/commit/2404e9755aaba02bd11471f9a6bd3f11ce3a4386)) +* ssh: add new -Q completions in OpenSSH 8.2p1 (#400) ([a5890aa](https://www.github.com/scop/bash-completion/commit/a5890aa5e29e0f1cd1500df4758d7883dd55f2f5)) +* cvs, modprobe, sh: address shellcheck SC2209 ([f894bc1](https://www.github.com/scop/bash-completion/commit/f894bc19b770d83b91612219016674aed6546604)) +* rpm, ssh, umount.linux: address shellcheck SC2120 ([d7381be](https://www.github.com/scop/bash-completion/commit/d7381be935d96244838b0a3a603639d95a0e6564)) +* _filedir_xspec: address shellcheck SC2140 ([198d3f7](https://www.github.com/scop/bash-completion/commit/198d3f71fc09f11519321b9561c31b1ef796e7dd)) +* scp: address shellcheck SC2089 and SC2090 ([c906aeb](https://www.github.com/scop/bash-completion/commit/c906aeb76cae276b04d8cbe25f80a986fec42018)) +* java, pkgadd, sysbench: address shellchec SC2124 ([34e5e6a](https://www.github.com/scop/bash-completion/commit/34e5e6a0ad9d29b4f91e93a6952050e88c5ad2a6)) +* test/lib/library.sh: address shellcheck SC2125 ([bef80ef](https://www.github.com/scop/bash-completion/commit/bef80ef624c3d7101b3661895958365f71b890a8)) +* : address shellcheck SC2046 ([1d3add4](https://www.github.com/scop/bash-completion/commit/1d3add44563e48be7a6ec6cbd4cc8bb9e27d44f0)) +* test: bump shellcheck severity to warning + some disables ([a6cd66c](https://www.github.com/scop/bash-completion/commit/a6cd66cc4b0dcf8f36e788b0ecdb637c72f0118e)) +* test: tolerate duplicates from compgen actions ([bbd6814](https://www.github.com/scop/bash-completion/commit/bbd68147a9eb829ddbae4ffed6523b69a076b6ed)) +* test/xfreerdp: skip xfreerdp kbd test if kbd-list returns empty ([9746a39](https://www.github.com/scop/bash-completion/commit/9746a39cbc2a1102c3bc9f7fff36ce36e8d05881)) +* test: make it possible to not care whether command did output or not ([1ef3ad4](https://www.github.com/scop/bash-completion/commit/1ef3ad487fb9f02b8cc641439b2049529fbdfb9e)) +* test: run skipif and xfail commands without caring if they output or not ([005ab9f](https://www.github.com/scop/bash-completion/commit/005ab9f0957f33f092d415f2ab2e1b3a3f501dfd)) +* pgrep, pkill: add --ns and --nslist arg completions ([e649ea1](https://www.github.com/scop/bash-completion/commit/e649ea16374bbacfdb84c3d9803211754f62bfc1)) +* pytest: complete test classes ([f4ac160](https://www.github.com/scop/bash-completion/commit/f4ac16016d005d91652226272e3d496ede8e5ca1)) +* pytest: add some option arg (non-)completions ([61e5d8d](https://www.github.com/scop/bash-completion/commit/61e5d8de7fcbc426c5a1e3f7f5dcda9510051eed)) +* test/cd: fix test_dir_at_point for setups that repeat "trailer" ([25b4f1d](https://www.github.com/scop/bash-completion/commit/25b4f1db77f2373f7a700998327e9d9d837da89a)) +* test: generalize complete at point test ([8314c75](https://www.github.com/scop/bash-completion/commit/8314c7576134d2a1ae948bc6f3e008e15d837886)) +* test/alias: port remaining test case to pytest+pexpect ([f81d313](https://www.github.com/scop/bash-completion/commit/f81d313138cb6ab0fd155089b3c7499d733c118b)) +* nmap: fix option parsing with BSD sed ([e712b2f](https://www.github.com/scop/bash-completion/commit/e712b2f932a4f000c75a417ab62f19532147ed52)) +* carton: fix command parsing with BSD sed ([1968b3a](https://www.github.com/scop/bash-completion/commit/1968b3ae59b20ea16fe0004ecff53831a1728467)) +* _filedir*: update link to bug-bash discussion on -X (#404) ([bfd65f3](https://www.github.com/scop/bash-completion/commit/bfd65f3be7af378d944a269e77cdf5d93aaac022)) +* openssl: update -starttls completions (#403) ([28df326](https://www.github.com/scop/bash-completion/commit/28df3269a994a33ccb8a7946a960ba26a97b6790)) +* : replace various conditional expressions with arithmetic evaluation ([2ad992a](https://www.github.com/scop/bash-completion/commit/2ad992a1bca79e0a9353afc32cbb59749f2f07c0)) +* bash_completion, invoke-rc.d, svcadm: trivial cleanups ([69a835a](https://www.github.com/scop/bash-completion/commit/69a835a335c8ecea7c8f0453097ab909838eef08)) +* : enable and address shellcheck SC2053 ([333d590](https://www.github.com/scop/bash-completion/commit/333d5908887e5133916b5987ce67ba65b6a5b343)) +* ssh-keygen: -s and -n completion improvements ([6666ebb](https://www.github.com/scop/bash-completion/commit/6666ebbb0d9934fd999937c10028f51295be5d28)) +* : array subscript cleanups ([13b5a4b](https://www.github.com/scop/bash-completion/commit/13b5a4bea8bae0d67d9286ef1d732c5dad1de685)) +* doc: recommend arithmetic evaluation ([5e5c83b](https://www.github.com/scop/bash-completion/commit/5e5c83b13808b2c29c0264284042998e4cc0816e)) +* test: remove shellcheck severity filter, add explicit disables instead ([fd19ea0](https://www.github.com/scop/bash-completion/commit/fd19ea00db362d9a33a6d4edd0d626b3da26a69c)) +* test: enable parallel pre-commit shellcheck ([48ab77e](https://www.github.com/scop/bash-completion/commit/48ab77e2ac5518ffbf8c6a2ce5b205da4b072c97)) +* __reassemble_comp_words_by_ref, java: address and work around shellcheck SC2102 ([dcf9f39](https://www.github.com/scop/bash-completion/commit/dcf9f3991d94804591fac1941587f04d3f19b4c0)) +* : more arithmetic evaluation cleanups, thanks to shellcheck SC2004 ([b147516](https://www.github.com/scop/bash-completion/commit/b147516b6081f451ace1e8172e6041029177536e)) +* bash_completion, java, tipc: for loop whitespace consistency tweaks ([3abbd23](https://www.github.com/scop/bash-completion/commit/3abbd23be045138a1d63ecdd27b5c0de9f5c1cd1)) +* pytest: address shellcheck SC2002 ([fe53ef2](https://www.github.com/scop/bash-completion/commit/fe53ef2ae8e3615c5a1186bfbc980f918b1d0c99)) +* wget: address shellcheck SC2116 ([091a7cd](https://www.github.com/scop/bash-completion/commit/091a7cde3deaeb7650e6972f5dda8c943cd1c120)) +* mutt: address shellchec SC2236 ([566c5f5](https://www.github.com/scop/bash-completion/commit/566c5f521d1d4cc3bdcba4b7555a4460d78aeebe)) +* scp: work around shellcheck SC1003 ([e1cbe8f](https://www.github.com/scop/bash-completion/commit/e1cbe8f6f0d097b51f9815dcf6729ac3abca526c)) +* ssh, xsltproc: address shellcheck SC2006 ([32421d1](https://www.github.com/scop/bash-completion/commit/32421d1d74a2915c227caa5c08457c0d7a9f18e6)) +* test: make at-point completion tests easier ([e9450b8](https://www.github.com/scop/bash-completion/commit/e9450b88c38921aa9dd297f56c99c055857c1952)) +* doc: add loop variable naming guideline ([a6a59e3](https://www.github.com/scop/bash-completion/commit/a6a59e32b8dd165f04409897641ba72d11d44e1d)) +* apt-cache: fix command mode handling ([c41b772](https://www.github.com/scop/bash-completion/commit/c41b772dcb4e31c8a6ee8d3052f3d2742d7a889d)) +* crontab: fix loop over already given args ([568c658](https://www.github.com/scop/bash-completion/commit/568c658c2c0ac6097f5332d4bfe23a9cf7b4de37)) +* : various loop iteration improvements ([911a432](https://www.github.com/scop/bash-completion/commit/911a4322cdc8eb393921b2a52efbab4e394e67e2)) +* : remove some unused variables, thanks to shellcheck SC2034 ([95f3bec](https://www.github.com/scop/bash-completion/commit/95f3bec3ba948fdb4f26673e008e4bfa990b96a0)) +* test: add perlcritic to pre-commit, run on all perl ([dd890cd](https://www.github.com/scop/bash-completion/commit/dd890cd30ddc617a10c7ff114bef13ff6485536b)) +* test: run pre-commit on host instead of docker ([b8c2a95](https://www.github.com/scop/bash-completion/commit/b8c2a95c5ed41088cd94d6ece044f37b941d8a2f)) +* make: add bmake alias ([6b42551](https://www.github.com/scop/bash-completion/commit/6b42551fa0166508b1ef6c28751ccdf5c7c49f32)) +* test/make: mark more cases as requiring command ([6354520](https://www.github.com/scop/bash-completion/commit/63545202952c970146eced87ae156f023f7306e4)) +* test: run lint tests on Travis in a quickish separate first stage ([e493f6a](https://www.github.com/scop/bash-completion/commit/e493f6a2f2ea596f373c9f31e91f44633f6f2d4a)) +* test: add script to maintain list of executables for full test coverage ([e0b9397](https://www.github.com/scop/bash-completion/commit/e0b93973acdc6f3938ecc1103971a8a0d18bf5ad)) +* extra: trigger docker builds only on test-cmd-list.txt changes ([85f3c73](https://www.github.com/scop/bash-completion/commit/85f3c737d97e5f420885d9b875de73d56035c78a)) +* find: fix -exec etc argument and its completion ([3e849c2](https://www.github.com/scop/bash-completion/commit/3e849c25ef9a2a2dc95c713085898a9547a70e18)) +* reportbug, scp, sftp, svn: use compgen -c instead of _command ([e73535f](https://www.github.com/scop/bash-completion/commit/e73535f72e0190c953211625dd71d73cfb2fa7e6)) +* _command: improve commentary ([2cf6b67](https://www.github.com/scop/bash-completion/commit/2cf6b670323ad0e914c5bed13122d2ee0cf07821)) +* ssh-keygen: option and arg completion updates for new versions ([edc4f9b](https://www.github.com/scop/bash-completion/commit/edc4f9b0390ae07c572a3186bdb9741a5be321de)) +* ssh-keygen: add -b arg completions according to specified -t ([69b477b](https://www.github.com/scop/bash-completion/commit/69b477bada9672fa5ec9079f42758a866e874180)) +* ssh-keygen: -O arg updates and improvements ([63e04ee](https://www.github.com/scop/bash-completion/commit/63e04ee86aeee5dc33a0e5d80c5e4e28692ac937)) +* README: clarify loading automatically on demand ([f5e831b](https://www.github.com/scop/bash-completion/commit/f5e831bb789094dc0293e61727b0319bb5714909)) +* pre-commit, *.md: add markdownlint, address findings ([43e958a](https://www.github.com/scop/bash-completion/commit/43e958a6db294367451190624a73e5f532fb6174)) +* : doc and comment link updates ([a234784](https://www.github.com/scop/bash-completion/commit/a234784b39e657be671f292c384395ed2fd64a75)) +* pre-commit: use local perlcritic hook ([a277345](https://www.github.com/scop/bash-completion/commit/a277345460a38206837e5e98380b30c39be89734)) +* editorconfig: apply yaml settings to .yaml too ([7af92f5](https://www.github.com/scop/bash-completion/commit/7af92f506c60c32eb95d4625e542e4e67d77eee9)) +* test: add note about unescaped assert_complete single return values ([663ac51](https://www.github.com/scop/bash-completion/commit/663ac5175fd46b790beff1ac5952551b0e211f90)) +* test: port most umount test cases to pytest+pexpect ([b621591](https://www.github.com/scop/bash-completion/commit/b6215914784096189db0ef4fd9d580a249a19675)) +* Source user completion only if it's a file (#409) ([78bf738](https://www.github.com/scop/bash-completion/commit/78bf738eb082f67080ec26b64444fd9116907743)) +* test: prefix fake test commands with underscore ([5351161](https://www.github.com/scop/bash-completion/commit/53511617f0ab972d0b6912990ebf0adc3eeffe9d)) +* nmap: simplify help scraping a bit, don't try to emit unnecessary newlines ([8db05b4](https://www.github.com/scop/bash-completion/commit/8db05b4d1c6de665a76c330b484279dc279dff27)) +* test: upgrade markdownlint to 0.23.0 ([5520dd4](https://www.github.com/scop/bash-completion/commit/5520dd4a20a7e849d24cf239a63a876e48dabc1b)) +* test: fix incorrect fixtures/shared/default xfails/expectations ([f0fe52c](https://www.github.com/scop/bash-completion/commit/f0fe52c923a5becc0556798ea892d2710aa9500c)) +* pre-commit etc: add shfmt ([08db11f](https://www.github.com/scop/bash-completion/commit/08db11f12a04516622948bb6c1ff8cc50001fb3a)) +* : run all shell code through shfmt -s ([dbe0ec8](https://www.github.com/scop/bash-completion/commit/dbe0ec8c1a8a36752d3b63b685add075f36ba113)) +* travis: use golang 1.14 for shfmt ([d34719a](https://www.github.com/scop/bash-completion/commit/d34719aa79f80578fe4be11ac859f348ae62ed02)) +* apt-get: complete build-dep with dirs ([e7ea033](https://www.github.com/scop/bash-completion/commit/e7ea033f1075a99898b4ef8c3a364bb7ba23ef62)) +* secret-tool: new completion ([e9a556f](https://www.github.com/scop/bash-completion/commit/e9a556f4a233250c6f05dfd0c5e9ae17a0ffd747)) +* test/umount: convert remaining test case to pytest+pexpect ([4514d3e](https://www.github.com/scop/bash-completion/commit/4514d3e7ef774c4bdfc4fe3f9acdf66def16c664)) +* test/scp: port remaining test case to pytest+pexpect ([12de472](https://www.github.com/scop/bash-completion/commit/12de47263b5a49ae8adab7fb1c85d3a2f42852e5)) +* test/secret-tool: add to test command list ([25c1c76](https://www.github.com/scop/bash-completion/commit/25c1c76030107cf918015856299f899bfa251e80)) +* test/slapt-get: convert remaining test case to pytest+pexpect ([033f548](https://www.github.com/scop/bash-completion/commit/033f5488bdec49f635b6e0ef13784698cdf8d190)) +* apt-cache: avoid nonzero exit code from _apt_cache_packages ([ea97386](https://www.github.com/scop/bash-completion/commit/ea973866fdbb4f8f72d4e87d090950795ef68a49)) +* _xfunc: simplify ([c0f6a6d](https://www.github.com/scop/bash-completion/commit/c0f6a6d09c88a23441a46c351eff25f23e64b528)) +* test/slapt-src: convert remaining test case to pytest+pexpect ([62b3dc6](https://www.github.com/scop/bash-completion/commit/62b3dc6dc2024eb2101bddcd468552d485c60a8c)) +* test: drop some no longer needed old test suite code ([2612750](https://www.github.com/scop/bash-completion/commit/2612750d2527865f432218770ccaa0e3dd398f71)) +* lftp: use "bookmark list" command to list bookmarks ([c198a94](https://www.github.com/scop/bash-completion/commit/c198a94029aa33cfbd4bd0586e1674859337c35c)) +* test: run pytest --verbose in docker ([ea0236e](https://www.github.com/scop/bash-completion/commit/ea0236e1e6b6ad2f0ffc402e4a1d4da6365014a3)) +* test/_get_comp_words_by_ref: convert remaining test cases to pytest+pexpect ([322420d](https://www.github.com/scop/bash-completion/commit/322420d50b894e786226987c40c6d559313058f9)) +* test/__expand_tilde_by_ref: port remaining test cases to pytest+pexpect ([d258b3c](https://www.github.com/scop/bash-completion/commit/d258b3ca8ab65fec4dfc6a14c4697212e09ad69c)) +* test/_filedir: port more test cases to pytest+pexpect ([54c732a](https://www.github.com/scop/bash-completion/commit/54c732a82066e1595d8dd153e992987ea87b54b6)) +* test: drop not needed sudo on Travis ([a9822bc](https://www.github.com/scop/bash-completion/commit/a9822bc79b997cfb985b1d8c91f9c3402adce232)) +* test: run all Travis jobs on dist: bionic ([9c0a307](https://www.github.com/scop/bash-completion/commit/9c0a30729ce5dd9954ad32dd226021b733b94abd)) +* test/_filedir: port remaining test cases to pytest+pexpect ([fb7fb46](https://www.github.com/scop/bash-completion/commit/fb7fb461362fd99cf21de40821793c8a38bf6c56)) +* test: drop some no longer needed old test suite code ([4543212](https://www.github.com/scop/bash-completion/commit/4543212a52e9d569017013e1365e9d969683fb49)) +* test/_expand: port remaining test cases to pytest+pexpect ([db481c6](https://www.github.com/scop/bash-completion/commit/db481c67fd8ea17036bd432c7e41dbe578a274e4)) +* test/_filedir: fix shutil.rmtree on Python < 3.6 ([febf177](https://www.github.com/scop/bash-completion/commit/febf177e84162199394f71704cbcf58ce1dbefd3)) +* test: replace some echos with printfs ([bcdf00c](https://www.github.com/scop/bash-completion/commit/bcdf00ce3cec4e6f43521d6d24d75e4574f59b66)) +* test/_get_cword: port remaining test case to pytest+pexpect ([80ac63e](https://www.github.com/scop/bash-completion/commit/80ac63efbb3b4677514b900ba936d7af2d2c8eb9)) +* test/_known_hosts_real: port more test cases to pytest+pexpect ([5c7bb2d](https://www.github.com/scop/bash-completion/commit/5c7bb2d72c03ad28f700e82b8ca1aeaa4528fedd)) +* test: remove more no longer needed old test suite code ([b1a4de9](https://www.github.com/scop/bash-completion/commit/b1a4de9aee916b622889c28a61812092c4d76b9b)) +* test/_known_hosts_real: port remaining test cases to pytest+pexpect ([21d4fba](https://www.github.com/scop/bash-completion/commit/21d4fba9d75860454bc0c869f63d66c6cd66bca6)) +* test: remove old test suite code no longer used \o/ ([5afc3b5](https://www.github.com/scop/bash-completion/commit/5afc3b558f7651a4a0854fdd9ac0a4580876fd33)) +* test: remove unused run-shellcheck, shellcheck is in pre-commit now ([76aa130](https://www.github.com/scop/bash-completion/commit/76aa130483d6da9761715b89ce750eebed3a95b0)) +* test: shfmt bashrc ([ead40fa](https://www.github.com/scop/bash-completion/commit/ead40fab3e8e09833b632a6c1c0b828b92ae4ecb)) +* test: sync shfmt and shellcheck configs ([c21e0e1](https://www.github.com/scop/bash-completion/commit/c21e0e11025fa2117417d5ddcbe65a7edd116fe3)) +* test: upgrade pre-commit to 2.4.0+, drop shfmt kludge ([8af206f](https://www.github.com/scop/bash-completion/commit/8af206f45ad801c47e9e79060a0fbad033cd1d89)) +* test: pre-commit config cleanups, ordering ([b4eadfd](https://www.github.com/scop/bash-completion/commit/b4eadfd4b401f15acaab714c363cb0a7ee7bcf8c)) +* test: upgrade flake8 to 3.8.1 ([1f27374](https://www.github.com/scop/bash-completion/commit/1f27374d45e7062e6a74a0046bba289eda02f75a)) +* test/irb: xfail options test if --help is not available ([f5ea515](https://www.github.com/scop/bash-completion/commit/f5ea515f07ec2cbbbc63262d1f053327a9d466ae)) +* : use $ifs for storing/restoring $IFS ([acc43ed](https://www.github.com/scop/bash-completion/commit/acc43edf81c7eaf8b3556453a7cfc4b0104975cd)) +* test: try harder to restore environment and cwd on failures ([f0bf00a](https://www.github.com/scop/bash-completion/commit/f0bf00a53677285600cdf8d82e754abb7f0e0644)) +* : use more arithmetic evaluation ([328ce5b](https://www.github.com/scop/bash-completion/commit/328ce5be5b4b8822b3b9421dab4460c56990df0b)) +* test: upgrade markdownlint-cli to 0.23.1 ([2255f2a](https://www.github.com/scop/bash-completion/commit/2255f2a8577cf7d48b5572d84a6900d9ffdef75e)) +* dpkg-deb: fix --show/-W completion ([2eee0b5](https://www.github.com/scop/bash-completion/commit/2eee0b5063ae3fd8d48594bc03d2f5a9e4678ce5)) +* test: add some dpkg-query test cases ([034bdee](https://www.github.com/scop/bash-completion/commit/034bdeec06f36c12d3cbf927ca293eee321817f0)) +* dpkg-deb: add --raw-extract and -X arg completions ([69198c0](https://www.github.com/scop/bash-completion/commit/69198c0c4ef9830de1ea25d0b5c713adef8b5987)) +* test: mark known non-ASCII issues with test suite as xfail ([106e825](https://www.github.com/scop/bash-completion/commit/106e825a7f3b07c6c4d59f0b9c4e66bfa48a870f)) +* test/mr: handle missing "clean" with skipif ([eb93dde](https://www.github.com/scop/bash-completion/commit/eb93dde7304ee62e20d54cba003639b46bd18119)) +* mr: avoid herestrings, simplify command parsing ([cf64492](https://www.github.com/scop/bash-completion/commit/cf6449226350987f8d0d3ff3d329ca31c19cbcac)) +* _bashcomp_try_faketty: new function to try running command with a fake tty ([3829fe9](https://www.github.com/scop/bash-completion/commit/3829fe95d6583cc9eebc1abae1e553dedacd8cd5)) +* postfix: try to arrange a fake tty so we can tickle the usage message out ([7aea619](https://www.github.com/scop/bash-completion/commit/7aea619b1b4563f6a5a55877aeeea009e71cfd87)) +* 7z: fix -o/-w attached arg completion ([54774d6](https://www.github.com/scop/bash-completion/commit/54774d610323daff29e4cd00d5bcce23b714513f)) +* __reassemble_comp_words_by_ref: avoid triggering nounset on indirect references ([0b0323c](https://www.github.com/scop/bash-completion/commit/0b0323c514276c0143568b9e03646b65ee57e788)) +* bash_completion: line wrapping tweaks, NFC ([1d1d308](https://www.github.com/scop/bash-completion/commit/1d1d308d1f15e3ab2794c14ed54206cc56b96655)) +* test/unit: include test_unit_known_hosts_real.py in dist ([fdc9fc9](https://www.github.com/scop/bash-completion/commit/fdc9fc9b231c084c6e8de32587ec6a746898ce39)) +* test/unit: sort files included in dist ([d8f309f](https://www.github.com/scop/bash-completion/commit/d8f309f9fa8cb57067c6ef559269ea1eb3f9d98a)) +* : avoid more errors in nounset mode ([3687d27](https://www.github.com/scop/bash-completion/commit/3687d27f1ac266fa784dacc4492f0c554ed3091c)) +* test/inputrc: comment and whitespace tweaks ([1293d7c](https://www.github.com/scop/bash-completion/commit/1293d7c7258ef93c131e0e0d546064593610e731)) +* : avoid more errors in nounset mode ([b807460](https://www.github.com/scop/bash-completion/commit/b807460140aa6dda09eb2af2ecf3afa1971c84c4)) +* : avoid more errors in nounset mode ([d0a0eb5](https://www.github.com/scop/bash-completion/commit/d0a0eb5979d2831174b50e541d97559ac30d7d73)) +* : avoid more errors in nounset mode ([505fb2c](https://www.github.com/scop/bash-completion/commit/505fb2c68e38c9071542ff30fbafdab7ddc6f363)) +* : mark nounset mode as supported, issues with it are bugs now ([e85a361](https://www.github.com/scop/bash-completion/commit/e85a361199f02f3818312ba149dc64bf2c920d7a)) +* test: skip various tests if we don't get a useful usage message ([6f12de6](https://www.github.com/scop/bash-completion/commit/6f12de60230b85fbdd004c69be23be1bc9798767)) +* test/runLint: warn about [ ] instead of [[ ]] use ([f6f49db](https://www.github.com/scop/bash-completion/commit/f6f49db9175eb1ee5521bcb59ac6747bebaf1f28)) +* modprobe, tshark, _included_ssh_config_files: use [[ ]] instead of [ ] ([50ad3f8](https://www.github.com/scop/bash-completion/commit/50ad3f8d91a2782b5d10dc177e98f2ec06171e20)) +* scp, sftp, ssh: fix completion on options bundled with -4/-6 ([b4490f2](https://www.github.com/scop/bash-completion/commit/b4490f238ed534ce9084614a3580656e4cf759f6)) +* _pids, _pgids, _pnames: improve shfmt formatting ([2bfb0a7](https://www.github.com/scop/bash-completion/commit/2bfb0a7e22ca94624e13df5876fe80acc7017f1b)) +* _filedir: avoid unbound variable error on Ubuntu 14 and 16 ([ac37d77](https://www.github.com/scop/bash-completion/commit/ac37d77db99425aaa9d71fe9215e98623378a4b1)) +* ip: add more completions for ip-rule ([426d07e](https://www.github.com/scop/bash-completion/commit/426d07e33ce5379ce4fc7726c140ca3b8c7c7575)) +* ip: style fixes similar to ip-netns ([75093c0](https://www.github.com/scop/bash-completion/commit/75093c018a5dee8db1d7a97f42b0cc2c0902ef3e)) +* ip: route shfmt, arithmetic evaluation ([a1fe69a](https://www.github.com/scop/bash-completion/commit/a1fe69adf7d476984a3498e8c1616d84e9b694f1)) +* ip: complete route add table arg ([e4ad602](https://www.github.com/scop/bash-completion/commit/e4ad602f483f3574fd8630bfcd82bd88ef6def28)) +* _init_completion: fix unassigned redirect completion in nounset mode ([2e52b40](https://www.github.com/scop/bash-completion/commit/2e52b40d5087c55798c7bf006654aafd98e5deab)) +* : drop support for bash 4.1 ([e2d47ae](https://www.github.com/scop/bash-completion/commit/e2d47aea537ed18892ba485b2acba470ad79301a)) +* test: enable shellcheck SC2035 ([77a3505](https://www.github.com/scop/bash-completion/commit/77a35054a335323014f8d63879c0017ff200f9c9)) +* qemu, sbopkg: avoid unintentional globbing on option arg completions ([7dc4f61](https://www.github.com/scop/bash-completion/commit/7dc4f61dc0ebdbf45d64195ab9a8cb97768e455a)) +* qemu: add -machine arg completion ([11cd174](https://www.github.com/scop/bash-completion/commit/11cd1746d94a98fe12bd989a168204e03583bf78)) +* : avoid more errors in nounset mode ([5103c5d](https://www.github.com/scop/bash-completion/commit/5103c5dc3e236e3fa4e0e5a9048ada6ea99a9c76)) +* _command_offset, route: cleanups ([9994be6](https://www.github.com/scop/bash-completion/commit/9994be6476247261cb8d3e1befcce4af72a136b0)) +* cfrun: fix $hostfile leak ([68b5719](https://www.github.com/scop/bash-completion/commit/68b5719bbc2db1e71f76d843b4b6df41e671952b)) +* : avoid more errors in nounset mode ([f4fa0b6](https://www.github.com/scop/bash-completion/commit/f4fa0b6d0ca079e350c8a98ddaeaa4d932fb21ef)) +* bash_completion: fix array set checks with empty elements in them ([efaa991](https://www.github.com/scop/bash-completion/commit/efaa991d385e28eeb21490b3a91fd903e4f90b30)) +* _known_hosts: avoid errors in nounset mode and no arguments ([36475fc](https://www.github.com/scop/bash-completion/commit/36475fc6762edca0d52a4817aba53f7c2431b9a7)) +* pytest: add test class method completion ([ba4c941](https://www.github.com/scop/bash-completion/commit/ba4c941faa1ff5eb63e7984a6a52a7b703e2887f)) +* README: document GNU make build requirement ([3423e14](https://www.github.com/scop/bash-completion/commit/3423e14fb0e891a7d2764233eccd3cbecc983e22)) +* java, make: avoid errors in nounset mode on Ubuntu 14 and 16 ([1a633f3](https://www.github.com/scop/bash-completion/commit/1a633f3a551154ac3c70bfdc5263d73d8b3d9f3f)) +* man, mutt: avoid errors in nounset mode on Ubuntu 14 and 16 ([e5fa022](https://www.github.com/scop/bash-completion/commit/e5fa0221578dce638a84107f0ee813be89bbe3bd)) +* pytest: fix test class method completion with BSD awk ([3374911](https://www.github.com/scop/bash-completion/commit/337491161b1278a30d3f0aaf4a7cd2508ea809f5)) +* gcc: avoid errors in nounset mode ([221a6aa](https://www.github.com/scop/bash-completion/commit/221a6aa9b18bb8afe11435ee2244589bbaac0ff4)) +* bash_completion: trivial cleanups ([817d832](https://www.github.com/scop/bash-completion/commit/817d832fb7ac49eceda6ed3c21428dcc4659fa48)) +* test/_known_hosts_real: tolerate duplicates ([0b2866a](https://www.github.com/scop/bash-completion/commit/0b2866a9fe32ee24df242e200896125c7ecf65ad)) +* test/_known_hosts_real: reset COMP_KNOWN_HOSTS_WITH_HOSTFILE between tests ([5e63557](https://www.github.com/scop/bash-completion/commit/5e63557aac12251538091dc40bf587842327ced5)) +* test/_known_hosts_real: don't modify class scoped base expected list ([133790c](https://www.github.com/scop/bash-completion/commit/133790c464c68fa728b2957a66ee1fa012181a88)) +* test: upgrade mypy to 0.780 ([2e7271b](https://www.github.com/scop/bash-completion/commit/2e7271b3aed635a7fead1b97517673092eba5923)) +* test: regex escape our magic mark for completeness ([588b05c](https://www.github.com/scop/bash-completion/commit/588b05c1bf74feadad61bd1d1b39e752e639c201)) +* test/lspci: skip -A arg test if lspci fails -A help, e.g. busybox lspci ([e2cb804](https://www.github.com/scop/bash-completion/commit/e2cb80403d32af436a93782de4f33aee8352dd2b)) +* .gitignore: clean up some no longer needed ignores ([df7b81e](https://www.github.com/scop/bash-completion/commit/df7b81ea93d799affa858f26749f6aba8f0c1a38)) +* test/dpkg-query: mark as xfail on non-Debian based systems ([d176aaf](https://www.github.com/scop/bash-completion/commit/d176aafc18cb15a90c6c1d89918884d03382b20d)) +* test: simplify completion parsing ([726e4c0](https://www.github.com/scop/bash-completion/commit/726e4c08a96b1f0be1c931179f1b3edb31913917)) +* test: partial hostname completion fixes ([ba39695](https://www.github.com/scop/bash-completion/commit/ba39695792410c88f9d8e2303288274e2959cef7)) +* test/slapt-src: single expected result handling fixes ([1b9c9bc](https://www.github.com/scop/bash-completion/commit/1b9c9bcc285c296aa2c6df3e75ad75537080947e)) +* test/xhost: multiple expected result handling fixes ([888f39a](https://www.github.com/scop/bash-completion/commit/888f39a84a1847333c9e8bc06806886cd95eb103)) +* test: upgrade flake8 to 3.8.3 ([4730f3f](https://www.github.com/scop/bash-completion/commit/4730f3fcb0c0cefafc29cad7b0aed81ecd1decca)) +* _known_hosts_real: fix # handling in ssh configs ([ebabed1](https://www.github.com/scop/bash-completion/commit/ebabed1a4ca28f6e56a02831fee0e33f15047119)) +* _known_hosts_real: fix completion of Host entries after a wildcard etc ([0c69125](https://www.github.com/scop/bash-completion/commit/0c69125d65faaa60b0829db58c88dc33366bb67c)) +* test: upgrade perltidy to 20200619 ([87b169d](https://www.github.com/scop/bash-completion/commit/87b169dcf3b95d071280d70b3fc2fb0d8306c9e1)) +* test: upgrade mypy to 0.781 ([d46e8a5](https://www.github.com/scop/bash-completion/commit/d46e8a58e7840c0a8a5e942eb987479c69a0272a)) +* CONTRIBUTING.md: add posix and nounset mode item ([25887a3](https://www.github.com/scop/bash-completion/commit/25887a38ba3b81e9a6791ade89f5fa1a7c7ea5d3)) +* test: upgrade mypy to 0.782 ([f7c14b5](https://www.github.com/scop/bash-completion/commit/f7c14b5579b7bde9b57ae9bb175be7cba916edd9)) +* test/_known_hosts_real: add explicit no globbing test case ([8200b9a](https://www.github.com/scop/bash-completion/commit/8200b9a9529316f1f467aea18aaed2cbf4776bf0)) +* test/shfmt: upgrade to 3.1.2, reformat with it ([de35c91](https://www.github.com/scop/bash-completion/commit/de35c91dd3fe6c6c1adaeeb7e1a96f6a8360b0eb)) +* _known_hosts_real: prevent unwanted pathname expansion on host entries ([29be9d2](https://www.github.com/scop/bash-completion/commit/29be9d2e6bea356f16f12bfa7ad647b3ed67839e)) +* _included_ssh_config_files: support globs ([8bd47d4](https://www.github.com/scop/bash-completion/commit/8bd47d4ee25642b5fcddefb825d5025721840673)) +* _longopt: exclude too many dashes, allow underscores, require ends with alnum ([e2bcbd5](https://www.github.com/scop/bash-completion/commit/e2bcbd5115868bcfc048da1ce1b6b10f76762bf1)) +* _known_hosts_real: avoid errors in nounset mode on Ubuntu 14 and 16 ([54fd092](https://www.github.com/scop/bash-completion/commit/54fd092139e05c8fa01b3256b6c717ef3cdb9fb6)) +* test: upgrade markdownlint-cli to 0.23.2 ([95992bf](https://www.github.com/scop/bash-completion/commit/95992bfeee3c0409991fe45e89c1d08cd2eb4401)) +* __get_cword_at_cursor_by_ref: fix regression on bash 4.2 ([2ed8d90](https://www.github.com/scop/bash-completion/commit/2ed8d90b51e3ca6a337a15086f47c7dc982891a4)) +* pytest: complete async test class methods ([5c4f7a4](https://www.github.com/scop/bash-completion/commit/5c4f7a42d9864dcf91de845ea8167aad9cd3bdfc)) +* test/inputrc: comment typo fix ([0d2367b](https://www.github.com/scop/bash-completion/commit/0d2367bd46b722a23e7b83e8bc828342ba857fa5)) +* test/inputrc: do not set print-completions-horizontally ([d050205](https://www.github.com/scop/bash-completion/commit/d05020538be21f4b41a2f129c8f4eab83c077f40)) +* unzip, zipinfo: complete *.aar (#428) ([8273ce3](https://www.github.com/scop/bash-completion/commit/8273ce3138708ad1db851b74eafba38d6683ca0a)) +* pre-commit: update shellcheck-py URL ([08451ec](https://www.github.com/scop/bash-completion/commit/08451ec8383bb309d945589cab7d8c74a347a8b7)) +* pre-commit: upgrade isort to 5.0.7 ([d128d70](https://www.github.com/scop/bash-completion/commit/d128d70b1baef5a93f376fd44f18c7824d4643f3)) +* _known_hosts_real: exclude Host negations ([812e2ac](https://www.github.com/scop/bash-completion/commit/812e2acec01689b7c20488e2e11d335efd25ce9a)) +* test/ant: gitignore all target cache files ([6703c90](https://www.github.com/scop/bash-completion/commit/6703c9035b7a1639a1eded9989ede80848539078)) +* pre-commit: add pyupgrade, run it ([54b1e6f](https://www.github.com/scop/bash-completion/commit/54b1e6f70decfb8b8a5b15a1d14279e52551edf2)) +* pre-commit: upgrade pyupgrade to 2.7.2 ([5ac90cc](https://www.github.com/scop/bash-completion/commit/5ac90cc4eb6330d0a1999e598e6873d7dc545b77)) +* pre-commit: upgrade isort to 5.1.4 ([c2f0056](https://www.github.com/scop/bash-completion/commit/c2f0056c8edc35fc53f40a9b4d53d48e40f6676f)) +* _xinetd_services: avoid nounset error on bash 4.2 ([0df93b0](https://www.github.com/scop/bash-completion/commit/0df93b02d355b2faaad0d25d20d45967b82edd63)) +* test/ant: avoid complete-ant-cmd.pl interference with ANT_ARGS ([2ad91ec](https://www.github.com/scop/bash-completion/commit/2ad91ec985dc1fbc57d27f7b9815c7d0797426e8)) +* test/tshark: fix multiple -O completion with no http2 support ([53f624f](https://www.github.com/scop/bash-completion/commit/53f624f8212497c116afd4a365768237ac4069bb)) +* test/xfreerdp: skip --help failure cases ([b41b97c](https://www.github.com/scop/bash-completion/commit/b41b97cd2c646e813317429edbb8285c09cfd0b7)) +* tshark: complete -r arg with all filenames (#422) ([436b0cb](https://www.github.com/scop/bash-completion/commit/436b0cbe9e0839a51edcc7948e4ca11f2444a238)) +* pytest: rewrite in bash, support toplevel funcs, avoid nondef ones and classes ([bf3f720](https://www.github.com/scop/bash-completion/commit/bf3f72046f62ea86f43b65389d6d706a28544adb)) +* pre-commit: anchor exclude patterns ([cc697a6](https://www.github.com/scop/bash-completion/commit/cc697a646c1bd1100890abd367bb8d0274a42275)) +* extra/make-changelog: check and output usage message ([cf90b29](https://www.github.com/scop/bash-completion/commit/cf90b297696cee57650f4fb6c29cebe872f773a7)) + +## 2.10 (2019-12-05) + +* README: link to cygwin package ([8d60fd3](https://www.github.com/scop/bash-completion/commit/8d60fd32be777e4c6e734c1dac431b39b53fb216)) +* README: use light gray badges for unknown versions ([483968c](https://www.github.com/scop/bash-completion/commit/483968cd513142b71d1e6e9f199d5eaf958eb616)) +* test_rpm2tgz: Fix expected output ([ac51b00](https://www.github.com/scop/bash-completion/commit/ac51b00358ebe510f4899db9678480a6c6a4eda1)) +* test_chromium_browser: Skip test_2 if 'chromium-browser --help' fails ([0ee3982](https://www.github.com/scop/bash-completion/commit/0ee39821c67735fd16b5372cd4044775af1d1243)) +* tar: add missing bsdtar, gtar, and star symlinks ([af0b3d0](https://www.github.com/scop/bash-completion/commit/af0b3d0130f61a7d7960dd8eee99529fea6e39a2)) +* build: simplify symlink setup ([3bc0225](https://www.github.com/scop/bash-completion/commit/3bc0225ee28abc81800042c168b0721f5c68c49f)) +* build: really reset return value before completions check ([fce6732](https://www.github.com/scop/bash-completion/commit/fce673275bf2a024f91bb455e5353e02f3690cf8)) +* build: makefile whitespace tweaks ([a0949de](https://www.github.com/scop/bash-completion/commit/a0949de0f9988d3460b11820b97d6e4baab48cd3)) +* test: bashrc comment and whitespace tweaks ([27daf01](https://www.github.com/scop/bash-completion/commit/27daf018539500cad68e488cc81caf064e65075c)) +* test: more thorough system location interference avoidance ([7700896](https://www.github.com/scop/bash-completion/commit/77008960c7a402e96c24a5c9eab7d88ebc735896)) +* test: set up BASH_COMPLETION_COMPAT_DIR in bashrc (only) ([f7e2a41](https://www.github.com/scop/bash-completion/commit/f7e2a4192e6e2980859da1a64816fab75aa11b09)) +* test: reformat test_chromium_browser.py source ([7bf6281](https://www.github.com/scop/bash-completion/commit/7bf6281a47ce2fda45f8b7fec48e53e19e0f640d)) +* pkg_delete: don't limit to FreeBSD ([5bc9b8e](https://www.github.com/scop/bash-completion/commit/5bc9b8eb51ccc41f78af0e108503de5edc87f101)) +* tar: simplify locating tarball from command line ([26d9662](https://www.github.com/scop/bash-completion/commit/26d966207a2e4cef02a70d790f44812c1284d160)) +* test_arp: Skip if ARP tables are empty ([90ede98](https://www.github.com/scop/bash-completion/commit/90ede989622143dc93c9a05a18bc23767c4bff9c)) +* test: generalize check whether we're being run in a container ([1e3d3b4](https://www.github.com/scop/bash-completion/commit/1e3d3b4d40e3f6c150b9d31965f8b007ef823fc7)) +* test_feh, test_makepkg: invoke grep as "command grep" ([5e706a4](https://www.github.com/scop/bash-completion/commit/5e706a433440af4fad630d1b362f7e75578cbcdb)) +* test_getconf: skip if -a doesn't output any POSIX_V* ([70afc1e](https://www.github.com/scop/bash-completion/commit/70afc1ed3697c3171a004b7db2f19220117d2862)) +* test_iconv: skip option completion if --help fails ([2cdac1b](https://www.github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393)) +* test_iconv: add basic file completion test ([0ba7af2](https://www.github.com/scop/bash-completion/commit/0ba7af221b3ec3ec7b1efecd3c8458068f1934b3)) +* iconv: weed out ... from encoding completions ([40be1f4](https://www.github.com/scop/bash-completion/commit/40be1f491bfbeec50787cbe6bd2c6a794b19ef46)) +* test: add Alpine Linux container, allow failures for now ([316289f](https://www.github.com/scop/bash-completion/commit/316289fb0837676f310925748070e1e1e87de750)) +* test: support xfail in our markers like skipif, use it a lot ([b3fecab](https://www.github.com/scop/bash-completion/commit/b3fecab48c22c07015a6fef7a00d4cb0ea1b74f3)) +* test: expect failures for various completions without useful --help ([0a777ff](https://www.github.com/scop/bash-completion/commit/0a777ff73bf5ddbd5de92f2bf1e3f8429e471f72)) +* test_lsusb: xfail with unparseable --help ([e717ce4](https://www.github.com/scop/bash-completion/commit/e717ce4503ab646055cd6b88d4087c162a529137)) +* test_wget: test --s instead of --h ([ddd4b39](https://www.github.com/scop/bash-completion/commit/ddd4b396b9a29c25715f6b2b768737b0b015c6c9)) +* timeout: fallback to _parse_usage from _parse_help ([7683eef](https://www.github.com/scop/bash-completion/commit/7683eefe974d7c508c7a7c3e2aa8f318f30c2699)) +* test_ifup: accept short option completions too ([071dc19](https://www.github.com/scop/bash-completion/commit/071dc199c1413146d485ee28bfa6c9a189c3681b)) +* test: use one Dockerfile for all dists ([495dab2](https://www.github.com/scop/bash-completion/commit/495dab2d80001aeabfe6136bd046a0231ff5d115)) +* test: run our docker script in test containers by default ([a59f00a](https://www.github.com/scop/bash-completion/commit/a59f00aeb2efa0decb3767e99c2445890a340d35)) +* _pnames: adapt for busybox ps, rewrite in pure bash ([5443c81](https://www.github.com/scop/bash-completion/commit/5443c819622495fcdc759d5dd4e5c31633eab389)) +* test: disallow Alpine failure on Travis ([2748b79](https://www.github.com/scop/bash-completion/commit/2748b79d678db1d06dac733b0ddc5a51a77cef1e)) +* iconv, lz4, tipc, xsltproc: replace some seds with compgen -X ([32e8b93](https://www.github.com/scop/bash-completion/commit/32e8b934c4bb3089b9a2b6e1677e7c014509f734)) +* test: port compgen and quote tests to pytest+pexpect ([3752208](https://www.github.com/scop/bash-completion/commit/37522086868ae6da2e3630b24056b443ba9706e0)) +* test: port _variables unit tests to pytest+pexpect ([b670968](https://www.github.com/scop/bash-completion/commit/b670968232cbc91e494658b2b06330693ee42939)) +* README: add some badges, tweak existing ([cd9f061](https://www.github.com/scop/bash-completion/commit/cd9f0616567eee91eb971575baabcb8d97f3780e)) +* test: convert finger partial test case to pytest+pexpect ([f3537dd](https://www.github.com/scop/bash-completion/commit/f3537dd02acb7e8cc8d6150f9e38785ee75f958d)) +* test: convert bunch of _filedir unit tests to pytest+pexpect ([2da46c3](https://www.github.com/scop/bash-completion/commit/2da46c3299403d93d1754b5ee2d8903cc874d267)) +* test: flake8 fix ([65aa0db](https://www.github.com/scop/bash-completion/commit/65aa0db5142f29ebd8a7e5d1bae91ffe8b2db516)) +* test: convert more _filedir unit tests to pytest+pexpect ([102e9a4](https://www.github.com/scop/bash-completion/commit/102e9a413101c702c1f458e55d79a861e80950a9)) +* test: add basic autossh test ([06cea18](https://www.github.com/scop/bash-completion/commit/06cea18e2ff03e90d1c663614e4d90422cfce246)) +* chsh, pwck: try _parse_help before _parse_usage ([696f90d](https://www.github.com/scop/bash-completion/commit/696f90d30a5cd6769be0affc166b2003de8a44e7)) +* test: add bunch of basic _parse_usage use test cases ([dcef445](https://www.github.com/scop/bash-completion/commit/dcef445f19d6c879144c09c5e6e96108fbe7c933)) +* cal: try _parse_help before _parse_usage ([2500b50](https://www.github.com/scop/bash-completion/commit/2500b504a16cfe8fd73caa5d1d53f377d1a90f11)) +* postfix: option completion is expected to fail at the moment ([2deda5b](https://www.github.com/scop/bash-completion/commit/2deda5b49d1fe722008c3d676a4e95a551237586)) +* badblocks: fix $i leak ([e8ac021](https://www.github.com/scop/bash-completion/commit/e8ac021ed13e5b110b9e0701b29d6c9704d33461)) +* .gitignore: add configure.lineno ([44ed05a](https://www.github.com/scop/bash-completion/commit/44ed05ac88888bbc0d156e89b62e63d630e1c2fc)) +* test: add bunch of basic _parse_help use test cases ([6b4fd9b](https://www.github.com/scop/bash-completion/commit/6b4fd9b783b1fe623f7fc1e55538a626076e5a8f)) +* test: add more basic _parse_help use test cases ([c64a4ac](https://www.github.com/scop/bash-completion/commit/c64a4acd6637f0718b8dabfb53f40e8a6d8b71d7)) +* test: xfail getent and pwdx option completions with unparseable --help ([ef215a6](https://www.github.com/scop/bash-completion/commit/ef215a624a3f83a0aadd02fe9ddd9da775a6aa91)) +* test: zopflipng flake8 fix ([026e52a](https://www.github.com/scop/bash-completion/commit/026e52a9b419cfb251f943be892b589b8520ff55)) +* test: enforce minimum pytest version ([69c94b9](https://www.github.com/scop/bash-completion/commit/69c94b9bf81811aba2b1b7f7bb7ade587880e95b)) +* build: make pytest executable configurable, look for pytest-3 too ([35188d9](https://www.github.com/scop/bash-completion/commit/35188d93848de125dc82c798dbcac0d6e93fb255)) +* test_pwdx: xfail more unparseable help cases ([98a7aa6](https://www.github.com/scop/bash-completion/commit/98a7aa6cfd694149a9ca3857d224fe85a4acf538)) +* test: xfail unparseable mock and munin-node-configure --help cases ([139acc9](https://www.github.com/scop/bash-completion/commit/139acc9fe3b35b000d899f54e06a7b638cc3e2e8)) +* pgrep: fix fallback to _parse_usage ([5cb4be4](https://www.github.com/scop/bash-completion/commit/5cb4be4220d649a78e85a6e772dcbe85622f9840)) +* test: don't try to install black on Python < 3.6 ([bfe14e7](https://www.github.com/scop/bash-completion/commit/bfe14e7b8e02f97d490a3b3c8087588e5318b5ee)) +* test_wsimport: xfail options test on unparseable -help ([2baab4f](https://www.github.com/scop/bash-completion/commit/2baab4f1a8ad70500cea543758aadc13cc219878)) +* man: fall back to _parse_usage for _parse_help ([2e1cb45](https://www.github.com/scop/bash-completion/commit/2e1cb45991af0e52a6be93b46264ffd45097d980)) +* test: add basic tox fixture ([a81a1e8](https://www.github.com/scop/bash-completion/commit/a81a1e80163147c1aabd9476507338dfa255b880)) +* tox: do simple parse on tox.ini if --listenvs* yields nothing ([d7c92e6](https://www.github.com/scop/bash-completion/commit/d7c92e602fc776272724c3c37a14181a4b01edf5)) +* README: badge title tweaks ([35411bf](https://www.github.com/scop/bash-completion/commit/35411bf821b66146d7dfcfc3abf4c7d7ba4a30bb)) +* influx: new completion ([378865d](https://www.github.com/scop/bash-completion/commit/378865db6e61d9a3ecfd0281b80b5d75167e792b)) +* test: source our profile.d test env script in docker ([3702ae0](https://www.github.com/scop/bash-completion/commit/3702ae08454974e8c847ef565a383384094a92b4)) +* chromium-browser: add --proxy-server arg completion ([fef4c9f](https://www.github.com/scop/bash-completion/commit/fef4c9f784f26d50af93d0b9c4f6628a91626a5b)) +* README: drop distro badges, link to Repology instead ([d2574f5](https://www.github.com/scop/bash-completion/commit/d2574f51c3cadde840a0601a561009d7a53a2ebf)) +* ip: invoke the tool as $1 ([bbe88bb](https://www.github.com/scop/bash-completion/commit/bbe88bb6b1b028adb103b9cbfafc7c7168ff0667)) +* test: fix required pytest version ([9cd7c03](https://www.github.com/scop/bash-completion/commit/9cd7c03f898559601e81e2a933d205d1ea1a51f6)) +* test: register our pytest markers to hush warnings from 4.5+ ([c187879](https://www.github.com/scop/bash-completion/commit/c18787923bc40b4ee599946deb579eab6d3fa5b2)) +* gssdp-discover: new completion ([f8fac3a](https://www.github.com/scop/bash-completion/commit/f8fac3aefd4067d039d1e088f227808259602676)) +* tox: complete defaults after a -- ([c06cfb0](https://www.github.com/scop/bash-completion/commit/c06cfb053eea2d5cbe478f5179ad5e3d824d760a)) +* tox: include -- in option completions ([0ee3a3b](https://www.github.com/scop/bash-completion/commit/0ee3a3b4db0a65a4ed6a2a07d5c259c1c398de59)) +* test: drop sourcing our no longer existing profile.d script ([ed14353](https://www.github.com/scop/bash-completion/commit/ed143530a2811d605de198a11bc699a90da645fd)) +* test: don't expect a .tox dir in fixture ([6dd937d](https://www.github.com/scop/bash-completion/commit/6dd937d3c86aa098b273002c9589f9e5ba2c5891)) +* test: expect failures for bc without --help useful with _longopt ([5fd2701](https://www.github.com/scop/bash-completion/commit/5fd2701371a491176b25fa9683481d6d143675f2)) +* test: skip gssdp-discover --message-type when option not available ([b0fb710](https://www.github.com/scop/bash-completion/commit/b0fb7101aaad984e21ce520b39e6416db261a354)) +* xvfb-run: new completion ([5c0e988](https://www.github.com/scop/bash-completion/commit/5c0e98832a1ee4e2829d47e2fb22f495ac09b641)) +* test: avoid gnome-mplayer core dump on Ubuntu 14 ([07eada3](https://www.github.com/scop/bash-completion/commit/07eada37598e19c282081102ad29d62a6e87e9f4)) +* test: remove unnecessary returns after pytest.skip ([d5fa7e3](https://www.github.com/scop/bash-completion/commit/d5fa7e31e2f88a438d224adde89e15c14e173ada)) +* test: fix acroread fixture dir ([1f7fdc6](https://www.github.com/scop/bash-completion/commit/1f7fdc67d3e015156d4622e6904a728f3717dadb)) +* test: installpkg test fixes ([322ec19](https://www.github.com/scop/bash-completion/commit/322ec19f06d4ec2ea32c861c023fb9644985150a)) +* java: make jar/zip listing work with unzip ([8b8783c](https://www.github.com/scop/bash-completion/commit/8b8783c48d58f0320fd72fa7805643a0f7615311)) +* test: use sh +* as ccache command test case ([87ba114](https://www.github.com/scop/bash-completion/commit/87ba114a2da100e4002240060a41b89fb9bbfdb5)) +* test: avoid some sed -r/-E runLint false positives ([970eab9](https://www.github.com/scop/bash-completion/commit/970eab95140451c04a11a515d9ee860154fce9d1)) +* ipv6calc: parse help instead of hardcoding option list ([151ac18](https://www.github.com/scop/bash-completion/commit/151ac18040eb27533ebca4815c6286e2d758c0f5)) +* lvm pv*, vg*: parse help instead of hardcoding option list ([a8d5489](https://www.github.com/scop/bash-completion/commit/a8d548950f6a79e14c131251091026730c2ddb49)) +* test: portinstall/upgrade test case and setup fixes ([669c3fe](https://www.github.com/scop/bash-completion/commit/669c3fe142f50d1f72c57c9639169691598622a0)) +* pkgutil: fix $i leak ([d375b63](https://www.github.com/scop/bash-completion/commit/d375b638160d9dea43528dc99054db0a0d5d4497)) +* pkg-get: fix $i leak ([07e8dc6](https://www.github.com/scop/bash-completion/commit/07e8dc6c89c81f72093ef1ff7dcd29b87016c2ee)) +* chromium-browser: Add support for .mhtml files ([a951666](https://www.github.com/scop/bash-completion/commit/a95166674def153222d46346863a456f73803877)) +* _terms: combine and simplify somewhat ([f6d4614](https://www.github.com/scop/bash-completion/commit/f6d461483ea7c6b3cc6710401cca6ba50c687ed4)) +* _terms: search directly from various terminfo dirs ([88ed3c7](https://www.github.com/scop/bash-completion/commit/88ed3c712df1b72d730496e736faba493488e892)) +* test: mark sbcl-mt xfail due to whitespace split issues ([9838cbf](https://www.github.com/scop/bash-completion/commit/9838cbfaf9e508b1ec1ad05959d89f3cf9e5d719)) +* test: explodepkg and upgradepkg test fixes ([f40a1ca](https://www.github.com/scop/bash-completion/commit/f40a1ca85658c9d7cc8366ac6766098f78b69412)) +* test: always run tests which don't require tested command ([674dd80](https://www.github.com/scop/bash-completion/commit/674dd805ba3639c7b507fd997fdf6e97708d84be)) +* test: add bunch of basic option parsing test cases ([faacf36](https://www.github.com/scop/bash-completion/commit/faacf36e3432fd740293788910ee6304e0b5a031)) +* test: don't sort expected completion lists under the hood ([1e3d504](https://www.github.com/scop/bash-completion/commit/1e3d50429d45e44d4fe65b3c7b2f37eb6e8c7b48)) +* test: hush flake8-bugbear B010 ([b6d74cc](https://www.github.com/scop/bash-completion/commit/b6d74cc99881e51e7bd9504ce55273a3f1b95def)) +* test: ignore _makepkg_bootstrap in makepkg test env ([b044a4f](https://www.github.com/scop/bash-completion/commit/b044a4f9d750410e4882e5badfa3b2f8a1145e28)) +* test: xfail MAC address completion without networking ([36db77a](https://www.github.com/scop/bash-completion/commit/36db77a14e516c4ab452ce57f83e4406852b83e3)) +* travis: pass NETWORK as env var, so we can actually use it ([0f8187d](https://www.github.com/scop/bash-completion/commit/0f8187ddc01dabc6129f7f1673e950d03d57cbfd)) +* test: fix retrieving command to test from request ([29ad382](https://www.github.com/scop/bash-completion/commit/29ad38254fa52ea159d2bc1959c80599c6b52128)) +* gprof: _parse_usage, drop hardcoded option list ([bebe43d](https://www.github.com/scop/bash-completion/commit/bebe43d6e7881d39e9c03faadf2927fa08042241)) +* lintian-info: _parse_help, add more option arg (non)completions ([29157d0](https://www.github.com/scop/bash-completion/commit/29157d07aafac3938fb26e93c542288d027eca9a)) +* screen, smartctl, update-alternatives: _parse_help, drop hardcoded option list ([bf207da](https://www.github.com/scop/bash-completion/commit/bf207da5b3879ca5c94fd382b609b5b41f6802b1)) +* sysctl: invoke completed sysctl instead of one from path to get variables ([e32ca04](https://www.github.com/scop/bash-completion/commit/e32ca04b96f4e7c78232d6d75bc3782847f8aa97)) +* test: mark more tests that parse command output as requiring command ([503143b](https://www.github.com/scop/bash-completion/commit/503143bf4dd7c43088b646f81eafa4494c476b26)) +* test: add require_longopt xfail helper, use it ([6d79948](https://www.github.com/scop/bash-completion/commit/6d79948d9fe5923a3ec9fcaf881fb182cb59569d)) +* dmypy: new completion ([3135bc3](https://www.github.com/scop/bash-completion/commit/3135bc3780fda004a2c04e2ae007ae9ae1672f22)) +* travis: generate dist tarball on alpine ([be2e8f3](https://www.github.com/scop/bash-completion/commit/be2e8f3fe6be17051a9aa6fe081b66897e0d8b43)) +* wine: install for wine-development and wine-stable too ([afc5a30](https://www.github.com/scop/bash-completion/commit/afc5a303ae25afdb109464e4f63fc17783383ed5)) +* perltidy: associate *.t (#338) ([96b5e07](https://www.github.com/scop/bash-completion/commit/96b5e07b585b3122d51c5c25bc4289daa96524a7)) +* travis: test with Debian 10 ([c0a3c55](https://www.github.com/scop/bash-completion/commit/c0a3c5592dadcee37cf41dcf5fac2a357d1b5f67)) +* ssh: option and argument completion updates (#332) ([29a14f0](https://www.github.com/scop/bash-completion/commit/29a14f0f33ea8f3e8a77070eb30d14d547f8ac2b)) +* java: don't assume jar is installed ([120bf77](https://www.github.com/scop/bash-completion/commit/120bf77ad2d644eba6fb506caed08fa475a426e7)) +* _sysvdirs: always return 0 ([debbff9](https://www.github.com/scop/bash-completion/commit/debbff95fe35082877ccda05153d6d87562088ea)) +* test: xfail locale-gen option completion if --help is not available ([4cf7e4f](https://www.github.com/scop/bash-completion/commit/4cf7e4f52d7da127198146cf57161f9bcee546da)) +* valgrind: look tool names from lib/*-linux-gnu dirs too ([6c8380d](https://www.github.com/scop/bash-completion/commit/6c8380df27f6af2704d15c2de7efbb87fe0d1f48)) +* test: adjust java expectations based on whether jars can be listed ([9e351e4](https://www.github.com/scop/bash-completion/commit/9e351e41eb4bbadd94f9df48915708f78b8246b9)) +* op: direct command parsing stderr to /dev/null ([d10dcdf](https://www.github.com/scop/bash-completion/commit/d10dcdf798890afcb361e6286dfbff1404d43916)) +* ri: hush some warnings ([f5d99f2](https://www.github.com/scop/bash-completion/commit/f5d99f22f6da6deb4fb037a2966d8b2f8532a4f3)) +* carton: new completion ([6722aaa](https://www.github.com/scop/bash-completion/commit/6722aaa018ff426953496577db2daf3980443ffd)) +* CONTRIBUTING: disable e-mail bug gateway due to spam ([8ef547a](https://www.github.com/scop/bash-completion/commit/8ef547aad3566cdf83e659bda1113a0de55a4738)) +* apt-get: fix pkg version completion if it contains a colon (#351) ([8f0595c](https://www.github.com/scop/bash-completion/commit/8f0595c6e2396e875aeffac03dbd8b9d5b3d10cf)) +* _variables: add TERM and LC_* completion (#353) ([d1756f0](https://www.github.com/scop/bash-completion/commit/d1756f06ef9bffb1b4621c4e63e47e181ddf1086)) +* cppcheck: Add new standards to --std option. (#356) ([d8df8b5](https://www.github.com/scop/bash-completion/commit/d8df8b5e2d56a5f2fa5930b7278cc2cc6b6c90b8)) +* test: mark dcop and mr testcases requiring the cmd as such ([73e8faf](https://www.github.com/scop/bash-completion/commit/73e8faf4d987aef26d52c2354d4336596a7cee92)) +* makepkg: fix option completion ([3566352](https://www.github.com/scop/bash-completion/commit/356635225de0fb1efecb6e17bb1284fb2c6c5a80)) +* .gitignore: mypy cache ([0dd1e65](https://www.github.com/scop/bash-completion/commit/0dd1e652c6045a51a4d5c6eb2952248d43fdc88e)) +* test: add minimal mypy config ([860766e](https://www.github.com/scop/bash-completion/commit/860766ea4f44ebb98497eb8990634b705dd3d4f9)) +* test: python typing fixes ([af136b5](https://www.github.com/scop/bash-completion/commit/af136b50b222dcbfb9d881a8c33280b5051dc266)) +* test: fix cpio users test in presence of usernames with whitespace ([20cacd2](https://www.github.com/scop/bash-completion/commit/20cacd2ebabfd1cb9178f0bccb2faf859e5469bc)) +* shellcheck: add some option arg (non)completions ([000fa10](https://www.github.com/scop/bash-completion/commit/000fa10469d4704803ed48563cf656449d77232a)) +* test: shellcheck config cleanups ([0f3922b](https://www.github.com/scop/bash-completion/commit/0f3922be10b83361505fffa76d7bb2931415d25e)) +* bash_completion.sh: shellcheck SC2086 fixes ([ded48bb](https://www.github.com/scop/bash-completion/commit/ded48bb7ab53c1836c6ec436cb304b6823a180f4)) +* _filedir: remove unused $x ([2701887](https://www.github.com/scop/bash-completion/commit/2701887f4862b29dafa0d9ecef329a766713a3fe)) +* _filedir: avoid duplicate dirs internally, and a compgen -d call for files ([da99bc5](https://www.github.com/scop/bash-completion/commit/da99bc55954e9f60b9c3a9e9071ff6301d7015cb)) +* curl: make @filename completion do the right thing with dirs ([aa3652b](https://www.github.com/scop/bash-completion/commit/aa3652b6b7de9aabfafa79f52c70825f23f967ab)) +* pkg-config: generate Name from autotools PACKAGE ([32369a0](https://www.github.com/scop/bash-completion/commit/32369a009d14f129e000cba4a0a2d1b8fc65ccea)) +* unzip, zipinfo: complete *.aab (#340) ([31b5cbc](https://www.github.com/scop/bash-completion/commit/31b5cbc8016b181675e10dd068c92008782d4196)) +* pkg-config: Relative paths ([8c53025](https://www.github.com/scop/bash-completion/commit/8c5302581ad20954cfa164dcae26f1ed6277dd90)) +* autotools: Replace pkgdatadir with datadir ([0cc34e8](https://www.github.com/scop/bash-completion/commit/0cc34e8de658bd11fa7f728eb9852c7e29d8d6d4)) +* cppcheck: Remove deprecated option 'posix' for '--std=' ([d1ae094](https://www.github.com/scop/bash-completion/commit/d1ae094807532e42b71c18e648b182c5c44a0daf)) +* perl: fix completion with space between option and argument ([8eba6d0](https://www.github.com/scop/bash-completion/commit/8eba6d0c6b88dacd80762ada3a3bc5fe14673fb2)) +* perl: indentation fixes ([1360ba9](https://www.github.com/scop/bash-completion/commit/1360ba95149d0880486d1abfdcfcf6f77355c44d)) +* test: add some trivial perl -E/-e cases ([188ca8a](https://www.github.com/scop/bash-completion/commit/188ca8af208f35ebdc9895d5fd41d6cdd83d90a6)) +* screen: complete first arg with serial devices ([9cde25b](https://www.github.com/scop/bash-completion/commit/9cde25bfd74bdd1cb51e46a4b1958ebd444cdbd6)) +* screen: add //telnet completion ([7a8e408](https://www.github.com/scop/bash-completion/commit/7a8e408267ca21530d6d6de4ae92b9a0362e14fd)) +* screen: add serial device basic arg (non)completion ([fb46fed](https://www.github.com/scop/bash-completion/commit/fb46fed657d6b6575974b2fd5a9b6529ed2472b7)) +* update-rc.d: remove dead code ([845be11](https://www.github.com/scop/bash-completion/commit/845be116278719c2a4ab4d4edaee81f38cc17b9f)) +* update-rc.d: indentation fix ([645cc41](https://www.github.com/scop/bash-completion/commit/645cc41deab3dce6a38120be05ab02ee1ca6bc89)) +* ssh, scp, sftp, ssh-copy-id, curl: improve identity file completion ([44ce113](https://www.github.com/scop/bash-completion/commit/44ce11334803f924f60e2e2c00c8b7d3dc81c33f)) +* unrar: complete on *.exe (#337) ([2b81989](https://www.github.com/scop/bash-completion/commit/2b8198919e4bc65efd8c68ade769e65f6df473f1)) +* gcc: support new --completion option (#222) ([87a9e9c](https://www.github.com/scop/bash-completion/commit/87a9e9c47f028efb6178c69ced2df74b62a73639)) +* test: bump black to >=19.10b0 ([540e5d1](https://www.github.com/scop/bash-completion/commit/540e5d1a7ec9599f404ec88d35aa37bf25557755)) + +## 2.9 (2019-04-27) + +* completions/Makefile: Fix check-local in VPATH builds ([57b2c93](https://www.github.com/scop/bash-completion/commit/57b2c937c1fa8409a4416702cf5b8844233a5566)) +* ssh: Order various switch cases closer to alphabetical ([cde26f0](https://www.github.com/scop/bash-completion/commit/cde26f07207d3256ec56f519256cb7a7d38d993e)) +* ssh: Sync query type list with OpenSSH 7.5p1 ([655ede3](https://www.github.com/scop/bash-completion/commit/655ede3db3f56ae7669c296110d8dbef9c329b3a)) +* ssh: Sync config option lists with OpenSSH 7.5p1, add some value completions ([15abc03](https://www.github.com/scop/bash-completion/commit/15abc03c71d49c1bfc328e5c860c1bd30b15feb0)) +* apt-get: Complete install package=versions ([c664b07](https://www.github.com/scop/bash-completion/commit/c664b07ac98bf46c0ea416161cef0a0dbe11ab50)) +* apt-get: Add indextargets to list of suggested commands ([d623786](https://www.github.com/scop/bash-completion/commit/d6237861144c897866630e2d3fb81da5d5413e81)) +* apt-get: Simplify -t and friends completion, support Ubuntu ([9b531a0](https://www.github.com/scop/bash-completion/commit/9b531a08cc825ec723ef8ff78f2072ace6f85a31)) +* apt-get: Sync option list with apt 1.5.1 ([f4e54d9](https://www.github.com/scop/bash-completion/commit/f4e54d918b5a367a7e665d563e2f8336553ea950)) +* apt-get: Add -h/-v/-o non-completions ([c80c82c](https://www.github.com/scop/bash-completion/commit/c80c82c9dcffeb2834f1bcb3edd38a228c20624a)) +* dpkg-source: Add --before-build --after-build --commit, and --print-format ([1404d3f](https://www.github.com/scop/bash-completion/commit/1404d3f995649e1f70ffbb8239acd585e8246df4)) +* README: Link to various distro packages ([c8f4f87](https://www.github.com/scop/bash-completion/commit/c8f4f87070150719249fc1c585d0ec414d120ce7)) +* README: Point Debian and openSUSE badges towards unstable and Tumbleweed ([2dc5865](https://www.github.com/scop/bash-completion/commit/2dc5865bb78d2d9ef131da53b15710528716054b)) +* ssh: Complete all *File option args with _filedir ([7cd0090](https://www.github.com/scop/bash-completion/commit/7cd00901477878d135a844624eff795995199761)) +* test: Add comment line to fixtures/_known_hosts_real/known_hosts ([a0e2ce3](https://www.github.com/scop/bash-completion/commit/a0e2ce369a28c5eb41dd8d96495457ddb9254b28)) +* _known_hosts_real: Reimplement known hosts file parsing in pure bash ([71ac42b](https://www.github.com/scop/bash-completion/commit/71ac42b98c0eba39819fb8478d6443032c6ef6f1)) +* mount, umount: Deprecate on Linux in favor of util-linux >= 2.28 ones ([861be75](https://www.github.com/scop/bash-completion/commit/861be7590ed96fb1aacc8b5161f10a00ae57eebe)) +* .dir-locals.el: Set -O extglob for flycheck bash checks ([b49a182](https://www.github.com/scop/bash-completion/commit/b49a182cc68a9d69d702754c3adc0b17d50e52f6)) +* reportbug: Add bunch of option arg (non-)completions ([81e2971](https://www.github.com/scop/bash-completion/commit/81e29716093a13dff3bde8b9f486e44f99662ac8)) +* a*,ccze,curl,wget: Support completing arg of last bundled short option ([b358aa1](https://www.github.com/scop/bash-completion/commit/b358aa1ebd88e353788f7c5655e9c489fe4eba40)) +* b*: Support completing arg of last bundled short option ([d664aeb](https://www.github.com/scop/bash-completion/commit/d664aebf6bd6ef5ca0602f6440887273bbe000e3)) +* cvs: Add completion for the log command ([7c5a752](https://www.github.com/scop/bash-completion/commit/7c5a75277842b0ac71d1154d87534fccd86ab22b)) +* chage, chpasswd: Add -R/--root arg completion ([5634cfe](https://www.github.com/scop/bash-completion/commit/5634cfe5923a0f9b83b5dc7275185578c9cac68e)) +* dhclient: Parse options with _parse_usage ([5789780](https://www.github.com/scop/bash-completion/commit/57897803dbce6cf90c24bfd59a08fb39cfdfd3c0)) +* dhclient: Add some option arg (non-)completions ([2a7d2e3](https://www.github.com/scop/bash-completion/commit/2a7d2e3eb540188cafda3bf0c103f59ef2b7991f)) +* dselect: Parse options with _parse_help ([1b15dc6](https://www.github.com/scop/bash-completion/commit/1b15dc6884a39928cd57f48f1d900f3d9fef86d7)) +* c*, d*: Support completing arg of last bundled short option ([ed24bbc](https://www.github.com/scop/bash-completion/commit/ed24bbc8e77e3fb40ef7bf730eebfaa3b06cac24)) +* ether-wake: Install for etherwake as well ([b6903bc](https://www.github.com/scop/bash-completion/commit/b6903bc346f6b97d12f02007676dfc280f051fb6)) +* e*: Support completing arg of last bundled short option ([008a407](https://www.github.com/scop/bash-completion/commit/008a4074c72152187195c7fd4a1e47e5ae348528)) +* f*: Support completing arg of last bundled short option ([c1dfa0f](https://www.github.com/scop/bash-completion/commit/c1dfa0f5ab43516e1c31978d05548ca2c8c6008a)) +* g*: Support completing arg of last bundled short option ([e00c119](https://www.github.com/scop/bash-completion/commit/e00c1195427bb092473ec7f753262e5751642d0f)) +* scrub: New completion ([6b5c8d4](https://www.github.com/scop/bash-completion/commit/6b5c8d4dc5ff49e84839279ca581202acc37fce5)) +* ecryptfs-migrate-home: New completion ([3f90f09](https://www.github.com/scop/bash-completion/commit/3f90f09f1b8dc32f9ffb55566bfe8ed88418c52b)) +* h*: Support completing arg of last bundled short option ([1c126ff](https://www.github.com/scop/bash-completion/commit/1c126ff5c64006edc58e33d8bee4546bafb49405)) +* i*: Support completing arg of last bundled short option ([665088a](https://www.github.com/scop/bash-completion/commit/665088ae3925e9d60352b898f35c449420702834)) +* test: Skip scrub -p test when its --help doesn't list available patterns ([9039d77](https://www.github.com/scop/bash-completion/commit/9039d771b63b562276151239c38f760418a9e5f4)) +* lftp: Support completing arg of last bundled short option, handle -s ([ff07e56](https://www.github.com/scop/bash-completion/commit/ff07e569964809400c652e4949c663e80a66fab1)) +* xgamma: Comment spelling fix ([6119b2c](https://www.github.com/scop/bash-completion/commit/6119b2cf0bd96b432482c3361634140a04a77f81)) +* links: Install completion for links2 too ([b1fbe75](https://www.github.com/scop/bash-completion/commit/b1fbe75475c140a7047cf8208650562332ef57ac)) +* iconv: Split charset completion to _iconv_charsets, add test case ([cefd0da](https://www.github.com/scop/bash-completion/commit/cefd0daf30e7022bdbce98de88dca5ba6244c1a5)) +* _filedir: Refactor to remove heredoc-dependent loop ([6ffde95](https://www.github.com/scop/bash-completion/commit/6ffde95c7ea257ff60cb51a263a8d33f4bb0898b)) +* _filedir: Drop unnecessary evals ([7be0dd6](https://www.github.com/scop/bash-completion/commit/7be0dd6c9556c264dfa0fe1b6a8f4d19a2216473)) +* wget: Remove nonexistent arg to _ip_addresses ([9214270](https://www.github.com/scop/bash-completion/commit/92142707893641834e177f6a928160878d6b0506)) +* _ip_addresses: Add option to complete all/v4/v6 addresses, add unit test ([dc72400](https://www.github.com/scop/bash-completion/commit/dc724002cb0291880a2daacc51f2e7ad4cf2950d)) +* links: Major rework, parse options from --help, add option arg completion ([173e104](https://www.github.com/scop/bash-completion/commit/173e1045361404cd9a765438885652cdcb5cef3b)) +* iperf, nc: Include IPv6 addresses in bind address completions ([209b16b](https://www.github.com/scop/bash-completion/commit/209b16bf0888ce6367c06d256e43afffa33a8d90)) +* chmod: New completion ([9501226](https://www.github.com/scop/bash-completion/commit/9501226cb139ac828c5079cb7c079d00277468c8)) +* json_xs: New completion ([1433694](https://www.github.com/scop/bash-completion/commit/143369404d844111a7f4cbd6f19cda16d3738d16)) +* README: Add Q/A on overriding a completion, modernize local install answer ([22e9a02](https://www.github.com/scop/bash-completion/commit/22e9a020adf1ab73896411ca2f3712a445062727)) +* build: Do cmake, pc, and profile variable replacements in Makefile ([81ba2c7](https://www.github.com/scop/bash-completion/commit/81ba2c7e7dfbaefbafa1e8615727c9612e5fb314)) +* build: Use AC_PROG_SED to locate sed ([3031df3](https://www.github.com/scop/bash-completion/commit/3031df31aba36be8fef11186a7bff5163433bae4)) +* pkg-config: Complete on *.pc files ([d8667ae](https://www.github.com/scop/bash-completion/commit/d8667ae379fa325ecd43626fe9cfd5e955450e85)) +* build: Improve cleanup of test/log and test/tmp dirs ([103db12](https://www.github.com/scop/bash-completion/commit/103db12fd29746ec88f69849842fa3d2f9d251d0)) +* test: Run perlcritic and flake8 on perl and python helpers in Travis ([da18668](https://www.github.com/scop/bash-completion/commit/da18668c64bcaa061db00ce17c86fb4dc39ac7dc)) +* lzma: Use _parse_help instead of hardcoded option list ([bca4c60](https://www.github.com/scop/bash-completion/commit/bca4c6002e9381310b3563551bf09b3865c15238)) +* [jkl]*: Support completing arg of last bundled short option ([9ab622e](https://www.github.com/scop/bash-completion/commit/9ab622e76be185380f627c68cd090e69d7b8466a)) +* __load_completion: Avoid bad array subscript on "commands" ending with slash ([583562b](https://www.github.com/scop/bash-completion/commit/583562b9e56207bd428497ceb96df4e1f1f53158)) +* aclocal, automake: Support versioned 1.16 executables ([485d6de](https://www.github.com/scop/bash-completion/commit/485d6de3909f9d8c83eb38c0a1797ba448a3a754)) +* test: Mark psql etc test cases untested if --help doesn't work ([e8e7a15](https://www.github.com/scop/bash-completion/commit/e8e7a154b2dbcad08b02396f114017d3caf02ac4)) +* _xspecs: Declare as global on bash >= 4.2 ([a47bd37](https://www.github.com/scop/bash-completion/commit/a47bd375bb0f95dc6d388d4097c420bddb72ae33)) +* README: Note $BASH_COMPLETION_USER_DIR ([8c67dad](https://www.github.com/scop/bash-completion/commit/8c67dadc402a370e082b372b2df7a9702ab72623)) +* README: Add instructions for overriding completions system wide ([7cbbf35](https://www.github.com/scop/bash-completion/commit/7cbbf353403292395dd4d3c04e506162a457c336)) +* pytest: Rename from py.test to follow upstream recommended name ([fbf2981](https://www.github.com/scop/bash-completion/commit/fbf298186fa94f001ae2ef01b4716e14fe8a544d)) +* rpm: Complete --licensefiles with -q ([fb13b2e](https://www.github.com/scop/bash-completion/commit/fb13b2ef4e7a10bf29ec30301bb8b2fc8654caf3)) +* ngrep, tshark: Complete on *.pcapng too ([550728e](https://www.github.com/scop/bash-completion/commit/550728eb93224da5442f6e9339cbb879a2af7300)) +* ifquery: New ifup alias completion ([932d0be](https://www.github.com/scop/bash-completion/commit/932d0be8904c3a65eb32d784a4b517ad68bf93da)) +* _count_args: Add support for not counting specified option args ([daf010a](https://www.github.com/scop/bash-completion/commit/daf010ad945d84f48ef672ab4905d56e34ad1886)) +* ifup etc: Add option and option argument completion ([f499aa3](https://www.github.com/scop/bash-completion/commit/f499aa3d3dc985d62e99b46198300ce19e0f9d2a)) +* ssh, scp, sftp: Support completing arg of last bundled short option ([645d901](https://www.github.com/scop/bash-completion/commit/645d90167c9d7cd737f49961a0730d9cb892f95b)) +* completions/Makefile.am: Use install-data-hook, not install-data-local ([ee6b37a](https://www.github.com/scop/bash-completion/commit/ee6b37ad7ff5b309cbb9b886a871252abd9398fa)) +* mplayer: Add common supported module music formats ([c2d4221](https://www.github.com/scop/bash-completion/commit/c2d4221655bc2267b8d992489316006a73cee498)) +* mplayer: Associate with *.S[3T]M, *.med, *.MED ([264fb85](https://www.github.com/scop/bash-completion/commit/264fb85647b4b70362cf5a34a69612e241e7fdf3)) +* minicom: Use _parse_help instead of hardcoded option list ([62578a3](https://www.github.com/scop/bash-completion/commit/62578a356387465ecdc878a6e3bb66395bf2b5b1)) +* modinfo: Use _parse_help instead of hardcoded option list ([1397fa7](https://www.github.com/scop/bash-completion/commit/1397fa72a918f5344798faf79273067ffa324345)) +* m*: Support completing arg of last bundled short option ([8f82fd9](https://www.github.com/scop/bash-completion/commit/8f82fd98cc56ac6973ff01407784c3c76b0e462a)) +* mysqladmin: Reuse --default-character-set completion from mysql ([b984e6a](https://www.github.com/scop/bash-completion/commit/b984e6a04a70088ac9c0d6bdb59279274b8a7137)) +* mysql, mysqladmin: Complete --ssl-{ca,cert,key} option arg ([d5ee055](https://www.github.com/scop/bash-completion/commit/d5ee055d6c30b6bc27a28547533912eb7e6b7bd2)) +* modinfo: Fall back to _parse_usage if _parse_help yields no results ([d2f55d0](https://www.github.com/scop/bash-completion/commit/d2f55d0d04eafc24d4a74a15c87d029b43942007)) +* cryptsetup, nc, sh: Skip option args when counting arguments ([11dee0e](https://www.github.com/scop/bash-completion/commit/11dee0e0497210443cf7a32c16ce913a62e449db)) +* cryptsetup: Add some option arg (non-)completions ([68295cc](https://www.github.com/scop/bash-completion/commit/68295cc7f40063e75ddaab0f08b90dcc5a653998)) +* n*: Support completing arg of last bundled short option ([02a13f7](https://www.github.com/scop/bash-completion/commit/02a13f7f0eda6db3e0017a625863c5c43af43829)) +* profile.d: Avoid tested variable values being confused as [ ] operators ([3f1c884](https://www.github.com/scop/bash-completion/commit/3f1c884bef639af2cae959b04b87fb3a41eeeb7d)) +* passwd: Try _parse_help before _parse_usage to parse options ([16e82b8](https://www.github.com/scop/bash-completion/commit/16e82b8c27a4ccce0cc0c4f203617f747d427b5f)) +* [op]*: Support completing arg of last bundled short option ([5a654a8](https://www.github.com/scop/bash-completion/commit/5a654a834a44c9569b527b543b39fbe969efbe74)) +* pyvenv: Support versioned 3.6-3.8 executables ([b0de719](https://www.github.com/scop/bash-completion/commit/b0de7196c1e211f0f832c8d7af3ce38f85f1ab94)) +* querybts: Use _parse_help, not hardcoded option list, misc improvements ([00de26b](https://www.github.com/scop/bash-completion/commit/00de26bf42b9d389dae36787386e4a2ab0cf6c1b)) +* reportbug: Run _parse_help and apt-cache more selectively ([ecdcdb5](https://www.github.com/scop/bash-completion/commit/ecdcdb5f240a2a63accaa1c5da35eb74fdbacef4)) +* [qr]*: Support completing arg of last bundled short option ([13579f2](https://www.github.com/scop/bash-completion/commit/13579f2426ca88b1ae966bea3abc6a6326d99e83)) +* jq: New completion ([8d57c41](https://www.github.com/scop/bash-completion/commit/8d57c41995f17eef59506d79d44ec4276d2086cc)) +* tune2fs: Update -o/-O argument lists ([27efd8c](https://www.github.com/scop/bash-completion/commit/27efd8c1d66a47a5313c3467ce6b67b6b150ef90)) +* sqlite3: Add some option arg (non-)completions ([1c2b0d7](https://www.github.com/scop/bash-completion/commit/1c2b0d778bcaf19dc13844100af3627c6367cbad)) +* sshow: Add -p arg completion ([c2acf69](https://www.github.com/scop/bash-completion/commit/c2acf697c57ff931d1c943f69c2745b7cf5eea20)) +* strace: Use _parse_help instead of hardcoded option list ([77539a5](https://www.github.com/scop/bash-completion/commit/77539a50d6073be3b4972ed14069002e69b3d41b)) +* sudo: Parse options from help/usage output, add some long option support ([46d5d2d](https://www.github.com/scop/bash-completion/commit/46d5d2d4ea9be932a48f7e7de5a9e4ad2231a74b)) +* test: Add sysctl option parsing test case ([5b8b66a](https://www.github.com/scop/bash-completion/commit/5b8b66a3feaf73bfa9780e69d0308e1d2d367f1d)) +* sysctl: Recognize --pattern/-r and --load options ([0f63ecb](https://www.github.com/scop/bash-completion/commit/0f63ecb8234f97a6669a7ee0bb4a57cbe3e5cb54)) +* sudo: Improve long option arg handling ([ca3b1f6](https://www.github.com/scop/bash-completion/commit/ca3b1f664f0bfa92cc688909dee68937fd638286)) +* s*: Support completing arg of last bundled short option ([bd1d93c](https://www.github.com/scop/bash-completion/commit/bd1d93cede385001667f0ad205f4e900711b42c8)) +* jq, sqlite3: Protect against negative array subscripts ([bd3e2f2](https://www.github.com/scop/bash-completion/commit/bd3e2f297018bdbcd81b719f47c433d8e0aa1d17)) +* test: Support running with local BSD binaries, do it w/ ubuntu14 in CI ([2fe53fe](https://www.github.com/scop/bash-completion/commit/2fe53fef669a9dc077784bf3ab73db650d879ab2)) +* xdg-settings: Make help parsing work on BSD ([40f1c24](https://www.github.com/scop/bash-completion/commit/40f1c24fb3109c074efdea1f897b062afccb725e)) +* test: Skip jq option completion test if its --help doesn't list them ([e407508](https://www.github.com/scop/bash-completion/commit/e40750884e25700aa02f3e1ffb9a7662b05e9a47)) +* tracepath: Actually use our separate completion instead of _known_hosts ([b0c0d5e](https://www.github.com/scop/bash-completion/commit/b0c0d5e201a15857c065ccea204ddaf67accfef0)) +* tracepath: Add -m and -p arg non-completions ([a7ee04e](https://www.github.com/scop/bash-completion/commit/a7ee04e98f0c30cab5e53f852e6373e75872a30c)) +* urlsnarf: Add -p arg completion ([8cf0ce3](https://www.github.com/scop/bash-completion/commit/8cf0ce3dc6f73aa67cee59846d1ec828814fe222)) +* uscan: Use _parse_help instead of hardcoded option list ([d13306d](https://www.github.com/scop/bash-completion/commit/d13306d74fbe879398bdc86a7b0dc4fc9bd5534b)) +* [tu]*: Support completing arg of last bundled short option ([26cb739](https://www.github.com/scop/bash-completion/commit/26cb739d3cd1a1935f1b5e186090ea9dfd4847fd)) +* test: Fix iwspy test case ([886f4a1](https://www.github.com/scop/bash-completion/commit/886f4a1e3168b6e413e5a9cb60c2b3ed714c3734)) +* [vwx]*: Support completing arg of last bundled short option ([bbd6296](https://www.github.com/scop/bash-completion/commit/bbd629670ca291e10d1d9a7a68941025d94959e0)) +* fio: New completion ([c92a426](https://www.github.com/scop/bash-completion/commit/c92a4264fe8522de6040a14e8e6f9a3ed1ddf792)) +* ngrep: Add "any" to -d arg completions ([507d593](https://www.github.com/scop/bash-completion/commit/507d593962ed8a305e17ac7807704ee5fc4f9ae1)) +* tshark: Get available interfaces from -D output ([8d7d24d](https://www.github.com/scop/bash-completion/commit/8d7d24d949ba77cd26ae904614fffdbae05e5246)) +* pylint: Option arg completion improvements ([fe69cb5](https://www.github.com/scop/bash-completion/commit/fe69cb582b42a02aebd6ea59ce6449de43da7f4c)) +* mplayer: Associate with *.w64 ([6526596](https://www.github.com/scop/bash-completion/commit/6526596964b311a830507c5342818253212ec405)) +* test: Mark flake8 untested if it seems broken ([a5d490a](https://www.github.com/scop/bash-completion/commit/a5d490a330be979c47f3a2b61c608c83a1e3db45)) +* test: Limit number of wget option completions to avoid unresolved result ([4f242f2](https://www.github.com/scop/bash-completion/commit/4f242f2bd70bd0706061c81600402f2887d032f9)) +* travis: Split long lines in script ([d765f75](https://www.github.com/scop/bash-completion/commit/d765f756036907574bcf9ecdb2be6f8ddb7bc056)) +* travis: Run ubuntu14/bsd with no network ([64c1817](https://www.github.com/scop/bash-completion/commit/64c18170a44df5fe3a0c384f9b95cebe80405997)) +* pydoc, pylint: Skip module completion if current looks like a path ([bdd6458](https://www.github.com/scop/bash-completion/commit/bdd64589f2466f1bdab9708aa530536c66a13bc7)) +* gpgv: New completion ([ff65882](https://www.github.com/scop/bash-completion/commit/ff6588216dc1e789b091a27430e6d512f5bbfcb0)) +* extra/git-post-commit.sh: Add git post-commit Docker Hub trigger hook ([03442fa](https://www.github.com/scop/bash-completion/commit/03442face6795c56ba0b89eadcc8f7e1ba1b0f14)) +* _services: Try systemctl list-unit-files if systemctl list-units fails ([9f52c69](https://www.github.com/scop/bash-completion/commit/9f52c693d9eecd66f6a92343121a8230c32215b3)) +* test: Run docker tests with --verbose ([d45f902](https://www.github.com/scop/bash-completion/commit/d45f9020ae30b5c70e0ddf449a6e7877ea637f44)) +* test: Bump expect's match_max to 20000 by default ([bda6e45](https://www.github.com/scop/bash-completion/commit/bda6e453e79123b1adbc7b979f93437ad2e4bcf0)) +* test: Fix buffer size option listing in run --help ([eb21e66](https://www.github.com/scop/bash-completion/commit/eb21e663bd82e1a6e13fef2fe272fcf7ebde6850)) +* pylint: Implement comma separated --confidence arg completion ([5aee5d7](https://www.github.com/scop/bash-completion/commit/5aee5d77ebb7c1a1e242558f72b0a1dd178b9945)) +* pylint: Bring -f/--format arg completion up to date with pylint 1.9.2 ([7e6a220](https://www.github.com/scop/bash-completion/commit/7e6a22079bfab2f9eb38d4743e43cadb89880a59)) +* pydoc, pylint: Determine python2/3 based on command basename only ([fa6ec59](https://www.github.com/scop/bash-completion/commit/fa6ec59dfacdb7067575ad0c2d13b8494fbd4397)) +* test: Limit number of pylint option completions ([9f75f4b](https://www.github.com/scop/bash-completion/commit/9f75f4bcd2da48dc24d9e5a0f8cce5658c164d94)) +* test: Add pylint-3 test case ([c401847](https://www.github.com/scop/bash-completion/commit/c40184702676816ea79cd1746867ffc1e5311e8d)) +* git-post-commit: Avoid some error trash when HEAD is not a symbolic ref ([579b733](https://www.github.com/scop/bash-completion/commit/579b73367d9437c1c5b33653d26be11c4a2a19b4)) +* tox: Fall back to --listenvs for env list if --listenvs-all fails ([6009de8](https://www.github.com/scop/bash-completion/commit/6009de8534cd24b71d0bfda479823abcc640e4b1)) +* test: Start converting test suite to pytest+pexpect ([641173e](https://www.github.com/scop/bash-completion/commit/641173e04e9819134a9ad1b02a4217f61bf7882c)) +* test: Update generate for pytest+pexpect ([8b1d916](https://www.github.com/scop/bash-completion/commit/8b1d916faf9841a6bbc09a36f2ba84049ce5be40)) +* test: Convert first bunch of completions to pytest+pexpect ([ff4289f](https://www.github.com/scop/bash-completion/commit/ff4289f9f2994eb807f4c0a9ec996fd78542e8c3)) +* test: Don't include our magic mark in completions ([d8712ad](https://www.github.com/scop/bash-completion/commit/d8712ad6a89827fef871e10c082a7fd2b533a337)) +* test: Fix completion list when there's one completion ([4fc8f71](https://www.github.com/scop/bash-completion/commit/4fc8f718d5bb0550c9e88452c43ce69437bfba57)) +* test: Convert remaining simple x* to pytest+pexpect ([ae9b3a9](https://www.github.com/scop/bash-completion/commit/ae9b3a9e8313e8403acfbb1d453dd2691f0c60c1)) +* test: Improve generate to handle basic args and problematic chars ([6fc2de1](https://www.github.com/scop/bash-completion/commit/6fc2de1b362dfbffa3d9156c68490d47259ba82e)) +* test: Convert trivial [u-z]* test cases to pytest+pexpect ([ac47b5c](https://www.github.com/scop/bash-completion/commit/ac47b5c49a9e8e2434bb33a86d687f347d6d03cb)) +* test: Add some additional simple completion test cases ([b2e0c51](https://www.github.com/scop/bash-completion/commit/b2e0c51ed5198bae5d9e1218f16967450eff93eb)) +* test: Use make pytest docker executable env-configurable, default pytest-3 ([2473d1f](https://www.github.com/scop/bash-completion/commit/2473d1f9490dd3cca631a8fb5e9722e0812e4cd0)) +* test: Use /root/.local/bin/pytest on centos6 by default ([6164b45](https://www.github.com/scop/bash-completion/commit/6164b45a48a5a058dcdfa7f5562ade4a126fc431)) +* test: Convert trivial t* test cases to pytest+pexpect ([4205d79](https://www.github.com/scop/bash-completion/commit/4205d7921caa09edae4a183133591fa2817e727c)) +* test: Convert trivial s* test cases to pytest+pexpect ([cd11331](https://www.github.com/scop/bash-completion/commit/cd113319ba73d14f6ed73782365902e6d938f10c)) +* test: Add new test files to EXTRA_DIST ([6130867](https://www.github.com/scop/bash-completion/commit/6130867362edd027183303aa174d2005e405a59c)) +* test: Add generated test files to t/Makefile.am automatically ([a672f55](https://www.github.com/scop/bash-completion/commit/a672f550aa0216b21ce8275a93cddb592e639481)) +* test: Convert trivial [qr]* test cases to pytest+pexpect ([2b79b27](https://www.github.com/scop/bash-completion/commit/2b79b273ce80bdd076335af22249929b7d3c09af)) +* test: Use /root/.local/bin/pytest on ubuntu14 by default ([36f73ad](https://www.github.com/scop/bash-completion/commit/36f73ad8a9a6cd7f29483823025c8ed06af2966c)) +* test: Convert trivial o* test cases to pytest+pexpect ([9ba87c3](https://www.github.com/scop/bash-completion/commit/9ba87c39a75b17b46894ad47217d83df2b5fe051)) +* test: Bulk convert lots of trivial test cases to pytest+pexpect ([cdb9a22](https://www.github.com/scop/bash-completion/commit/cdb9a224868449fefbe6447c5475b749d5a3851c)) +* test: Bulk convert some more trivial test cases to pytest+pexpect ([e546577](https://www.github.com/scop/bash-completion/commit/e5465771b901ac59fbbd67d121d26654e076c79a)) +* test: Make "generate" do the right thing with more partial args ([45d5ad9](https://www.github.com/scop/bash-completion/commit/45d5ad98adca66e20a6384aa825f492939d600c9)) +* test: Convert some more trivial test cases to pytest+pexpect ([de97e77](https://www.github.com/scop/bash-completion/commit/de97e775e08b4c60f93908927d85b45860e91dc2)) +* test: Convert some more trivial test cases to pytest+pexpect ([8c9c4f1](https://www.github.com/scop/bash-completion/commit/8c9c4f12d72c2b275e8d6d34edb2cf560d1aa93a)) +* test: Convert some more trivial test cases to pytest+pexpect ([5cab3b3](https://www.github.com/scop/bash-completion/commit/5cab3b32dcb22f585f16b4a34007b053bad90cc6)) +* test: Convert some more trivial test cases to pytest+pexpect ([cb17e4b](https://www.github.com/scop/bash-completion/commit/cb17e4be72e2ccf0c2704e97faa13ada8d22acac)) +* test: Treat non-dash args better in generate ([ecfa09d](https://www.github.com/scop/bash-completion/commit/ecfa09d4a5629d3adbc502940156db5498922049)) +* iperf: Add g/G to --format completions ([cfef384](https://www.github.com/scop/bash-completion/commit/cfef3841d1f38b724d1209a9e43885cde5b89b97)) +* iperf: Install for iperf3 too ([a520baa](https://www.github.com/scop/bash-completion/commit/a520baa0c68fabf283129521c2a59bc2e9597805)) +* iperf: Improve client/server specific option parsing ([51863c4](https://www.github.com/scop/bash-completion/commit/51863c4604771e04f7dca2f6f1a960fc7558b723)) +* xmodmap: Use _parse_help instead of hardcoded option list ([fa278dc](https://www.github.com/scop/bash-completion/commit/fa278dcf99bfae48ced96740712b231f069c1447)) +* iperf: Add g/G to --format completions ([a2277c0](https://www.github.com/scop/bash-completion/commit/a2277c0857ce13c2b4ada55206af72482c6c7d71)) +* iperf: Install for iperf3 too ([e4425bd](https://www.github.com/scop/bash-completion/commit/e4425bd5d36d94b2682c8ffb7cb60d91e8814be6)) +* iperf: Improve client/server specific option parsing ([c187063](https://www.github.com/scop/bash-completion/commit/c187063b955f837f9bbd22ec52ca4133aeac7d39)) +* xmodmap: Use _parse_help instead of hardcoded option list ([1b60881](https://www.github.com/scop/bash-completion/commit/1b608812e47a091933b685d01bcbed03dd2107f1)) +* test: Add some iperf, iperf3 and xmodmap test cases ([b3acc94](https://www.github.com/scop/bash-completion/commit/b3acc9412937abd92a9ff4d7a34515520df56b5c)) +* test: Make test base work with Python 3.3+ ([83e91da](https://www.github.com/scop/bash-completion/commit/83e91da21d33be89f0aa2a07a0706b4910f4ba2c)) +* test: Add support for pytest pre-test commands ([ccba78d](https://www.github.com/scop/bash-completion/commit/ccba78d32a82c2081d5d08beed2887f944f96335)) +* test: Convert some more test cases to pytest+pexpect ([987aa3d](https://www.github.com/scop/bash-completion/commit/987aa3d50cc3a5c6b1dd8620cd5c5c7ed7eb1d2e)) +* test: Add support for skipping individual tests based on shell command status ([6a4d824](https://www.github.com/scop/bash-completion/commit/6a4d8245f6919550f18c4534a25fd59f61d11437)) +* test: Convert some more test cases to pytest+pexpect ([8145625](https://www.github.com/scop/bash-completion/commit/81456254bb4e09a09447a4429c923e478088327b)) +* test: .gitignore pytestdebug.log ([24c66c1](https://www.github.com/scop/bash-completion/commit/24c66c1184c7f38d3c56fe6d4fcf8b8e38fc2514)) +* test: Convert some more test cases to pytest+pexpect ([27053d1](https://www.github.com/scop/bash-completion/commit/27053d104ce140291e9d2b024c313167facaf2e3)) +* test: Add support for running test case in a specified dir ([339874f](https://www.github.com/scop/bash-completion/commit/339874fdc5a5f9805fec6aaee0c4dd0f24febb6e)) +* test: Convert some more test cases to pytest+pexpect ([ed64828](https://www.github.com/scop/bash-completion/commit/ed64828e9f5c883946e93771b7d9a4f1bdaa0323)) +* test: Fix some regressions introduced in recent test conversions ([aaaa60d](https://www.github.com/scop/bash-completion/commit/aaaa60d67fea6322f54e2a79cb83b02f4f254e32)) +* test: Convert some more test cases to pytest+pexpect ([038fd4e](https://www.github.com/scop/bash-completion/commit/038fd4e2c92ebf487ca936edff2bd3cc6512706c)) +* test: Convert some more test cases to pytest+pexpect ([c32a405](https://www.github.com/scop/bash-completion/commit/c32a405000539483a4c5ad3527e297b640dd76b3)) +* test: Convert some more test cases to pytest+pexpect ([e0be296](https://www.github.com/scop/bash-completion/commit/e0be296af493d3998dca9acb44f82dce636af106)) +* test: Include command name in test class name, use numbered test method names ([649cd43](https://www.github.com/scop/bash-completion/commit/649cd43616fdba56648fbccaf5194c2a6022587d)) +* test: Convert some more test cases to pytest+pexpect ([aece7ad](https://www.github.com/scop/bash-completion/commit/aece7ad1bbc1870ba1016f00e9047094734a480a)) +* test: Add class level skipif based on bash exec result ([ae723ed](https://www.github.com/scop/bash-completion/commit/ae723ed0504c45afc1bb34fdc65d5329094ce083)) +* test: Add python3 test case ([9a0fddc](https://www.github.com/scop/bash-completion/commit/9a0fddc85b8f4d7c85446ea8e0e976187a4a4658)) +* test: Convert some more test cases to pytest+pexpect ([c5300cd](https://www.github.com/scop/bash-completion/commit/c5300cd5571cc432e277a8d9aff35f6f2d23eb8f)) +* test: Rename BASHCOMP_* test env variables to BASHCOMP_TEST_* ([2fa7566](https://www.github.com/scop/bash-completion/commit/2fa75666ee48edc744db322621398a4ffcc07d7d)) +* test: Log pexpect interaction to $BASHCOMP_TEST_LOGFILE if set ([5198bf5](https://www.github.com/scop/bash-completion/commit/5198bf5328fb5f6875b3b7c010e89efd6c92417a)) +* test: Pass through $HOME and $DISPLAY to test bash ([2c32433](https://www.github.com/scop/bash-completion/commit/2c3243300316d3ebff18045cb4e0f162a41a5fce)) +* test: Fixture reorganization ([c677b8e](https://www.github.com/scop/bash-completion/commit/c677b8e09bee213b6392dc4cd7364989ebb4f9a4)) +* test: Add ability to selectively ignore diffs in environment ([e575c8e](https://www.github.com/scop/bash-completion/commit/e575c8ed1e3e2f84c92c845790d50d5b31426e60)) +* test: Implement load_completion_for using assert_bash_exec ([dd9a6eb](https://www.github.com/scop/bash-completion/commit/dd9a6ebd14bec202ddf7809e2a18075e7e5bdcb4)) +* test: Convert some more test cases to pytest+pexpect ([73f05ba](https://www.github.com/scop/bash-completion/commit/73f05bad0c3db9dcee3572b8143ff13678951ad3)) +* test: Replace + with Plus in test class names ([d1c2c72](https://www.github.com/scop/bash-completion/commit/d1c2c72b9a79b97cc53b186d9c681a62f0a721c7)) +* test: Mark xfreerdp as expected failure for now ([489dc30](https://www.github.com/scop/bash-completion/commit/489dc30682529d2c2cce54f02bce8da1ec54e742)) +* test: Convert some more test cases to pytest+pexpect ([fff2fa3](https://www.github.com/scop/bash-completion/commit/fff2fa3098423cb1e2cfe52762c8fcf4a48fe5ee)) +* test: chdir to fixtures dir in Python as well ([08a89c0](https://www.github.com/scop/bash-completion/commit/08a89c08d531333966f54a70942d0c44a703856a)) +* test: Allow __load_completion to fail ([4abf2ba](https://www.github.com/scop/bash-completion/commit/4abf2bae1b5fcf58c6b981fcebf907ac83fe7107)) +* test: Sort completion results in Python for ease of use in Python tests ([f40cfe0](https://www.github.com/scop/bash-completion/commit/f40cfe0dfa40f2e7d6db68d370aa98ec2cbbd7b3)) +* test: Convert some more test cases to pytest+pexpect ([9e6ed13](https://www.github.com/scop/bash-completion/commit/9e6ed13f4936058e1042ad34558b95c1f46472c4)) +* test: Use more conventional Python file names for tests ([9c278da](https://www.github.com/scop/bash-completion/commit/9c278dada33667ff7edcfda2c21115fb8662909f)) +* test: Add support for per-test env modifications ([be3d073](https://www.github.com/scop/bash-completion/commit/be3d0735e78f1d3bc0e8eff17fcff86921bed6d4)) +* test: Don't require complete marker on test methods ([9d15992](https://www.github.com/scop/bash-completion/commit/9d1599228b07da22b6ec3ae876797ce3af1bbda8)) +* test: Fix jq and scrub skipif commands ([b7840bf](https://www.github.com/scop/bash-completion/commit/b7840bfccefe79189b782135aa85076723d72e24)) +* test: Convert some more test cases to pytest+pexpect ([ba4c972](https://www.github.com/scop/bash-completion/commit/ba4c972333bfbf86dbc94ccc9ed406b1883eb424)) +* test: Misc test suite fixes ([d1f983a](https://www.github.com/scop/bash-completion/commit/d1f983a9f5cdccaeb148b64f6887001c9182a8b0)) +* test: Convert some more test cases to pytest+pexpect ([ff1e0af](https://www.github.com/scop/bash-completion/commit/ff1e0afb01a8d4a655865cf40c0a46a25405454c)) +* test: Convert some more test cases to pytest+pexpect ([044e5da](https://www.github.com/scop/bash-completion/commit/044e5da3169137c8d777ab87cde5424430f65c66)) +* test: Misc test suite fixes ([6de89eb](https://www.github.com/scop/bash-completion/commit/6de89eb37d459d9a455ab7bb42c5fcbd97c5077c)) +* test: Convert some more test cases to pytest+pexpect ([75628f7](https://www.github.com/scop/bash-completion/commit/75628f77b481ed73120f9101e31e983057a16756)) +* test: Support setting cmd=None to require no command, for unit tests ([8884ceb](https://www.github.com/scop/bash-completion/commit/8884cebab72ae8d8ac3873d595ff501c3b54e27a)) +* test: Convert some more test cases to pytest+pexpect ([416fc05](https://www.github.com/scop/bash-completion/commit/416fc05ac24105a70f719419241fcff248827204)) +* test: Convert some more test cases to pytest+pexpect ([c85516b](https://www.github.com/scop/bash-completion/commit/c85516be79397c24ade9c12c89fd77f364f1ad46)) +* test: Use test_unit_* prefix for unit tests, to avoid name clashes ([c7b3427](https://www.github.com/scop/bash-completion/commit/c7b3427cb085d02b7559604489ded675752f58d1)) +* test: Convert some more test cases to pytest+pexpect ([d5b0d1b](https://www.github.com/scop/bash-completion/commit/d5b0d1b0a98fcea8de578a31e943d0187e4f1995)) +* test: Misc test suite fixes ([fddc36f](https://www.github.com/scop/bash-completion/commit/fddc36f36312eee100283d93baacf22a73952823)) +* test: Convert some more test cases to pytest+pexpect ([35e94b7](https://www.github.com/scop/bash-completion/commit/35e94b736a1304344a28430127bc5cae059dac63)) +* test: Misc test suite fixes ([e50dfec](https://www.github.com/scop/bash-completion/commit/e50dfeca93957f9b043538df6f7aa779d1f7f7e6)) +* test: Convert some more test cases to pytest+pexpect ([3ca2039](https://www.github.com/scop/bash-completion/commit/3ca20396fdb398c6c52956efe682c9d468da7266)) +* test: Convert some more test cases to pytest+pexpect ([451b3d1](https://www.github.com/scop/bash-completion/commit/451b3d1187547550cc382b2ee94c234dcf52d32b)) +* gccgo: Add as a GCC completion target (#227) ([ec9aefa](https://www.github.com/scop/bash-completion/commit/ec9aefa37fc9b0b53c004481402221e517a3a3ae)) +* gcc: Add g++, gcc, gccgo, and gfortran *-7 aliases ([bea1d6a](https://www.github.com/scop/bash-completion/commit/bea1d6a2419412513f11918f20fa74fd1f229403)) +* __load_completion: Avoid unnecessary lookups from nonexistent dirs ([f2b76a1](https://www.github.com/scop/bash-completion/commit/f2b76a1eb254bb6399c5d7a10bec659b691704e4)) +* unzip, zipinfo: Associate with *.whl ([df8bc32](https://www.github.com/scop/bash-completion/commit/df8bc32be0989cef6c4baaa30230848f9d1ea4ad)) +* test: Misc test suite fixes ([d1b0a75](https://www.github.com/scop/bash-completion/commit/d1b0a756a68e234b78861abf51b40f89123548d0)) +* test: Make case specific env entries shell code, not escaped ([703dcb8](https://www.github.com/scop/bash-completion/commit/703dcb860e2523f684479f73bb5caf14517d86d2)) +* test: Convert some more test cases to pytest+pexpect ([0518f62](https://www.github.com/scop/bash-completion/commit/0518f62c0c17fa48c574fe2cb915f8a75f87ab59)) +* test: Pylint fixes ([bbf6ff1](https://www.github.com/scop/bash-completion/commit/bbf6ff116f4be7236af996b014c24524513fe3e8)) +* test: Remove kill, killall remnants ([8e21442](https://www.github.com/scop/bash-completion/commit/8e214425bd53f6a7338e96b34748653abda781c2)) +* test: Mark MANPATH without leading/trailing colons test an xfail on CI CentOS 6 ([896aac9](https://www.github.com/scop/bash-completion/commit/896aac9b68cab927abf2351f4ea1041d30277156)) +* nc: Add some more option (non-)completions ([4d88339](https://www.github.com/scop/bash-completion/commit/4d88339928aa064a567d5feb40694dfd24a274c5)) +* test: Convert some more test cases to pytest+pexpect ([3f84586](https://www.github.com/scop/bash-completion/commit/3f8458652a65ad761b9b7f771385295c0cb43f73)) +* test: Pylint fixes ([1389110](https://www.github.com/scop/bash-completion/commit/13891101fc4e11b5fb9eab10b215f1caf501dc65)) +* test: Convert some more test cases to pytest+pexpect ([0db4768](https://www.github.com/scop/bash-completion/commit/0db4768883afbe01ec5f7333ee25289dee0eebd4)) +* test: Convert some more test cases to pytest+pexpect ([b6f4e50](https://www.github.com/scop/bash-completion/commit/b6f4e500b2389e92b69014cf316e521ac98c567a)) +* test: Convert some more test cases to pytest+pexpect ([23da5e6](https://www.github.com/scop/bash-completion/commit/23da5e63b7cee02e7f405f96cf8957b007abaf94)) +* firefox etc: New non-xspec completion ([ab572bb](https://www.github.com/scop/bash-completion/commit/ab572bbf1bd33785cf0c53b7c4ba87144413ea34)) +* chromium-browser, google-chrome*: New non-xspec completion ([9db48eb](https://www.github.com/scop/bash-completion/commit/9db48eb67e9a9b4479913f06b2384a6087051e81)) +* test: Convert some more test cases to pytest+pexpect ([f0f0976](https://www.github.com/scop/bash-completion/commit/f0f097642fb3aa8d91c403646367b65bddd2820f)) +* doc: Start documenting new pytest+pexpect tests ([58499ba](https://www.github.com/scop/bash-completion/commit/58499ba3c9d57ac2a08d9a8de29240e58d19de33)) +* mplayer etc: Complete on *.crdownload partial downloads in addition to *.part ([2837a48](https://www.github.com/scop/bash-completion/commit/2837a48c7954116b4e6d4e1c911798b6e54f6c68)) +* freeciv-gtk2: Install for freeciv and freeciv-gtk3, rename to freeciv ([f253e1e](https://www.github.com/scop/bash-completion/commit/f253e1e8edb4f7bd307afc5e7171e7995a4cb998)) +* freeciv: Option and arg completion updates ([fcaff16](https://www.github.com/scop/bash-completion/commit/fcaff164be94317b7cafbd05a5f5826105382df5)) +* isort: New completion ([c2dd674](https://www.github.com/scop/bash-completion/commit/c2dd6745661d886327bb79591a6c6911f6f5c3f6)) +* gnome-screenshot: New completion ([4581c6f](https://www.github.com/scop/bash-completion/commit/4581c6fe9715a57337af06648daad78d5d326d0e)) +* perlcritic: New completion ([2f8da81](https://www.github.com/scop/bash-completion/commit/2f8da814f715327db0f509c8e409e237fc9d5ff8)) +* gcc: Add g++, gcc, gccgo, and gfortran *-[568] aliases ([c9c14da](https://www.github.com/scop/bash-completion/commit/c9c14da4d32f3713b3a28e5c706f92a6f0903d35)) +* test: Remove leftover completion/ls.exp ([46ff7b3](https://www.github.com/scop/bash-completion/commit/46ff7b378430c5a3f456d2b096f9d16925f3f231)) +* tshark: update -T and -t completions ([5869351](https://www.github.com/scop/bash-completion/commit/58693518ecb561e7f7e9a0d4b6767cbf18f4238d)) +* tshark: prevent a single-character file from breaking -G completion ([8618ea5](https://www.github.com/scop/bash-completion/commit/8618ea52e48e55f04f001f0b90955b2a4a157e33)) +* tshark: support .gz and .cap files for -r expansion ([a250248](https://www.github.com/scop/bash-completion/commit/a25024815f43b99e9b77a2991ecc9ab16bfe7f41)) +* xmllint: Improve --encode, --pretty, and --xpath arg (non-)completions ([cf5fe10](https://www.github.com/scop/bash-completion/commit/cf5fe10fe03f67f6d477aef04585277fda3d3ee4)) +* chromium-browser: consider chrome and chromium as aliases ([58da331](https://www.github.com/scop/bash-completion/commit/58da33199ff84bf12ae561071a15fa825fda8487)) +* conftest: fix RemovedInPytest4Warning due to use of node.get_marker ([9249a2a](https://www.github.com/scop/bash-completion/commit/9249a2a9005a3b9c91ff6e432dd96337688254f6)) +* doc: Some pytest install clarifications ([e463b89](https://www.github.com/scop/bash-completion/commit/e463b89d600cc6a2d040556e24090a083f5c98cd)) +* test: fix flake8 complaints about unused imports ([27a9856](https://www.github.com/scop/bash-completion/commit/27a98567e3027fa006b3e4ee2702b14e5077d10d)) +* test: fix misinterpretation of completion output in tests ([85275cf](https://www.github.com/scop/bash-completion/commit/85275cf550433a90f4875845142ad93132b16820)) +* okular: Added support for xz-compressed files. ([0381d27](https://www.github.com/scop/bash-completion/commit/0381d275e085b63adf4842d0c6b3d41eeea02141)) +* hunspell: New completion ([eaecbf4](https://www.github.com/scop/bash-completion/commit/eaecbf4df704d43b27672a235e14cc3bf9d309b9)) +* op: New completion ([03ddd0b](https://www.github.com/scop/bash-completion/commit/03ddd0b4103d12b975a5a3be9c4b4627deae1e3a)) +* mypy: New completion ([12db483](https://www.github.com/scop/bash-completion/commit/12db483cdb08b4d602050f1ae63692e8d768fee2)) +* test: Convert remaining perl test cases to pytest+pexpect ([8aa8c84](https://www.github.com/scop/bash-completion/commit/8aa8c840ad636d4b31bdeaba63fb9d9a9e6c8fc1)) +* 7z: add .msi support ([d6b678c](https://www.github.com/scop/bash-completion/commit/d6b678cab235fa5b27fa4961bd4a92f19081b13d)) +* test: Convert more tar test cases to pytest+pexpect ([eaba3aa](https://www.github.com/scop/bash-completion/commit/eaba3aadf36751229b91215a24cb91bf3779ddb8)) +* dpkg: List held packages (#250) ([95042d0](https://www.github.com/scop/bash-completion/commit/95042d01826dd01340e09e948a2525a905e336d3)) +* makepkg: Use _parse_help instead of hardcoding option list ([bdbe5ef](https://www.github.com/scop/bash-completion/commit/bdbe5ef109d4942412e4f795bd29a7c79483832c)) +* test: Allow unknowns options in makepkg option completion ([9227e92](https://www.github.com/scop/bash-completion/commit/9227e920dbb35f47dcdf827e4561722ef0e8426f)) +* makepkg: Don't apply to other than Slackware makepkg ([d44e854](https://www.github.com/scop/bash-completion/commit/d44e8548cc8b8e4ee2656af7228248125de829eb)) +* locale-gen: New completion ([6176fd6](https://www.github.com/scop/bash-completion/commit/6176fd65af83cd7737d481d195030bdd0f92d1db)) +* test: Convert cancel test case to pytest+pexpect ([efd68b2](https://www.github.com/scop/bash-completion/commit/efd68b2b8b059328a7b39cc96bf4c236a0a55340)) +* cancel: Add some option arg (non-)completions ([9fcc52f](https://www.github.com/scop/bash-completion/commit/9fcc52fede350af591a9dad3295299afee5705aa)) +* cancel: Split long line ([896adae](https://www.github.com/scop/bash-completion/commit/896adaea7dbb703bb2b93879e5f293f2cf17063f)) +* test: Convert portinstall test case to pytest+pexpect (untested) ([da37fa3](https://www.github.com/scop/bash-completion/commit/da37fa341903565379523b6e85fb7626997e1879)) +* tar: Support completions for zstd compression extensions (#255) ([1d911cb](https://www.github.com/scop/bash-completion/commit/1d911cb0fe7ed2797d7ab16cd3858970b7dbae5c)) +* tar: Clean up some redundant code ([a143560](https://www.github.com/scop/bash-completion/commit/a143560f315ddfbe7c4662cba8a27b93137f425b)) +* ssh-copy-id: Add -i and -o arg (non-)completions ([f8d1280](https://www.github.com/scop/bash-completion/commit/f8d1280df57acfc1d0d49a9eb117f78cfb563ad3)) +* test suite: Ignore _scp_path_esc in env for ssh-copy-id ([84f40ab](https://www.github.com/scop/bash-completion/commit/84f40ab5dca1e70284e3bc56773b1de6a2974b68)) +* grpck: Add --root/-R arg completion ([5bd30be](https://www.github.com/scop/bash-completion/commit/5bd30be3990094f5ee6fc0468b6d24bc90465ebc)) +* grpck: Parse options with _parse_help, falling back to _parse_usage ([4f64fb0](https://www.github.com/scop/bash-completion/commit/4f64fb0d7ed7a83cd888e0f25d4050e26c20a060)) +* test: Add requirements.txt for installing dependencies ([b1192e2](https://www.github.com/scop/bash-completion/commit/b1192e26876ee01ae81b9dce2736a37beb9aeeba)) +* doc: Some test dependency doc updates ([9aaa0b8](https://www.github.com/scop/bash-completion/commit/9aaa0b80eb6798613781d8aa133975e5267eddcd)) +* _filedir_xspec: Fallback to suggesting all files if requested (#260) ([464c822](https://www.github.com/scop/bash-completion/commit/464c822ee44abb2f3d5a9f559099a303505668cf)) +* doc: Update docs on generating simple tests ([840f342](https://www.github.com/scop/bash-completion/commit/840f342d31c47debc9fdf69d6bb1733d24166608)) +* test: Expect failure in gkrellm if there's no X display ([eeb63ea](https://www.github.com/scop/bash-completion/commit/eeb63ead44b0eb28fe4c6f817a292f9a11e29436)) +* arp: New completion, somewhat incomplete ([a0d40e5](https://www.github.com/scop/bash-completion/commit/a0d40e53918a639a1550e4592871c86289badb78)) +* test: Be more consistent with "CI" env var examination and xfails ([0bfa552](https://www.github.com/scop/bash-completion/commit/0bfa5524f9ed318c5fcb44a4c73cdfb055bddc98)) +* unzip, zipinfo: Associate with *.xar (eXist-db application package) (#257) ([c263a3f](https://www.github.com/scop/bash-completion/commit/c263a3fc8ca098cb42eab88026e1ffa2fa809ec0)) +* test: Fix arp CI (non)expectations, remove redundant test case ([a7ece55](https://www.github.com/scop/bash-completion/commit/a7ece5532328f4901fa366f4ee23d9e3f7488674)) +* tcpdump: Various option and their arg completion updates ([e453c40](https://www.github.com/scop/bash-completion/commit/e453c401a9af815ea0c112f854fbca5a4e180d39)) +* doc: Note email issues gateway ([872164a](https://www.github.com/scop/bash-completion/commit/872164adb46a5c106442274d1cb9a56ecf88d723)) +* Travis: Remove unused PYTEST env var ([ff7bba7](https://www.github.com/scop/bash-completion/commit/ff7bba7eab63e32a456a97146145c08449b95ceb)) +* pydocstyle: New completion ([ebee700](https://www.github.com/scop/bash-completion/commit/ebee7008d2119c271f0ff216294b36fe9b2923c3)) +* test: Fix _count_args test_7 to test intended case ([7093e83](https://www.github.com/scop/bash-completion/commit/7093e8301852c0924dd94861e0d7ac47665bc761)) +* _count_args: Add 3rd arg for treating option-like things as args ([3809d95](https://www.github.com/scop/bash-completion/commit/3809d9558f2af6c63b675a1385f008f0ad3af388)) +* chmod: Fix file completion after modes starting with a dash ([75ec298](https://www.github.com/scop/bash-completion/commit/75ec298eaae391258da9418a55d3d47d855e5e9e)) +* .gitignore: Add pytestdebug.log ([3e9011a](https://www.github.com/scop/bash-completion/commit/3e9011aa012ef349d499f8ab96b019fe6b21e09a)) +* sysctl: Treat -f as alias for -p/--load ([76549bb](https://www.github.com/scop/bash-completion/commit/76549bb4e56bb4f968d686da52ca8b1ea46754a1)) +* xrandr: match the output name exactly for --mode ([3556fcb](https://www.github.com/scop/bash-completion/commit/3556fcbf478cbfe1ea631a98267056bb8a460240)) +* chmod: Fix "-" completion ([a269a60](https://www.github.com/scop/bash-completion/commit/a269a603207f5bf7b3a9eb17b8abeeb2159f159e)) +* _xspecs: Simplify bash version check ([ec630f5](https://www.github.com/scop/bash-completion/commit/ec630f50d62eb5599dd5c882da75681b69bf5608)) +* test: Remove some no longer used old test suite code ([a492414](https://www.github.com/scop/bash-completion/commit/a4924148f0c846cb8640fbc45e1a466058a16744)) +* tshark: Support preferences (-o) completion with memoization ([9b4098f](https://www.github.com/scop/bash-completion/commit/9b4098f748302568ff8c014f634fa822e962f029)) +* tshark: fix completion of -Xlua_script option ([50f52f7](https://www.github.com/scop/bash-completion/commit/50f52f77cf5c5339dfe7e1c3ff2991ea4a912c59)) +* test/t: Avoid trailing backslash in Makefile.am's to appease automake ([5c73b79](https://www.github.com/scop/bash-completion/commit/5c73b7948d924d48e84ea67000fdb7b07970f06b)) +* build: Include test/t in dist tarball ([698ef1d](https://www.github.com/scop/bash-completion/commit/698ef1dae56f366c729dd5c46cafc49e9fedb965)) +* test: Clean up and docker-ignore __pycache__ dirs ([a6916d6](https://www.github.com/scop/bash-completion/commit/a6916d682f5ded8e99c7918e27d6105e82cc7591)) +* test: Skip ifup options test if it doesn't grok --help, not in CI ([3780c80](https://www.github.com/scop/bash-completion/commit/3780c802fa6bdc915c4e667c003189c22d0f68bb)) +* test: Mark some xfails based on if in docker instead of in CI ([5af8f75](https://www.github.com/scop/bash-completion/commit/5af8f759b0ab7625e275873321db322c594bd750)) +* inotifywait: New completion ([8bea1ec](https://www.github.com/scop/bash-completion/commit/8bea1ec8f0e8a708bd22be5d7eddcdf37a19fcae)) +* _ip_addresses: Avoid completing ipv4 ones with -6 ([ebeecf8](https://www.github.com/scop/bash-completion/commit/ebeecf872dc0925e34177f862c371ad6e4010f08)) +* test: Convert _ip_addresses unit tests to pytest+pexpect, extend some ([186d47d](https://www.github.com/scop/bash-completion/commit/186d47dff33c8c2deea2c903dcc82f251a3d9bd0)) +* inotifywait: Avoid some false positive event names ([82a50b0](https://www.github.com/scop/bash-completion/commit/82a50b07719860a293c0dd12b53892ed3a86612d)) +* inotifywait: Fix -e completion with BSD sed ([cfa6432](https://www.github.com/scop/bash-completion/commit/cfa6432743b2107e4b7bba0ebe17a1dd8eac7ba7)) +* inotifywatch: New completion, common with inotifywait ([2aa57d1](https://www.github.com/scop/bash-completion/commit/2aa57d13202f15bf057ff5134ee6a56686032211)) +* man: Fix completion when failglob option is enabled (#225) ([b3a25cf](https://www.github.com/scop/bash-completion/commit/b3a25cfe429b8c87d9194c2d9042349ba71979c9)) +* test: Add pre_cmds support for completion fixture ([e56da98](https://www.github.com/scop/bash-completion/commit/e56da98dac7188b72c4df420c82452c438119636)) +* test: Add man failglob test case ([c1dd7f2](https://www.github.com/scop/bash-completion/commit/c1dd7f22995ba8c7c6064e47e2c557abdc2ddf78)) +* test: Rename completion.line to .output ([7d7032b](https://www.github.com/scop/bash-completion/commit/7d7032bfcfcd47f7ed3372c9c7ac95851d8402c0)) +* test: Match Python's default locale unaware sort in bash setup ([c46536a](https://www.github.com/scop/bash-completion/commit/c46536aa6e6e79764075800b5b747fea7e20bc2c)) +* test: Refactor/improve completion results checking ([0d9d375](https://www.github.com/scop/bash-completion/commit/0d9d375fed79651c8cd179df8bef032730506a5d)) +* __parse_options: Avoid non-zero exit status ([5ecb9d7](https://www.github.com/scop/bash-completion/commit/5ecb9d7e1372961f4f983b1fd0adaa273ac06bc4)) +* test: Convert remaining _parse_help unit test to pytest+pexpect ([a2c9da2](https://www.github.com/scop/bash-completion/commit/a2c9da2355e984eea8c9296e707bc77187d12b0d)) +* ifstat: New completion ([50251dc](https://www.github.com/scop/bash-completion/commit/50251dcaa79308c3926e331db944734d9aafa76e)) +* test: Fix test generation wrt results checking improvements ([39ab16a](https://www.github.com/scop/bash-completion/commit/39ab16a9be35c8942b2fa5371ea98ac1acb2a6ca)) +* iperf, iperf3: Add some option arg (non-)completions ([cd2b18a](https://www.github.com/scop/bash-completion/commit/cd2b18a53145f9f4dcca05ee583cc9b221d86f4f)) +* test: Convert remaining man test case to pytest+pexpect ([c10ece5](https://www.github.com/scop/bash-completion/commit/c10ece5f7646bbc7ffeb85943da1b45de85b8772)) +* ifstat: Make work with iproute2 version ([0b44673](https://www.github.com/scop/bash-completion/commit/0b4467343aeaab4d8760943bf26955505814b908)) +* test: Remove unnecessary autouse=True from fixtures ([cfd66c2](https://www.github.com/scop/bash-completion/commit/cfd66c236a19ec40dba7bfbf31cafff9cb537da9)) +* .gitignore: Add .python-version (for pyenv) ([2527706](https://www.github.com/scop/bash-completion/commit/2527706c0dbc65f125529101690087ad128d33ab)) +* test: Clean up man tmp dir ([e13640e](https://www.github.com/scop/bash-completion/commit/e13640eac170580211fed402473effc7f410670d)) +* test: Remove unnecessary ri xfail ([a4dd187](https://www.github.com/scop/bash-completion/commit/a4dd187c52e6270ae3dcc09c48a9f613b234f886)) +* jsonschema: New completion ([15fe639](https://www.github.com/scop/bash-completion/commit/15fe6395eb447a7e66a7aec07be2963c5f6c2131)) +* xfreerdp: Update for more modern xfreerdp ([7499fef](https://www.github.com/scop/bash-completion/commit/7499fefbd487196f78300e58f65138901862c128)) +* adb: Deprecate in favor of one shipped with the Android SDK ([479cc27](https://www.github.com/scop/bash-completion/commit/479cc270c594c3c1655519eba8745933b50d120c)) +* test: Convert remaining tar test cases to pytest+pexpect ([509878d](https://www.github.com/scop/bash-completion/commit/509878dcbc86b3528aac7b15e83203a3f7bfec38)) +* test: Fix declare test case with bash 5.0 ([89a0ed7](https://www.github.com/scop/bash-completion/commit/89a0ed758de066dec353687b6506b512f2901cf8)) +* test: Expect failure for chown all users test as non-root ([78bb3c0](https://www.github.com/scop/bash-completion/commit/78bb3c040f40bd903f7898812b3d2e95c4e7f47e)) +* xm: Deprecate completion for obsolete command (#284) ([c306a41](https://www.github.com/scop/bash-completion/commit/c306a418288d2e6cc94dac0f3f1443385405f3d1)) +* ssh: support RemoteCommand and SyslogFacility options ([8b2f90e](https://www.github.com/scop/bash-completion/commit/8b2f90e2174f8babb139097228d7923ef2ca4e90)) +* test: sort t/Makefile.am EXTRA_DIST in C locale ([17984a2](https://www.github.com/scop/bash-completion/commit/17984a2baa943b2166bc7217212dfa6d57a852d7)) +* test: rewrite "generate" in Python, fix trailing backslash in EXTRA_DIST ([7a9913f](https://www.github.com/scop/bash-completion/commit/7a9913ffa8c1508823ba05f832895d20b6a178a2)) +* xfreerdp: reinstate support for old versions with dash option syntax ([5f4f529](https://www.github.com/scop/bash-completion/commit/5f4f529ed3755a682e999d93f87dc5ac518ab51f)) +* test: remove no longer needed completion/*.exp ([2515f72](https://www.github.com/scop/bash-completion/commit/2515f726bd7195d8c80fdc8442fbd48bffe7398a)) +* test: avoid interrupting magic mark output ([1ea87c9](https://www.github.com/scop/bash-completion/commit/1ea87c99707fdc40c956560220e5a49d9e376383)) +* test: Increase expect pty to 160 columns ([b01cfe1](https://www.github.com/scop/bash-completion/commit/b01cfe1a4fed490ef1705f5c52e3c93e5187da49)) +* pytest: complete pytest-xdist --dist, --numprocesses, and --rsyncdir ([141e5e6](https://www.github.com/scop/bash-completion/commit/141e5e663789aa2243a0aa23c1bbe0b8c620e991)) +* post-commit: trigger on test/requirements.txt too ([51aa5c3](https://www.github.com/scop/bash-completion/commit/51aa5c3588fc22a3fef1313f5ed51cdce1c6a7f9)) +* test: add dependency on pytest-xdist ([eabce5b](https://www.github.com/scop/bash-completion/commit/eabce5b598b98489a831d44ec3e94b29e57926a6)) +* extra: add git pre-push hook for triggering Docker Hub builds ([7ab7a9b](https://www.github.com/scop/bash-completion/commit/7ab7a9bd418134b6c83d57f538dc5674b930e9a3)) +* test: use pytest-xdist ([0087574](https://www.github.com/scop/bash-completion/commit/0087574d5d130529c46d6c6a0b274439df652204)) +* python: make warning action list reusable ([fb0bb60](https://www.github.com/scop/bash-completion/commit/fb0bb6086864835d5bc71dfb1b43636767120267)) +* pytest: complete --pythonwarnings/-W arg ([6fad7d8](https://www.github.com/scop/bash-completion/commit/6fad7d8f411e734004a4f9b893dd32c266ed156f)) +* copyright: add 2019 ([95ae4bb](https://www.github.com/scop/bash-completion/commit/95ae4bbb17bb1ace29c4222fc7841ab69df23237)) +* _longopt: don't complete --no-* with file/dirname arg ([dd80f35](https://www.github.com/scop/bash-completion/commit/dd80f35279afd4f056dc191767b9869c9649d476)) +* nsupdate: new completion ([80ba367](https://www.github.com/scop/bash-completion/commit/80ba367c4e62c63927b2ffe6884ed9756ace5195)) +* _longopt: pick first long option on a line, not last ([54abb2e](https://www.github.com/scop/bash-completion/commit/54abb2e3c495e6732af6546b0fe41e0a5cd6922f)) +* _longopt: simplify regex, use printf instead of echo, drop unnecessary sort ([c1ec2e1](https://www.github.com/scop/bash-completion/commit/c1ec2e1b00913d9dc38e5dcf52bfbea4a2a9eff8)) +* test: add some _longopt unit tests ([6fdb0e2](https://www.github.com/scop/bash-completion/commit/6fdb0e2c3e47125ce29c2de0929d893452c2f595)) +* test: include test_unit_longopt.py in dist ([4a73043](https://www.github.com/scop/bash-completion/commit/4a73043f46be3f939c857f04673a659d8d10b0ac)) +* modprobe: append = to module parameter completions ([12d589e](https://www.github.com/scop/bash-completion/commit/12d589e705ccf8a44d4ce158c1c1c9885dce71ee)) +* dnssec-keygen: new completion ([6e008e2](https://www.github.com/scop/bash-completion/commit/6e008e200b700a303059a8c9658d3bcc79c11f98)) +* shellcheck: new completion ([fd37d6f](https://www.github.com/scop/bash-completion/commit/fd37d6f506013a42d35841b88d19851f192cf4ad)) +* ulimit: new completion ([2bf12d7](https://www.github.com/scop/bash-completion/commit/2bf12d7efb2ab73f5948d3c7868ff4c0273a71de)) +* ulimit: improvements when -a is specified ([6bc7bba](https://www.github.com/scop/bash-completion/commit/6bc7bba0315d64b1285861ad16a3f708d5437926)) +* ping, tracepath: parse options primarily with _parse_help ([09fa92d](https://www.github.com/scop/bash-completion/commit/09fa92d75e7b542c5ae601ba1fbd9c0155dbb66e)) +* modprobe: module parameter boolean values ([83b4b21](https://www.github.com/scop/bash-completion/commit/83b4b21d4075a88bd8e615b7e2da91520bd0a028)) +* bzip2: recognize *.tbz2 as bzipped ([c3e5447](https://www.github.com/scop/bash-completion/commit/c3e54476693dabecc1c8d52150001739d1404412)) +* : remove spaces immediately within $() ([90e380b](https://www.github.com/scop/bash-completion/commit/90e380b935afefbe63e4b68e4448a1bbb701696a)) +* : remove whitespace after redirections ([689beea](https://www.github.com/scop/bash-completion/commit/689beea52bd43bb45d96645f965e211351fbe579)) +* msynctool: code cleanups ([0fddd55](https://www.github.com/scop/bash-completion/commit/0fddd5512587cf717a9eb39ba422a80f8f7000e8)) +* : spelling fixes ([2a93236](https://www.github.com/scop/bash-completion/commit/2a932367917a9d7349bf049257e10840caa9c4da)) +* svn, svk, wget: use _iconv_charsets ([63257ba](https://www.github.com/scop/bash-completion/commit/63257ba4f8466fad3e4e219259554a0e8627def8)) +* : make _parse_usage fallbacks more concise ([3c10d4d](https://www.github.com/scop/bash-completion/commit/3c10d4d88015e096a0ee840d6a008508607cb81b)) +* valgrind: look up tools from libexec dirs too ([662cb72](https://www.github.com/scop/bash-completion/commit/662cb7267515ee6b26de9bea833a570a2df80be2)) +* .dir-locals.el: use flycheck-sh-bash-args ([77f2855](https://www.github.com/scop/bash-completion/commit/77f2855e10f08e9789908d7a91d42c407b67ea32)) +* : format Python code with black ([2c1a531](https://www.github.com/scop/bash-completion/commit/2c1a53114896d2f7b8bff075fd16fb811f17b311)) +* : format Perl code with perltidy ([ee73bf7](https://www.github.com/scop/bash-completion/commit/ee73bf7dce346d2ab20bd76d060c2906553c7792)) +* test: check for perltidy errors and warnings ([9be5de1](https://www.github.com/scop/bash-completion/commit/9be5de1e2ef3c9186c9cb317c12198073b50ed44)) +* test/tools: run all tools, don't stop at first failure ([4ebda77](https://www.github.com/scop/bash-completion/commit/4ebda77e88fce26e7e88abe035a6daae33a6c72a)) +* : arithmetic expression related cleanups ([834339f](https://www.github.com/scop/bash-completion/commit/834339fafabf9cab22c7708ca3c964e3fa8b769b)) +* test/tools: fix exit status incrementation ([9f4a18f](https://www.github.com/scop/bash-completion/commit/9f4a18fa20944d2cd2f30e196ddc9495c28566ac)) +* gdb: relax core filename pattern ([c59a2d0](https://www.github.com/scop/bash-completion/commit/c59a2d0950cb5b20da46598889f31bc17ac3658c)) +* _parse_help: look for long options somewhat more eagerly ([3f88944](https://www.github.com/scop/bash-completion/commit/3f88944e550b082984c71175e7a09a5f7801285e)) +* test: add some gdb non-core files ([6fa7458](https://www.github.com/scop/bash-completion/commit/6fa745848937b9714ca58cd0675d44c0f0145ea8)) +* test: port some more ssh test case to pytest+pexpect ([d2bec62](https://www.github.com/scop/bash-completion/commit/d2bec62f609e4ce4117ba74d5a81a45ad8e23369)) +* ssh: don't offer protocol v1 specific options if it's not supported ([aba5560](https://www.github.com/scop/bash-completion/commit/aba556019b7707e24093cc1c1ae082bec743ba3e)) +* : whitespace tweaks ([2f71b27](https://www.github.com/scop/bash-completion/commit/2f71b27557b196888971f2ada06f71f238939f00)) +* various: apply file vs dir special cases also when invoked with full path ([82ffbb2](https://www.github.com/scop/bash-completion/commit/82ffbb2d157bc401c0838fe98146fa89ecf8c56b)) +* phing: don't complete -l with files ([a8c4417](https://www.github.com/scop/bash-completion/commit/a8c4417ae5931fb9b172e3ff85d18e81061da8a3)) +* phing: fix getting just a tab for options on CentOS 6 ([e41f07e](https://www.github.com/scop/bash-completion/commit/e41f07e0be7aa22d19ad9f877ffe7ea5d1c99ce6)) +* : add missing "ex: filetype=sh" ([f237c25](https://www.github.com/scop/bash-completion/commit/f237c25fdf55ee1ce7076e2265ab5f80255efaaf)) +* _upvar: delete, unused ([b1a8a7d](https://www.github.com/scop/bash-completion/commit/b1a8a7d1c318d6fb2ffc5f050c887defa47ff77e)) +* Revert "_upvar: delete, unused" ([6970e6d](https://www.github.com/scop/bash-completion/commit/6970e6d62cf6ec1f6c79119843ad495b55f0d6de)) +* _upvar: deprecate in favor of _upvars ([4f35b0c](https://www.github.com/scop/bash-completion/commit/4f35b0cd7f6240addb68aa3127abe2a6dcc31411)) +* : error output consistency, use bash_completion prefix ([2a04042](https://www.github.com/scop/bash-completion/commit/2a04042d530ed5dd1b746073f8ffc059c42f3fa2)) +* : more arithmetic expression consistency ([c8c1b4d](https://www.github.com/scop/bash-completion/commit/c8c1b4da2f11f03db9665ca974fbe3d616b471b4)) +* tshark: ignore stderr when parsing -G, -L, and -h output ([7abc83e](https://www.github.com/scop/bash-completion/commit/7abc83ee03fbe61d82b568479a5c50ad543a09c5)) +* test: improve tshark -O arg completion test ([4548e71](https://www.github.com/scop/bash-completion/commit/4548e71e90bf591e537eaed2e7890fb85650cb2b)) +* tshark: speed up tshark -O completion ([b930bfc](https://www.github.com/scop/bash-completion/commit/b930bfc75af6229d456c58282e8bf80e04cfca5a)) +* apt-cache: protect showsrc against regex specials ([6e2ddea](https://www.github.com/scop/bash-completion/commit/6e2ddea986a3462070e6eafb098fc3d3f16bd835)) +* test: adjust _get_comp_words_by_ref test to changed error output ([56703df](https://www.github.com/scop/bash-completion/commit/56703df67ddfaeccb0cc2fd7f529c63527f031a0)) +* synclient: remove unused local variable "split" ([366488f](https://www.github.com/scop/bash-completion/commit/366488f2e3a806490eb1d7d6bcf674a8ea771f90)) +* mypy, mysql, xmms: don't complete unknown split long option args ([1a698d5](https://www.github.com/scop/bash-completion/commit/1a698d526c5b6747c9b40f23c1d91db421c9846b)) +* apt-get: protect source against regex specials ([22c5c3c](https://www.github.com/scop/bash-completion/commit/22c5c3c286575bd782f956e16abe4522474ae75a)) +* AUTHORS: remove unrelated project association from my entry ([8a74451](https://www.github.com/scop/bash-completion/commit/8a74451ec83af0741fff9d17003a13012fd1a00d)) +* test: shorten long gdb test core file name so tar doesn't croak on it ([e83bf9b](https://www.github.com/scop/bash-completion/commit/e83bf9b0a4e76d2ad361884a3c65eefbd685403f)) +* iptables: improve existing table arg parsing ([97a91f8](https://www.github.com/scop/bash-completion/commit/97a91f8993f45823c21fbc309c00915a0c1572e8)) +* test: add script to run shellcheck, run it in Travis, allowing failure for now ([f21c67f](https://www.github.com/scop/bash-completion/commit/f21c67f17fcc909745d59e3647398c50b2cd8eb9)) +* ebtables: improve existing table arg parsing ([996a203](https://www.github.com/scop/bash-completion/commit/996a203f07a075633baed3960763f34534ea2447)) +* test: add invoke-rc.d test case for not repeating already given options ([e0bb03a](https://www.github.com/scop/bash-completion/commit/e0bb03a588ba57a77424a19f690c1413b3de8086)) +* _included_ssh_config_files: doc grammar fixes ([bae4a3d](https://www.github.com/scop/bash-completion/commit/bae4a3d11ecb86767573c9b03aed85287a8c415a)) +* _included_ssh_config_files: store found included files in an array ([6d01267](https://www.github.com/scop/bash-completion/commit/6d012674ee28fd25f9bfa64b6409d7eb99844b61)) +* : shellcheck error fixes ([f1c32f4](https://www.github.com/scop/bash-completion/commit/f1c32f4b85227a4da5dbb6fc137a7703a4efe20a)) +* test: add make -C test case ([ea3c900](https://www.github.com/scop/bash-completion/commit/ea3c9001f42f31d49a13962586b71469aa416a4d)) +* make: quote eval array definitions to work around shellcheck SC1036 bug ([abe266c](https://www.github.com/scop/bash-completion/commit/abe266ce4d26c37cf8ad681136cc8fd7edd28d4e)) +* ri: shellcheck error fixes ([d45f9fa](https://www.github.com/scop/bash-completion/commit/d45f9faf432947ecf0e178d8be50f4c3163c2b4c)) +* travis: fail on shellcheck errors ([e146ef5](https://www.github.com/scop/bash-completion/commit/e146ef59c53ce311fb1f30f06499aa3c91ffb3f1)) +* travis: don't fail DIST != tools ([a3129ac](https://www.github.com/scop/bash-completion/commit/a3129ac624adf390b072f63f98c6f8be552b0415)) +* travis: run shellcheck on bash_completion.sh.in too ([0eebaef](https://www.github.com/scop/bash-completion/commit/0eebaef0a4296bf0c37c8fcdd0931701b25abb88)) +* tar, valgrind: avoid some herestrings ([3d3905c](https://www.github.com/scop/bash-completion/commit/3d3905cbb8232091c3b656567a843b97b8bc6e11)) +* test: make runLint search for herestrings ([8510da8](https://www.github.com/scop/bash-completion/commit/8510da8fb20658fbb18f3f0744214ddfc473f542)) +* test: move default shell option from run-shellcheck to .shellcheckrc ([4dc8da5](https://www.github.com/scop/bash-completion/commit/4dc8da5db79dd7d79312cdd139ab0422eb6fb532)) +* shellcheck: disable bunch of warnings when in "-S warning" mode ([a36f57f](https://www.github.com/scop/bash-completion/commit/a36f57f922d461558064be39f8cfb64288f64cbf)) +* arp, ccze, ifstat, inotifywait, makepkg: invoke sed with "command" ([5ff11ce](https://www.github.com/scop/bash-completion/commit/5ff11ced5729f9258b75b633fc366360b277cf4c)) +* __parse_options, 7z: avoid herestrings ([ff5fb58](https://www.github.com/scop/bash-completion/commit/ff5fb5864dc41629f216dbea0a1fbf892ded4e66)) +* CONTRIBUTING: note runLint and run-shellcheck ([07408a6](https://www.github.com/scop/bash-completion/commit/07408a6b3974c442f35dedf46ef49292b8664166)) +* CONTRIBUTING: add upstream vs bash-completion considerations ([34fb914](https://www.github.com/scop/bash-completion/commit/34fb91447ff9a92e8976732f042ba20cfa615326)) +* doc/testing: remove lots of legacy info, add some new ([d31f2c9](https://www.github.com/scop/bash-completion/commit/d31f2c9adbcab984754ecd93b44778e1e7a673d8)) +* xvnc4viewer: code cleanups ([3e193ed](https://www.github.com/scop/bash-completion/commit/3e193edea316461c2bf5d799ca90cce9c056e301)) +* ssh: fix suboption completion with combined -*o ([8d2c976](https://www.github.com/scop/bash-completion/commit/8d2c976c11e379f28430f1ae15be3764755dcffb)) +* ssh: make option completion case insensitive ([0984db6](https://www.github.com/scop/bash-completion/commit/0984db6747e3f3ef1e73cdadc4447b6cb091cc83)) +* ssh: make -o protocol completion less hardcoded ([73d8304](https://www.github.com/scop/bash-completion/commit/73d830445339df51eba37129c0151a250d290d84)) +* 7z: add some TODO notes on parsing "i" output for extensions ([7748282](https://www.github.com/scop/bash-completion/commit/7748282e1bff081b0507b09146cbbafab3c8cb1a)) +* : avoid shellcheck SC1010 ([a3aa845](https://www.github.com/scop/bash-completion/commit/a3aa84519e338d246925bf816b12f96224ba47ad)) +* : avoid shellcheck SC1007 ([659805b](https://www.github.com/scop/bash-completion/commit/659805bd2a834d2e58075b1807083eef54aa73fb)) +* dist: include various *.in explicitly ([f2f8c7b](https://www.github.com/scop/bash-completion/commit/f2f8c7b3c69039c0f1fe09e33c85c1075bdd409c)) +* test: use parallel make in docker test ([8efece6](https://www.github.com/scop/bash-completion/commit/8efece6123393c07c127375c9f754407d7702a20)) +* test: use $(RM) ([72b47aa](https://www.github.com/scop/bash-completion/commit/72b47aacefae825b670a1892665b74a6b690194e)) +* test: group dejagnu related stuff in one place in Makefile ([ce95fe4](https://www.github.com/scop/bash-completion/commit/ce95fe40fd88a2c425aece0b69544cc989da0b3e)) +* test: run pytest tests with make check ([5a53bc1](https://www.github.com/scop/bash-completion/commit/5a53bc1c24c672f774fde210c8bdd2f26992a58b)) +* test: run distcheck in docker, ditto test suite driven by it ([bdf40aa](https://www.github.com/scop/bash-completion/commit/bdf40aab2528d0c32a7fad97d3a1156b042ff81c)) +* test: add fixtures/make/extra_makefile to CLEANFILES ([47fc6d7](https://www.github.com/scop/bash-completion/commit/47fc6d7c217326aed607e21c8525084f3f0f6118)) +* travis: reindent with 2 spaces by usual convention ([54030ad](https://www.github.com/scop/bash-completion/commit/54030ad7738689d0709648e48d0177a1c9d00014)) +* travis: deploy release dist tarball to github ([8d91ee2](https://www.github.com/scop/bash-completion/commit/8d91ee269e4086cc1d3550865b3f9533796717b3)) + +## 2.8 (2018-03-17) + +* test suite: Limit number of screen -T completion matches ([1c5d13e](https://www.github.com/scop/bash-completion/commit/1c5d13ee8c60cc2ef22751d9e876296be731d749)) +* test suite: Support overriding default match buffer size (#141) ([e6a56b9](https://www.github.com/scop/bash-completion/commit/e6a56b97e05d5df29f61b0e23650a65f1492f1fb)) +* lftp: Support ~/.local/... bookmark location (#144) ([1e347ee](https://www.github.com/scop/bash-completion/commit/1e347eef6a9de89855aba8a8b92f25be1fe18c17)) +* test suite: Limit amount of output from process name completion ([f206607](https://www.github.com/scop/bash-completion/commit/f206607cbde36b46473a11cce9b3ebfd75ec36f4)) +* ktutil: Don't leak i and command environment variables ([fb8e5aa](https://www.github.com/scop/bash-completion/commit/fb8e5aa106463cf0ef3a5920010d4805ae22e985)) +* test suite: Add bunch of missing basic test cases ([ca61c5e](https://www.github.com/scop/bash-completion/commit/ca61c5e60eb422fd90ef940fec3aceba4a6a5dff)) +* uscan: Don't leak cword and words environment variables ([0ab85ec](https://www.github.com/scop/bash-completion/commit/0ab85ec0a4177bee07253eacac1faa072ff64ff9)) +* xm: Don't leak args and commands environment variables ([29fd200](https://www.github.com/scop/bash-completion/commit/29fd2001928af49898184b9ada988f63f924a097)) +* test suite: Enable wine in ubuntu14 ([9ccc3db](https://www.github.com/scop/bash-completion/commit/9ccc3db8834168b7af65e76ef320dda01b38046e)) +* test suite: Install aptitude in ubuntu14 container ([1fc5d30](https://www.github.com/scop/bash-completion/commit/1fc5d3022333fa08d3fbb5bc4995cf5acbaf7e7b)) +* aptitude-curses: Use aptitude completion ([c8d40ea](https://www.github.com/scop/bash-completion/commit/c8d40eab48735c0ef601b2a227d42594b7511e24)) +* groupdel: Parse and handle long options ([e987744](https://www.github.com/scop/bash-completion/commit/e987744d342812185d675ea428a197de7394051b)) +* curl: Fix -x etc option argument hostname completion ([3708590](https://www.github.com/scop/bash-completion/commit/3708590603920a6e67be0df3f22924e4ea236fc9)) +* : Protect _known_hosts_real from user input treated as options ([8706bc1](https://www.github.com/scop/bash-completion/commit/8706bc1d70873698d0d456254f415322343f6b03)) +* aptitude: Add keep to commands list (Debian: #867587) ([5ed2fc4](https://www.github.com/scop/bash-completion/commit/5ed2fc4a9a604c780da48e87964d4ac21fc7a85d)) +* test suite: Add basic hid2hci and munin-node-configure test cases ([c498655](https://www.github.com/scop/bash-completion/commit/c4986556555f5a6f45761ad2fdc3a1a2623f5b76)) +* test suite: Add info and pinfo option test cases ([deba602](https://www.github.com/scop/bash-completion/commit/deba602bec10e4dda56ebe2908404e13ebd1286d)) +* test suite: Limit amount of info and pinfo test output ([bb8645b](https://www.github.com/scop/bash-completion/commit/bb8645b5ff71e532de2bc9678f6e77d7009b0b37)) +* : Protect shopt reset from non-default $IFS ([5240618](https://www.github.com/scop/bash-completion/commit/5240618033fecc3032a421d39c2eaeb2e4c20d57)) +* alias: Fix completion followed by = (#146) ([2f21940](https://www.github.com/scop/bash-completion/commit/2f2194011db46beaa4e9eb44705bc6a8a08c56ab)) +* oggdec: New completion ([0dc16d3](https://www.github.com/scop/bash-completion/commit/0dc16d38076cdea90a00d7e346ab545e88abf1d5)) +* Add support for .lzo extension (--lzop) to tar (#155) ([49a8dd8](https://www.github.com/scop/bash-completion/commit/49a8dd857628807460468db92a38233c50c83196)) +* Add support for .lz4 extension to file-roller (#158) ([5268e43](https://www.github.com/scop/bash-completion/commit/5268e43824773ccaf6c3cd48d1d4a5185a6a11d0)) +* lsusb: New completion ([4e323d9](https://www.github.com/scop/bash-completion/commit/4e323d9a71e9bbd1c4432c3ade3794073a88d3d7)) +* lspci: New completion ([ea3d2b2](https://www.github.com/scop/bash-completion/commit/ea3d2b249413aeda28b51e7eaf545be243c0684a)) +* test suite: Skip fedoradev GPG checks at least for now ([2ef9387](https://www.github.com/scop/bash-completion/commit/2ef9387bc4628e4c5203a63f14b66d5765763589)) +* test suite: Drop no longer needed fedoradev /usr/bin/which workaround ([53feba3](https://www.github.com/scop/bash-completion/commit/53feba31e9b49340605304258e18ff06baacaa22)) +* vpnc: Improve config completions ([c695083](https://www.github.com/scop/bash-completion/commit/c695083125fb6ce4f944039fc94745a1a33d30cf)) +* vpnc: Add some option argument (non)completions ([0086850](https://www.github.com/scop/bash-completion/commit/0086850c28c41cb383249ba47d44edb8b3ec3b53)) +* iptables: Parse options from --help output ([0bdc11d](https://www.github.com/scop/bash-completion/commit/0bdc11d8c9838abf055fc7403fa9739eb5d29820)) +* iptables: Avoid stderr trashing when invoked as non-root ([c8c61f7](https://www.github.com/scop/bash-completion/commit/c8c61f70f9f2cee5b9f7f6276a52af1424dbc380)) +* iptables: Use invoked command instead of hardcoded "iptables" ([1b5c6e8](https://www.github.com/scop/bash-completion/commit/1b5c6e87e4517326c778dd67ba174828f2f40697)) +* README.md: Whitespace cleanup ([a6e3655](https://www.github.com/scop/bash-completion/commit/a6e3655747120aa1782a17b414ffc2e6f80c8b64)) +* ebtables: new completion (#150) ([334b47c](https://www.github.com/scop/bash-completion/commit/334b47cf663c5d7c8f197970a340e745f47cd55f)) +* test: Use prebuilt docker hub bash-completion images ([ecaec9a](https://www.github.com/scop/bash-completion/commit/ecaec9a86470c6d6299a6522c0fddde44ff0b5f6)) +* rfkill: Rename to _rfkill to avoid conflict with util-linux >= 2.31 ([d962f3a](https://www.github.com/scop/bash-completion/commit/d962f3a3be2b5c3811e546890c99b19694c2a08e)) +* test suite: man cleanup ([c8ff683](https://www.github.com/scop/bash-completion/commit/c8ff6833a9f113d9feb29f750ae638436f64cbf3)) +* test suite: Make man test subject names less generic ([78f4cec](https://www.github.com/scop/bash-completion/commit/78f4cec642381e7bfe25c22c8c7fde15775431e7)) +* test suite: Add bunch of man and MANPATH test cases ([3b2fd04](https://www.github.com/scop/bash-completion/commit/3b2fd04caa12b720d941d27b751e76a32af8290e)) +* man: Don't use $MANPATH directly (#161) ([e6a4715](https://www.github.com/scop/bash-completion/commit/e6a471511dfdc230ff3eed65ccba09b6d7d30262)) +* unzip, zipinfo: Associate *.gar (#165) ([e5ee408](https://www.github.com/scop/bash-completion/commit/e5ee408a5aee2f1c9d898150e256540d020fc5ee)) +* pylint: Install for pylint-2 and pylint-3 too ([fee4f3d](https://www.github.com/scop/bash-completion/commit/fee4f3d6c97c4cc48650533d96c16faa71171b39)) +* pylint: Invoke python3 to search for modules if command contains 3 ([d63b33d](https://www.github.com/scop/bash-completion/commit/d63b33d415bf3103daa2aaeead9860084da0d8f3)) +* tox: New completion (#163) ([89fb872](https://www.github.com/scop/bash-completion/commit/89fb872bcf9b6cc508a8079a7d203d31a2694620)) +* tox: Avoid stderr spewage when -e invoked without tox.ini ([1ac8895](https://www.github.com/scop/bash-completion/commit/1ac88953a8a81d7509648ebe9f8751319bca3609)) +* tox: Include ALL in -e completions ([9678f55](https://www.github.com/scop/bash-completion/commit/9678f55dabe921b62dd848bfa38b4d1ffffc21ca)) +* tox: Remove spurious executable bits ([609ed0d](https://www.github.com/scop/bash-completion/commit/609ed0de65732f9442a9c17d12ba88c0ba855cef)) +* xdg-settings: New completion ([6cf792b](https://www.github.com/scop/bash-completion/commit/6cf792bf3dffcafdfb5765bd0b300e3c10ace9e2)) +* test: run bash with --norc to avoid system bashrc ([77ea9fc](https://www.github.com/scop/bash-completion/commit/77ea9fc444db7d240cffc2cbf1b38f0b12075aed)) +* test: Add some comments regarding bash init in library.exp ([215301d](https://www.github.com/scop/bash-completion/commit/215301dfb869b803b1dbada879d8e37ca6641e41)) +* test: Remove things moved to library.exp from bashrc ([6495d88](https://www.github.com/scop/bash-completion/commit/6495d886d8e86ef8f54cc0aacbd08838482e6d58)) +* Whitespace ([3fa189e](https://www.github.com/scop/bash-completion/commit/3fa189ee0b4be4da9aa8c9ac34ddead27e74f861)) +* test: Add files to test older ri with ([a85f96c](https://www.github.com/scop/bash-completion/commit/a85f96c75dc81ee1e5a24433ac7741d414a77c0b)) +* ri: Fix integrated ri 1.8 class completion ([9035568](https://www.github.com/scop/bash-completion/commit/903556864dc366c55ce2904821ef31a4920babb4)) +* apt-get: Complete *.deb on install if argument contains a slash ([a36231e](https://www.github.com/scop/bash-completion/commit/a36231e81eaeb272777abe581dce06e988f219a3)) +* reportbug: Add -A/--attach arg completion ([339abbb](https://www.github.com/scop/bash-completion/commit/339abbbaa07c824a278fc1e836e25b335b314676)) +* reportbug: Don't hardcode option lists, split option args at = ([1d44276](https://www.github.com/scop/bash-completion/commit/1d4427621185a6f005232c6d769109dadd46f795)) +* ssh-keygen: Add -E arg completion ([3807a99](https://www.github.com/scop/bash-completion/commit/3807a996dbf8f4a94c4cb1be5861c0f228584225)) +* xdg-mime: New completion ([24e7c26](https://www.github.com/scop/bash-completion/commit/24e7c266748b575358f978a73b0b5ff02a5868ed)) +* test: dpkg,ls,_tilde: Skip gracefully if no uniq user for completion is found ([95a04fe](https://www.github.com/scop/bash-completion/commit/95a04feab494e55c14de866e02a8a8bfbae398ec)) +* test: Ignore duplicates in find_unique_completion_pair list ([d2f14a7](https://www.github.com/scop/bash-completion/commit/d2f14a7b7504d05d9cbdd048cf546fb55fbbfbd8)) +* ssh: Declare $prefix closer to use ([2516a25](https://www.github.com/scop/bash-completion/commit/2516a257081be11b49a3755358d1ca39463b7162)) +* ssh: Add -J/ProxyJump completion ([cc6667e](https://www.github.com/scop/bash-completion/commit/cc6667e293c670b04b0d827d16935681b9de7083)) +* _known_hosts_real: Document -a better ([693282c](https://www.github.com/scop/bash-completion/commit/693282caaa206676fc4d1d17713877d630b07d65)) +* nproc: New completion ([cb7877c](https://www.github.com/scop/bash-completion/commit/cb7877caa89184e28ae7b6b58d1d1c42abdeb9d1)) +* getconf: New completion ([55ed68d](https://www.github.com/scop/bash-completion/commit/55ed68dab30d66dce7be89e6e4a8fc846cbe4044)) +* pv: New completion ([f6f5f4f](https://www.github.com/scop/bash-completion/commit/f6f5f4f1fe8e225e06ca5174e6e36899a7baf81c)) +* cryptsetup: Update option lists ([89d1a3f](https://www.github.com/scop/bash-completion/commit/89d1a3fe4a0e0e977244c43be399cb13890bff45)) +* dpkg: Add -V/--verify arg completion ([bb0a82f](https://www.github.com/scop/bash-completion/commit/bb0a82f3dc5d60561362c8259eb9a4bbdac701bd)) +* lowriter,localc etc: Use corresponding oo* completions ([fbd52a5](https://www.github.com/scop/bash-completion/commit/fbd52a5e31747beb4974da97b9d3ed4f6ceb7a61)) +* perltidy: New completion ([9cddfdf](https://www.github.com/scop/bash-completion/commit/9cddfdf1b777e028a9dbf32b442a3ce2629d20cf)) +* flake8: Various option arg completion improvements ([15389e6](https://www.github.com/scop/bash-completion/commit/15389e66c92d61a4a1de593dd4017d76d7e2a0ef)) +* pycodestyle: New completion ([0de48aa](https://www.github.com/scop/bash-completion/commit/0de48aa77f2b84ed409d983279f8b1334242de2f)) +* travis: Don't build local docker images, use vskytta/bash-completion ones ([f1a1e14](https://www.github.com/scop/bash-completion/commit/f1a1e14092db8613d0274a37073f078c1689a94e)) +* test: Work around broken centos/fedora postfix config in non-IPv6 setup ([5db0365](https://www.github.com/scop/bash-completion/commit/5db036505cb9d50651b4e5035e040435256dfffc)) +* test: Add "postconf -" test case ([ac73726](https://www.github.com/scop/bash-completion/commit/ac73726de7421a4a61ba46a2c30795c9080dc24a)) +* Revert "travis: Don't build local docker images, use vskytta/bash-completion ones" ([ac9c468](https://www.github.com/scop/bash-completion/commit/ac9c468c9375289effa39741c048c6aa154164e1)) +* test: Try to skip postconf variable test on broken postfix configs altogether ([4ba2e73](https://www.github.com/scop/bash-completion/commit/4ba2e73104a323143a8060ef4e1e5098a183e445)) +* test/docker: Tweak work dir, add bash as default cmd ([e0a4385](https://www.github.com/scop/bash-completion/commit/e0a438549221ed4e8be0b6e5487bc5f62c2479ca)) +* python: Support completing dotted module hierarchies ([db9f81b](https://www.github.com/scop/bash-completion/commit/db9f81be1673d432afeb85fce8a35e93d9e48643)) +* lsscsi: New completion ([079b7ac](https://www.github.com/scop/bash-completion/commit/079b7ac19124e1d59db176465d7b7ca65884f7d1)) +* radvdump: New completion ([5b3e79e](https://www.github.com/scop/bash-completion/commit/5b3e79e25df9c6d50eb23d465008a71bbac7dbfd)) +* java: Complete *.war ([c1912bf](https://www.github.com/scop/bash-completion/commit/c1912bfd080d4eadba8bc81754ba7b2723115d78)) +* ssh,ssh-add,ssh-keygen: Complete pkcs11 options with *.so ([0fb4ae2](https://www.github.com/scop/bash-completion/commit/0fb4ae2fea44b857f854af8b02c838fbbb1700aa)) +* kldunload: Show modules with digits ([6f17a85](https://www.github.com/scop/bash-completion/commit/6f17a85fad28c0770bb4fe704c2ed5e92e242029)) +* kldunload: Increase robustness of compgen filters (#185) ([e2193c7](https://www.github.com/scop/bash-completion/commit/e2193c771a4b3284fc0e50593902d9edbf60d8c1)) +* _known_hosts_real: Add option to filter IPv4 and IPv6 addresses ([0c40185](https://www.github.com/scop/bash-completion/commit/0c40185fcf70ba6f7dfddbc3933bcab22a339c46)) +* ping*,ssh,scp,sftp,tracepath6: Filter IPv4/IPv6 literal addresses ([b547f22](https://www.github.com/scop/bash-completion/commit/b547f2231a1d6c588bf425e5cd1f0bb6012fc562)) +* geoiplookup: New completion ([7c7dfe8](https://www.github.com/scop/bash-completion/commit/7c7dfe8b1c4b98cea0b7b4fc254207f16651eb87)) +* xdg-mime,xdg-settings: Fix inclusion in tarball ([3e9e03b](https://www.github.com/scop/bash-completion/commit/3e9e03ba3494668cbe663f36231445e15c2f005f)) +* tox: Complete comma separated -e arguments ([eb8a7e7](https://www.github.com/scop/bash-completion/commit/eb8a7e760088cc0fc15f9f1310092e6ac85738f2)) +* mplayer: Disable user config when parsing options ([df36cae](https://www.github.com/scop/bash-completion/commit/df36cae3f85fbf2c386560f4e2da62bb7a67196b)) +* test suite: Some more mplayer and mencoder coverage ([c71f5fc](https://www.github.com/scop/bash-completion/commit/c71f5fcf25ef321074a9f0b215784b0e28c37058)) +* : Comma separated opt arg completion improvements ([021058b](https://www.github.com/scop/bash-completion/commit/021058b38ad7279c33ffbaa36d73041d607385ba)) +* xine etc, ogg123, mplayer -audiofile: Associate with *.oga ([b102367](https://www.github.com/scop/bash-completion/commit/b10236717bae7e1a072031fa9cbf0006b66b4057)) +* dpkg: Fix man page section in comment ([e16b320](https://www.github.com/scop/bash-completion/commit/e16b320ae1eb898f45f7eb891d036c059a2c0040)) +* dpkg: Complete --vextract on deb files ([facefd6](https://www.github.com/scop/bash-completion/commit/facefd6dd0ea0aab8005c8a42ef125e594ed637d)) +* dpkg-query: Fix -W/--show completion ([78cdbe1](https://www.github.com/scop/bash-completion/commit/78cdbe1bb8f7ab597a020a1c606154ccd4e39eea)) +* ccze: New completion ([e858751](https://www.github.com/scop/bash-completion/commit/e858751feb53ca76b48bc9cbd1e4021044c0c34d)) +* make: Pass script to sed as parameter instead of using process substitution ([153d6d4](https://www.github.com/scop/bash-completion/commit/153d6d4fab1faafbd33fccb0ba8a99964f05a95b)) +* openssl: Add completion for the genpkey, pkey, pkeyparam, and pkeyutl commands ([19759ad](https://www.github.com/scop/bash-completion/commit/19759ad14d825896997f70fb37a9f34b98a28903)) +* _avaiable_interfaces: Get rid of eval ([edb7d59](https://www.github.com/scop/bash-completion/commit/edb7d599242a184769a3aed2a7167c354cab6033)) +* __load_completion: Code cleanup ([5e69954](https://www.github.com/scop/bash-completion/commit/5e69954bd1dd6e346d1cb1e44a6d5b03d2c106fb)) +* __load_completion: Load "xspec" completions dynamically too ([e6781be](https://www.github.com/scop/bash-completion/commit/e6781bebfff6da5e3b5ce244c103e35d06dee9c6)) +* mkdir: Complete on files in addition to dirs ([dbb3870](https://www.github.com/scop/bash-completion/commit/dbb38708e39bc8cb463ccaab294b5d1ae1e173f6)) +* mkdir: Complete files without appending space ([b0babf8](https://www.github.com/scop/bash-completion/commit/b0babf873b21eb2f1d936e6e2288b451c1a58778)) +* Bump copyright years to -2018 ([e306ffd](https://www.github.com/scop/bash-completion/commit/e306ffda0e8e9eb38ea676f7d0916d68d0cb87f3)) +* __expand_tilde_by_ref: Eval tilde expansion only, simplify ([21f410a](https://www.github.com/scop/bash-completion/commit/21f410a860c20ab79a9afebcf8a0ca8f7fba9d08)) +* dd: Omit space only when offering one completion ending with = ([cea7cce](https://www.github.com/scop/bash-completion/commit/cea7cce326235531fa36c2e10a2b907b266186a2)) +* dd, find, gcc: Remove unnecessary tilde expansion ([6927248](https://www.github.com/scop/bash-completion/commit/692724843c93fdbf4f253f26c62ad1a9334f73f1)) +* test: Add assert_complete_homedir, use in dpkg and ls ([ec85ac4](https://www.github.com/scop/bash-completion/commit/ec85ac48e3a38360c86d89abb8fe6ed7ea2568fc)) +* bzip2, gzip, and other compressors: Use _tilde instead of _expand ([3c4fc36](https://www.github.com/scop/bash-completion/commit/3c4fc36fd65f414960b5ad1c17bb88f720bca20b)) +* test: Add some _expand unit tests ([3b8dfd3](https://www.github.com/scop/bash-completion/commit/3b8dfd34709d621d928a61fb04a811a96fb15c03)) +* _expand: Reuse __expand_tilde_by_ref and _tilde logic, clean up ([6365265](https://www.github.com/scop/bash-completion/commit/63652650a4f43938e2b7195084ad03cf4e93ff36)) +* info, man, rsync: Defer _expand invocation ([add4e3c](https://www.github.com/scop/bash-completion/commit/add4e3cd443da011e8302b5d1fcfb5673d850f7a)) +* test/unit: Whitespace tweaks ([69c318a](https://www.github.com/scop/bash-completion/commit/69c318a339901699b430af699145a8ff62394894)) +* test: Fix getting username in non-login shells ([6ae330f](https://www.github.com/scop/bash-completion/commit/6ae330f1ab90f15d97477a8c254dd29f166ecdb6)) +* make-changelog.py: Use python3 ([5f1d238](https://www.github.com/scop/bash-completion/commit/5f1d2381a54dc236b0419e78f1a733f2d033ed93)) + +## 2.7 (2017-07-01) + +* pdfunite: New *.pdf completion ([65239a9](https://www.github.com/scop/bash-completion/commit/65239a91a4fface3f1b183b17c79548916461077)) +* test suite: Fix __expand_tilde_by_ref test expectation output ([ff2afaf](https://www.github.com/scop/bash-completion/commit/ff2afaf4f8a89411b65e0f035509db1b6372e292)) +* Makefile: update default compatdir (#132) ([00a7b9f](https://www.github.com/scop/bash-completion/commit/00a7b9fb79ece368064cce41a74be5dd56f6b266)) +* pyflakes: Remove redundant xspec completion ([0a32296](https://www.github.com/scop/bash-completion/commit/0a32296840e928d25729a8661cd4d7196db3479e)) +* test suite: Generalize xspec completion install check ([1a7137f](https://www.github.com/scop/bash-completion/commit/1a7137fdf61a50a1ada5fe8cd3ae5c9dafddedc1)) +* Make user completion file configurable, disable in tests ([d231255](https://www.github.com/scop/bash-completion/commit/d231255201468e0b5a79c28d9a0e4b246dfeec90)) + +## 2.6 (2017-06-27) + +* xine etc: Associate *.webm and *.weba (#112) ([eee71d2](https://www.github.com/scop/bash-completion/commit/eee71d240feacbce8fe3dcde4fe9d8f730849d7f)) +* mplayer: Associate *.weba (#112) ([82dbb85](https://www.github.com/scop/bash-completion/commit/82dbb853bb2bfb720ece29f2fe806ee8f3695b52)) +* xine etc: Associate uppercase *.WM[AV] ([7250d5b](https://www.github.com/scop/bash-completion/commit/7250d5b721c37b507127285b94a1083de379dfdc)) +* Add missing sidedoor to .gitignore (#114) ([440f65c](https://www.github.com/scop/bash-completion/commit/440f65ce444c00519bc9fa6b5a87fbd4f10a2e67)) +* Bump copyright years ([922bc58](https://www.github.com/scop/bash-completion/commit/922bc58693ad5254142b7aed9a160f2291ddf087)) +* eog: Associate with *.j2c and *.jpg2 ([c91b36d](https://www.github.com/scop/bash-completion/commit/c91b36dd8cd31ea95a952c1fd858d1f3738f3998)) +* xv: Associate with *.j2c, *.j2k, *.jp2, *.jpf, and *.jpg2 (Debian: #859774) ([0de9b7b](https://www.github.com/scop/bash-completion/commit/0de9b7b086574213d21b28c25d1bd5d517880ba0)) +* Travis: Switch tests to docker, update to Ubuntu 14 ([82d85c1](https://www.github.com/scop/bash-completion/commit/82d85c1380707461ad8511b95349d8a56b9961ea)) +* test suite: Add WIP Fedora dev config ([6ed2857](https://www.github.com/scop/bash-completion/commit/6ed285773db08b1200a5063a58a9c0cce9f94c53)) +* synclient, udevadm: Avoid use of posix char classes for awk ([2abecdc](https://www.github.com/scop/bash-completion/commit/2abecdc60e06aebc397a7eb62ae053d34fc68315)) +* ssh-keygen: Make option parsing work with OpenSSH < 7 ([375bd17](https://www.github.com/scop/bash-completion/commit/375bd174aa5750b98c2a01fd3a42b669a7fefb9d)) +* (docker): Run completion tests with xvfb-run, e.g. for gkrellm ([c8f5dac](https://www.github.com/scop/bash-completion/commit/c8f5dac01ee1cd26452bc7e67c75a86924a272e4)) +* tshark -G: Avoid stderr noise when running as superuser ([ea6377d](https://www.github.com/scop/bash-completion/commit/ea6377d2b03be91d6af2fc11c6581eb7aafa1ec4)) +* (test suite): Fix mmsitepass completion test ([596d961](https://www.github.com/scop/bash-completion/commit/596d961152b94fa45470e565d9adf2c3997011c1)) +* mr: Avoid stderr trash and test suite failure if man is N/A ([be12bb2](https://www.github.com/scop/bash-completion/commit/be12bb2514730576ce170a1e7c1f136e20f0f385)) +* (docker): Pull in missing fedoradev xvfb-run which dependency ([e468e44](https://www.github.com/scop/bash-completion/commit/e468e44b32092531dfd3f3c764dccaa5cad1ccb2)) +* (test suite): Don't assume lists set up in newlist test cases ([a9494fe](https://www.github.com/scop/bash-completion/commit/a9494fe4501067388783a6dc454ebe5c2413d3b6)) +* (test suite): Delete trailing whitespace ([ca64e75](https://www.github.com/scop/bash-completion/commit/ca64e755f13b64b1eaec0f4233ff6286e11f68b2)) +* newlist: Parse options from --help, add some arg non-completions ([472db27](https://www.github.com/scop/bash-completion/commit/472db27ae1c5869f7a2b84fb8a1597229d4807a2)) +* (test suite): Don't assume mounted filesystems in quota* tests ([a9fc3dc](https://www.github.com/scop/bash-completion/commit/a9fc3dc7766f0415acb4aba3d14776c97e5ea9fc)) +* (test suite): Make chkconfig test behave better in container ([fcaac9a](https://www.github.com/scop/bash-completion/commit/fcaac9ac97dc963d87023fe4fda32c722677bfee)) +* (test suite): Unsupport various kill, renice cases if ps is N/A ([b5d81bf](https://www.github.com/scop/bash-completion/commit/b5d81bf4479c6454822f21537ec7aa47d592ed39)) +* (test suite): Fix tar test case for ones having --owner-map ([b719ee2](https://www.github.com/scop/bash-completion/commit/b719ee2f27393008f2f6dc5722241f118e822906)) +* (test suite): curl has lots of options, add more test prefix ([4698dbe](https://www.github.com/scop/bash-completion/commit/4698dbe5ccc807333b4128aa1463a90062167ee5)) +* (test suite): Fix perl -d* test cases with no Devel::* installed ([9941b3d](https://www.github.com/scop/bash-completion/commit/9941b3d63d35913e44e41a7b1a05c449543f7fda)) +* (test suite): Ensure /usr/(local/)games is in $PATH ([fda9c43](https://www.github.com/scop/bash-completion/commit/fda9c43c233e16380704ae0ed6500fa91c38b167)) +* (test suite): Add bunch of packages to ubuntu14 container ([ffeb91a](https://www.github.com/scop/bash-completion/commit/ffeb91a28bee72038215d968a1f9237a8ad0599e)) +* (test suite): Add our ./configure to PATH to test it, test opts ([07cbd0d](https://www.github.com/scop/bash-completion/commit/07cbd0df40629a4b0da1eb1ccaf201e7aba1463a)) +* (test suite): Add basic hping3 test case ([9f2efc5](https://www.github.com/scop/bash-completion/commit/9f2efc525d76db97b8bbf702c7b8f243451e5bf7)) +* (test suite): Test lsof on ubuntu14 ([db40d50](https://www.github.com/scop/bash-completion/commit/db40d5084e781399a5b1276caf8a5a43315ab7b2)) +* unshunt: Parse options from --help ([a7caf57](https://www.github.com/scop/bash-completion/commit/a7caf57cc49feae235cc15daa4bdf5b3d7e4a491)) +* (test suite): Install jshint to ubuntu14 container with npm ([4813904](https://www.github.com/scop/bash-completion/commit/48139045355dd9ddee5e67938f6e61123542d7ee)) +* (test suite): Add mailman bin dir to PATH for some mailman tools ([5eee6c5](https://www.github.com/scop/bash-completion/commit/5eee6c571df8156fec45c9dfbd0b733b73014346)) +* (test suite): Install jshint globally in ubuntu14 ([987f251](https://www.github.com/scop/bash-completion/commit/987f251c02b0d367ef0a7ababf18eccc6be64458)) +* alpine: Parse opts from -h output, add some opt arg completions ([7c5bc49](https://www.github.com/scop/bash-completion/commit/7c5bc49e29cf20ed5a338bad0da178dcecc63b6f)) +* (test suite): Add basic alpine test case ([282cdba](https://www.github.com/scop/bash-completion/commit/282cdbae6272e966e9fb0f91b06cf415ef929dda)) +* (test suite): Fix alias and cd cursor position tests ([35f1cd8](https://www.github.com/scop/bash-completion/commit/35f1cd844227c9ddcc36f316d87c4de9fe9db426)) +* (test suite): Add unrar to ubuntu14 container ([77fa46d](https://www.github.com/scop/bash-completion/commit/77fa46de688341bf229d27d05b51af434b7b5e0c)) +* (test suite): Install some things N/A in ubuntu14 to fedoradev ([f6c0d3a](https://www.github.com/scop/bash-completion/commit/f6c0d3a207c59caac74f4943126ea147d8c6896b)) +* (test suite): Avoid interference from user and system dirs (#87) ([1d3b6da](https://www.github.com/scop/bash-completion/commit/1d3b6da02a731e43077dc7dbef51036381b7889c)) +* (test suite): Accept non-whitespace single word in assert_complete_any ([476b260](https://www.github.com/scop/bash-completion/commit/476b26017e4168ad4be0b8d66ee9db03315fbdac)) +* (test suite): Load tested completions dynamically ([7fa35af](https://www.github.com/scop/bash-completion/commit/7fa35afb89e0a6614c173fef56191f01fa2e3ee7)) +* arch: Parse options from --help ([ca31dfa](https://www.github.com/scop/bash-completion/commit/ca31dfaf37ba0302da8b75427e36d3248e1c51ef)) +* (test suite): Add mailman bin dir to PATH for arch test ([222fbb8](https://www.github.com/scop/bash-completion/commit/222fbb80c19f1fa229a554a01726c2bffe6ab5c1)) +* (test suite): Ignore runtime loaded env function changes ([3dd8112](https://www.github.com/scop/bash-completion/commit/3dd81121c41767afa46cc5ef2911b33fad9de8ad)) +* (test suite): Add basic CentOS 6 container for bash 4.1 coverage ([537c9a0](https://www.github.com/scop/bash-completion/commit/537c9a0e9d59c699927a2eeb04d87c05a3638490)) +* Don't offer * as configured interface when there are none ([c287bb2](https://www.github.com/scop/bash-completion/commit/c287bb2af817cf12e065ea9c7c500532612bcd6d)) +* (test suite): Don't assume configured interfaces in CI setups ([dbaafbd](https://www.github.com/scop/bash-completion/commit/dbaafbdc79cd2abbe3ed27acad7293e507c67116)) +* (test suite): Simplify renice test, fix with only one completion ([8936b10](https://www.github.com/scop/bash-completion/commit/8936b10767144c4e5f84c04660f86c0828f7cc99)) +* (test suite): Fix CentOS 6 tcllib setup ([b253814](https://www.github.com/scop/bash-completion/commit/b253814289bcbe606a9bda2b961898585f814d80)) +* (test suite): Info test needs docs, don't exclude from CentOS ([f4b79ae](https://www.github.com/scop/bash-completion/commit/f4b79ae1c4ec89e1539f4bc026fc21ee8c0a25e2)) +* (test suite): Add our own dummy ri test fixture ([1a61fc8](https://www.github.com/scop/bash-completion/commit/1a61fc8b41504cea6372c9c9ceb118bea3133d7b)) +* ri: Add option and arg completions ([bf838e9](https://www.github.com/scop/bash-completion/commit/bf838e938342d4ebb8e3a45b837a60c80be661a9)) +* Don't define BASH_COMPLETION_COMPAT_DIR ([c41a762](https://www.github.com/scop/bash-completion/commit/c41a76237bc9dcbfa326eeddd026b66d7646d91d)) +* oowriter: Associate with *.pdf ([0cea46f](https://www.github.com/scop/bash-completion/commit/0cea46f1c88c1805ef3e9d11802d48c0a8013b4b)) +* py.test: New completion ([eae26d9](https://www.github.com/scop/bash-completion/commit/eae26d9bfac3df98eb047fc45d9b8a7c4bc5d7b9)) +* _configured_interfaces: Parse from /etc/network/interfaces.d/* on Debian ([d0c4410](https://www.github.com/scop/bash-completion/commit/d0c44102a8ed2e0a40d4e5456fc27bc21973a40e)) +* (test suite): Don't insist on loading all completions dynamically ([f845109](https://www.github.com/scop/bash-completion/commit/f845109a83bb7efbab89df9016f23595fea0bb7a)) +* (test suite): Set dcop result to untested if dcop server is not running ([25fa2f7](https://www.github.com/scop/bash-completion/commit/25fa2f72dce597a30e1e4a6088f175f159e9d159)) +* man: Don't check OSTYPE or GNU userland, just enable on all systems ([d0ff1a9](https://www.github.com/scop/bash-completion/commit/d0ff1a946a3bea2122b5adb77260faf06627a2de)) +* _user_at_host: Append @ suffix to username part completions ([f9f10a3](https://www.github.com/scop/bash-completion/commit/f9f10a396da44dddcd3f965cfe55fb3e16f85cf8)) +* _user_at_host: Set nospace only when completing username part ([a4c6763](https://www.github.com/scop/bash-completion/commit/a4c67638eaea89503c1623a78e1680ac1eb2331f)) +* bind: Add option and argument (non-)completions ([67e082c](https://www.github.com/scop/bash-completion/commit/67e082cf9dd0a9d9a0c7fd187e66db8fc8a374ee)) +* xine etc: Fix *.m4a association ([279c3cd](https://www.github.com/scop/bash-completion/commit/279c3cd6c66f0b18a74dbc96fde178998a7283d8)) +* mplayer, xine, etc: Associate *.mp4a and *.mp4v ([c868d7b](https://www.github.com/scop/bash-completion/commit/c868d7becbcb7ac16617a4858f40dd123821c32a)) +* mplayer: Remove duplicate *.m4a and *.m4v associations ([0845c21](https://www.github.com/scop/bash-completion/commit/0845c2183c91054013055ca1966ec1e547fa5b13)) +* Revert "(test suite): Fix alias and cd cursor position tests" ([c30a613](https://www.github.com/scop/bash-completion/commit/c30a6135f3f56931ed8e92b54733be3494805c14)) +* (test suite): Set TERM to dumb, not dummy ([81c72d4](https://www.github.com/scop/bash-completion/commit/81c72d444ab8aa8393371effd2334b2b83cb8503)) +* (test suite): Test screen -T completions ([c936d99](https://www.github.com/scop/bash-completion/commit/c936d99610d7a47fd75f7df38b9611faadd2167e)) +* gm: New completion, commands only for now ([1ac39db](https://www.github.com/scop/bash-completion/commit/1ac39db3f9906d23357661093360747b6b45f59d)) +* openssl: Add sha2 commands ([ec02542](https://www.github.com/scop/bash-completion/commit/ec02542c4293f3013dac3ad57a6775c4da66260d)) +* openssl: Parse available digests from dgst -h ([b6ddef3](https://www.github.com/scop/bash-completion/commit/b6ddef3d1f80c17b81c254ede4b362624a73b2a4)) +* python: Fix traceback avoidance on module completion error ([5faa19c](https://www.github.com/scop/bash-completion/commit/5faa19cb380fa31aa569401b30014dde3598a485)) +* test suite: Add Python module completion test case ([6abf9d6](https://www.github.com/scop/bash-completion/commit/6abf9d6c9ad848040f50a7a8732950789f831f97)) +* micropython: New completion, aliased from python ([9e5522f](https://www.github.com/scop/bash-completion/commit/9e5522fc29bda255caf9dd796c75c4c02662c756)) +* python: Split module completion to separate helper ([abb3016](https://www.github.com/scop/bash-completion/commit/abb3016cac990ffacf66a05ecd7a8d657589d817)) +* test suite: Improve ls home dir test descriptions ([fc8c976](https://www.github.com/scop/bash-completion/commit/fc8c9760368d4da2d97d78bae1f89d35fa0e4d42)) +* dpkg: Fix dpkg -i home dir completion ([dd8c53b](https://www.github.com/scop/bash-completion/commit/dd8c53b05f4954d0401d18b108d771e0d79d88a2)) +* test suite: Cosmetic tweaks ([a01c66b](https://www.github.com/scop/bash-completion/commit/a01c66b6e1e7b288fb96aefed777e4e3afb367bc)) +* test suite: Mark dpkg -L test case untested if no packages installed ([d3276a8](https://www.github.com/scop/bash-completion/commit/d3276a8c2c8e3b17549c21fc4daec1159495edac)) +* tar: Comment spelling fixes ([8c5283f](https://www.github.com/scop/bash-completion/commit/8c5283f89840fcb81811eae8fc19d4905f640c52)) +* test suite: If colon trim doesn't do anything, trim as usual ([f4ffafe](https://www.github.com/scop/bash-completion/commit/f4ffafe0e9d361cf4494962d70e5d6b76ed91407)) +* test suite: Ignore env var pulled in by use of scp in tests ([7f1f33b](https://www.github.com/scop/bash-completion/commit/7f1f33bdcb6e5eded2295ffeaec27199335ce65f)) +* test suite: Fix ifdown and ifup CI test skipping ([089288d](https://www.github.com/scop/bash-completion/commit/089288dd8b7a3c1abbcb0b230014ae03c92ca663)) +* test suite: Skip an expected make test case failure in centos6 CI ([4d5785f](https://www.github.com/scop/bash-completion/commit/4d5785f1b3bc320266addfecc8fab6d0b07d6904)) +* Expose version in BASH_COMPLETION_VERSINFO, use it in profile.d script ([eb6f40c](https://www.github.com/scop/bash-completion/commit/eb6f40c5a7e715d8a9104bf90c67018428ca2eb7)) +* test suite: Mark expected centos6 CI _filedir failures as such ([a1a4eb8](https://www.github.com/scop/bash-completion/commit/a1a4eb82050084a8447c4d2e9e248da9131d55b0)) + +## 2.5 (2017-02-04) + +* : Whitespace fixes ([2ed36b8](https://www.github.com/scop/bash-completion/commit/2ed36b808cee5416139a034477a223f4910b53d8)) +* Travis: zopfli is AWOL? ([96141cd](https://www.github.com/scop/bash-completion/commit/96141cd29817c38b30a6ede294d91913548e475e)) +* make: Declare _make_target_extract_script like other functions ([7be3f33](https://www.github.com/scop/bash-completion/commit/7be3f33541f6c18d36008b49d25d018d50a8fa28)) +* : Move indentation settings to .editorconfig ([619fb1f](https://www.github.com/scop/bash-completion/commit/619fb1f86ece68ea56e0e5c30c030376c1f8a07f)) +* CONTRIBUTING: Reorder sections ([fefcf16](https://www.github.com/scop/bash-completion/commit/fefcf162ffd00b34e24aae55ec92293c2a6590f3)) +* .ipa is just a zip file and we should let unzip handle it (#71) ([7b9dc46](https://www.github.com/scop/bash-completion/commit/7b9dc46c6a26a1a8e99409bb7752dfe153f2de0f)) +* deja-dup: New completion ([d3c483c](https://www.github.com/scop/bash-completion/commit/d3c483c6d13596062aafbe2e8359affb2c2a8a9e)) +* perl: Remove full path to cat in PERLDOC_PAGER call ([06e4c48](https://www.github.com/scop/bash-completion/commit/06e4c4859c270e0999f3c8c9ba02fc16adf8aa6b)) +* mr: New completion ([624a452](https://www.github.com/scop/bash-completion/commit/624a452f57c2a0a777984493a8756ef7388a3f72)) +* travis: Add mr ([78b0543](https://www.github.com/scop/bash-completion/commit/78b054319cc8f4dd39076fb1ffdf898c3aaf498f)) +* dd: Sync completions with coreutils 8.24 ([8b35dd3](https://www.github.com/scop/bash-completion/commit/8b35dd34233761c2b238858eae7b458a6d017672)) +* mplayer: Associate with *.mjpg, *.mjpeg (Debian: #837779) ([c16826e](https://www.github.com/scop/bash-completion/commit/c16826ee35ecb405fe87007404d0fb846ad61a15)) +* ssh-keygen: support ed25519 keys (#79) ([85b6951](https://www.github.com/scop/bash-completion/commit/85b6951358fc6d120f9bf73960694439050264a1)) +* ssh-keygen: Parse switches with _parse_usage, not _parse_help ([4dc0016](https://www.github.com/scop/bash-completion/commit/4dc0016625993487ed28ff0914ab8ebca47bd4e8)) +* Add support for Include in ssh config (#70) (#80) ([1016e43](https://www.github.com/scop/bash-completion/commit/1016e4336c2eaa95888275df6ea248b4e913fb76)) +* ant: parse targets in imported buildfiles (#84) ([62233c8](https://www.github.com/scop/bash-completion/commit/62233c87c030dfe96f4c55575c4ebb93bb984638)) +* mr: Disable "clean" test case, command N/A before mr 1.20141023 ([98146c9](https://www.github.com/scop/bash-completion/commit/98146c9275524e4db33d05c52147b103550be4a5)) +* Support for python gui source files (#91) ([84881eb](https://www.github.com/scop/bash-completion/commit/84881eb314f45a42e11f81e574777e3c05e86e72)) +* ip: Recognize address in addition to addr ([b53b287](https://www.github.com/scop/bash-completion/commit/b53b287c0c0166a0c66fea8aebe694086d71ba03)) +* ip: Recognize a as alias for address and l for link ([7029dd8](https://www.github.com/scop/bash-completion/commit/7029dd825201a1d75e052408102dd8a3f744ace1)) +* Add sidedoor to _ssh() completion (#106) ([7ecca5c](https://www.github.com/scop/bash-completion/commit/7ecca5c89aede4ddd39e516969f9bfc8aba219ee)) +* (test suite): Avoid loading user's ~/.bash_completion, fixes #87 ([c96f432](https://www.github.com/scop/bash-completion/commit/c96f4323c429b793cb03366faac59fbb78472dca)) +* test/config/*: Delete trailing whitespace ([d8cb128](https://www.github.com/scop/bash-completion/commit/d8cb1284245e23351ccc6d96346aea13ec1bcaf4)) +* travis: Skip bluez and nis for now due to post-install script issues ([58aaad3](https://www.github.com/scop/bash-completion/commit/58aaad3ee112333cdb1984d9838c6a7f747fdfc5)) +* Fix bug in 'make' completion when using BSD sed (#108) ([33f3ef3](https://www.github.com/scop/bash-completion/commit/33f3ef366e594ea8bf88d934031b63b5cd89285a)) +* ccache: fix completing compiler's flags ([ae84d53](https://www.github.com/scop/bash-completion/commit/ae84d53c44a3d4cb0bc38e7df53b69242dbd7cc7)) +* Add more tests for ccache ([b0ec56d](https://www.github.com/scop/bash-completion/commit/b0ec56d24caee277aaf35ee86beb939add648165)) +* javac: Complete -cp like -classpath ([c068fca](https://www.github.com/scop/bash-completion/commit/c068fcaa83c8e1b183df62df8f85be6012a56df0)) +* test suite: Add java/javac non-completion fixture ([b35c4c9](https://www.github.com/scop/bash-completion/commit/b35c4c9cbbf45b59206f1a4ed1260a554a0f920e)) +* Minor edits to README.md (mostly formatting) (#110) ([23cc43b](https://www.github.com/scop/bash-completion/commit/23cc43b4484c8d683d9c56400cc57698c2c2d984)) + +## 2.4 (2016-08-12) + +* tipc: add tipc completions ([a0b5863](https://www.github.com/scop/bash-completion/commit/a0b586332f32f5c4ba4735424f387915bd975946)) +* CONTRIBUTING: Highlight request for test cases ([0eb9600](https://www.github.com/scop/bash-completion/commit/0eb9600990b0197b2982a7f79bcfa9aa2401cb6f)) +* test suite: Add function and declare test cases ([81f2708](https://www.github.com/scop/bash-completion/commit/81f2708198dd87604c4257b94b18c0e96a2852fb)) +* mpv: Don't install symlink for it, fixes #24 ([0382773](https://www.github.com/scop/bash-completion/commit/0382773bbfc21dc1fb5467c1c0426ea3c984b6ec)) +* aclocal: Install completion for 1.14 and 1.15, fixes #25 ([a8f4357](https://www.github.com/scop/bash-completion/commit/a8f4357f154f142ef30347b87a378e07b22608e9)) +* Better handling of typeset/declare ([af3934a](https://www.github.com/scop/bash-completion/commit/af3934ad3474e94faa08f94523ed029e95c98767)) +* Add tests for declare/typeset ([71b9147](https://www.github.com/scop/bash-completion/commit/71b9147d375393c60e3628bd7cd5ab41fac8504d)) +* Support completing array variables and expansions ([dde1d31](https://www.github.com/scop/bash-completion/commit/dde1d314c4e8934693e7090ef4467dfac7d72a92)) +* tipc: add test framework ([f6d00ad](https://www.github.com/scop/bash-completion/commit/f6d00ad8af985c8790eb9151aa3840e0cf4e76a0)) +* tipc: merge functions into main ([935a98d](https://www.github.com/scop/bash-completion/commit/935a98d1550372d082abe4ac6965cf9ea1fe3989)) +* tipc: use bash here string instead of echo ([d03425e](https://www.github.com/scop/bash-completion/commit/d03425e23ff8e2957bc639c61f9d9bfbc2fac3a9)) +* tipc: remove unnecessary function _tipc_get_val() ([1969438](https://www.github.com/scop/bash-completion/commit/1969438c818c0829b78f87d34968357f3478b94a)) +* tipc: add command prefix to link sed ([cdbc193](https://www.github.com/scop/bash-completion/commit/cdbc193826cabe74f89650236ae1bda8f7e9aa9f)) +* The BitKeeper completion used the wrong set of commands ([be62355](https://www.github.com/scop/bash-completion/commit/be623550daf22492d58dfa359eea71cf36b723f3)) +* man: Prioritize MANPATH, simplify, add fallback e.g. for busybox, fixes #28 ([c9f54e7](https://www.github.com/scop/bash-completion/commit/c9f54e7a411613cbfba2b200d35059f5bcb87113)) +* cppcheck: Complete filenames too for --platform ([7634fe1](https://www.github.com/scop/bash-completion/commit/7634fe1b88948cbb724b6f3e8e3d8a6786973fd3)) +* tipc: use cur variable for flag completion ([696eb89](https://www.github.com/scop/bash-completion/commit/696eb8961e2038c88eaff85b3bea20fe938ccd87)) +* tipc: readd call to complete command ([831abc7](https://www.github.com/scop/bash-completion/commit/831abc716288b636ce4aa66a4e0b1e5b3100a469)) +* Use shell globbing instead of ls to source files in compat dir ([760bd6f](https://www.github.com/scop/bash-completion/commit/760bd6f2758437eac08c4133884434cfd1ca54b3)) +* aspell, minicom, mysql: Replace use of ls with printf ([751dbbb](https://www.github.com/scop/bash-completion/commit/751dbbb156aaa5171ba5e9136662ee5fbc6cf7d6)) +* rpm: Fix --whatenhances arg completion ([e236020](https://www.github.com/scop/bash-completion/commit/e236020f858fc8929eee2fc4f1f4b7ce0ac5b3b0)) +* make: Avoid a grep ([47c5c97](https://www.github.com/scop/bash-completion/commit/47c5c9773b00504a174326e356a5455892efe616)) +* vncviewer: Cleanup shopt use, drop an eval ([cfc6212](https://www.github.com/scop/bash-completion/commit/cfc62125a8fc9e3d72e9154a504f9548b0b2ba38)) +* aptitude: List packages using _apt_cache_packages, fixes #33 ([49265f0](https://www.github.com/scop/bash-completion/commit/49265f0094690bb9443de1c46a54d87d58876310)) +* tar: silence --version's stderr output ([e1b1fd2](https://www.github.com/scop/bash-completion/commit/e1b1fd29a781d6f760ba2735e183d03a3e0ea130)) +* test suite: Add bashcomp_bash env var for better control on tested bash ([93940c0](https://www.github.com/scop/bash-completion/commit/93940c099aa629d1990ba4fc995d9e44453253ab)) +* Travis: First steps toward testing with OS X ([60a5b47](https://www.github.com/scop/bash-completion/commit/60a5b47760710836338faf4867a08985fcbb10d5)) +* chroot: New (generic long options) completion, see #38 ([ce49e8d](https://www.github.com/scop/bash-completion/commit/ce49e8d87430bd640fb2ed1b5e03b05e02093b75)) +* pyvenv: New completion ([fd9515f](https://www.github.com/scop/bash-completion/commit/fd9515fbe33bd5fa40a86251bb9e8a2616012633)) +* abook: Parse long options from command including full path ([5ad751f](https://www.github.com/scop/bash-completion/commit/5ad751f89726a34ad0a22720a686e80a877c76b3)) +* test suite: Add basic pushd test case ([864cb34](https://www.github.com/scop/bash-completion/commit/864cb342b37110df17903e6bae94c6bf2b785cd3)) +* pushd: Use _cd completion for CDPATH support, closes #38 ([e35c504](https://www.github.com/scop/bash-completion/commit/e35c5046676b12d43bc19b5d2727ec03a6086dc6)) +* Support pod document files for perldoc (#39) ([40e7b4e](https://www.github.com/scop/bash-completion/commit/40e7b4e8730e515a075c1e4852aa98ffa7ac78e0)) +* perl: Remove some duplicated code ([cf559ae](https://www.github.com/scop/bash-completion/commit/cf559aeb1e67ee40a2b8c38e5581e02cd346ee22)) +* test suite: Add perldoc module+pod completion test case ([c6defa3](https://www.github.com/scop/bash-completion/commit/c6defa39cede252c9b3b39aaa35a6608b6310ad2)) +* mysql: Avoid --default-character-set error with failglob, fixes #46 ([fa10367](https://www.github.com/scop/bash-completion/commit/fa10367f319b91bda56b8cf972d60dfb5ae65c5b)) +* tipc: remove unnecessary return values ([6c3942c](https://www.github.com/scop/bash-completion/commit/6c3942c8844dd95613d178dd835e6253004ce14e)) +* tipc: make loop variables local ([e1b535e](https://www.github.com/scop/bash-completion/commit/e1b535e31f28097a6f90da1e0e5b11d5280dcde0)) +* tipc: use double brackets in if conditions ([d815b46](https://www.github.com/scop/bash-completion/commit/d815b46102e6a0d92ca7c0e3a8c9d8881f606a3a)) +* apache2ctl, aspell, make: Don't hardcode completion generator command ([3426649](https://www.github.com/scop/bash-completion/commit/342664947b241902d352dba2aede4cdcda5585f1)) +* python: Support -Q and -W arg completion without space ([a9d0250](https://www.github.com/scop/bash-completion/commit/a9d0250abf879468272c56068cda5a94e1e850b3)) +* xetex, xelatex, luatex, lualatex: Associate with tex files ([1e567a5](https://www.github.com/scop/bash-completion/commit/1e567a5eaf861804b6b8d636f976e947b4d2dc1c)) +* CONTRIBUTING: Note patch preferences if not using GitHub pull requests ([5017ee6](https://www.github.com/scop/bash-completion/commit/5017ee6a3be315bf66eb5ee642a0450aa93741e6)) +* (test suite): Remove test/fixtures/_filedir/a"b from git, create on the fly ([fec077d](https://www.github.com/scop/bash-completion/commit/fec077d555f112b9f455c45860f90a3b47392fcf)) +* (test suite): Remove Bash::Completion.3pm.gz from git, create on the fly ([52d05a6](https://www.github.com/scop/bash-completion/commit/52d05a68e4583c8ee4dcd2c1f0da5db6629e5ff1)) +* (test suite): Fix fallout from fec077d555f112b9f455c45860f90a3b47392fcf ([6170f07](https://www.github.com/scop/bash-completion/commit/6170f073a8765dabcd74f98c3362a10201f5322e)) +* tipc: suppress tipc error messages ([83f78d2](https://www.github.com/scop/bash-completion/commit/83f78d2b4c2942a01f16697963a5ff24540d9ca7)) +* tipc: handle complete words without trailing space ([1e778fc](https://www.github.com/scop/bash-completion/commit/1e778fcf780abe0f6d4044fe891b8385bf9bbd0b)) +* tipc: fix missing last char in link name completion ([502b718](https://www.github.com/scop/bash-completion/commit/502b7189350632cd074f86361b498294b745ee61)) +* tipc: Indentation fix ([48ab557](https://www.github.com/scop/bash-completion/commit/48ab5571b5a9c21db269cbf981cf7f9dae78bd44)) +* tipc: Invoke ls with "command" ([103dbe5](https://www.github.com/scop/bash-completion/commit/103dbe5cf25087da4e5804374debcf8e9bb289a1)) +* (test suite): Pass assert_complete_any for exact/only given arg completed ([847c2bf](https://www.github.com/scop/bash-completion/commit/847c2bf1aa30ca9f2718f583ad148ba558ca6cc2)) +* Travis: Install more packages for more test coverage ([6388b8f](https://www.github.com/scop/bash-completion/commit/6388b8f5e77e1357a2d99109a46df7b813fdfd52)) +* hcitool,svcadm,tar: Spelling fixes ([9a03b80](https://www.github.com/scop/bash-completion/commit/9a03b8068e20d4384786d9e5259b0d6d25575438)) +* pypy3: Alias to python ([35767bf](https://www.github.com/scop/bash-completion/commit/35767bfdf4c8751f2bb453aa65bf359b313b79de)) +* pypy*: Add basic --jit arg completion ([72beabe](https://www.github.com/scop/bash-completion/commit/72beabe4fcae1025a18e689b551b9c5c2d327c30)) +* : Remove redundant return 0's ([8611927](https://www.github.com/scop/bash-completion/commit/8611927cfd3f95b88adcd8eff34cb17250870291)) +* : Trivial cleanups ([b31c0f9](https://www.github.com/scop/bash-completion/commit/b31c0f95c7151beb8f97ebed042d555264aa6fc1)) +* pkg-get,pkgrm: Drop unnecessary _have calls ([2d2d15b](https://www.github.com/scop/bash-completion/commit/2d2d15b8f4eab836c39f7d31c4ef0c9586103ad8)) +* jarsigner: Add some option arg (non)completions ([5da97ee](https://www.github.com/scop/bash-completion/commit/5da97ee3da2582b988df7d9ecab788dc8b63485e)) +* pkg-get: Don't use hyphens in function names ([e194c31](https://www.github.com/scop/bash-completion/commit/e194c312c765cd87541ab46178b17521e098c64c)) +* lrzip: Add -m arg noncompletion ([fd6412e](https://www.github.com/scop/bash-completion/commit/fd6412e159143360972549233f28bb84e6cdc3f9)) +* javadoc: Add bunch of option arg (non)completions ([30598c8](https://www.github.com/scop/bash-completion/commit/30598c864c71e6a5184a7f4aef02cfed2df38e32)) +* rpm: Offer --filetriggers with -q ([8212aca](https://www.github.com/scop/bash-completion/commit/8212acae3588ecec0afcb0ac94a799b62a475737)) + +## 2.3 (2016-03-28) + +* lvm: fix all commands that should get all PVs ([caa2222](https://www.github.com/scop/bash-completion/commit/caa22225f86034f72e7020e0919b4a618c580509)) +* lvm: pvcreate should be able to use all block devcices ([2212dc5](https://www.github.com/scop/bash-completion/commit/2212dc584160977cfbca1eb43dd745b8056baf3b)) +* CONTRIBUTING.md: Ask for test cases ([78e9493](https://www.github.com/scop/bash-completion/commit/78e949363c0f1162d324d7d6c788f74e5b10cc57)) +* make check: Test syntax of all completion files ([b5d8a84](https://www.github.com/scop/bash-completion/commit/b5d8a84852c0ef9984f56f047ed296d1081ce668)) +* travis: configure and run completions syntax check ([75c537c](https://www.github.com/scop/bash-completion/commit/75c537c5a72c078dcaa21dad6c19bf90e2d444a3)) +* Completion for python zip archives ([f205719](https://www.github.com/scop/bash-completion/commit/f20571949641f44eb8a0e6e88a1aeffd1bd2a42d)) +* unzip, zipinfo: Complete on *.pyz ([a576160](https://www.github.com/scop/bash-completion/commit/a5761607bd37a201a2512f10bbc7be646e51b2fb)) +* test suite: Add some python test cases ([16d52f9](https://www.github.com/scop/bash-completion/commit/16d52f9a6c6be22d421ba2de07aec8413803c112)) +* python: Complete all files only if -c is before current word ([6eae809](https://www.github.com/scop/bash-completion/commit/6eae809beacc7c6ab3db5f5ccfa57dce48d00e3b)) +* python: Don't offer options after -c ([5f016fc](https://www.github.com/scop/bash-completion/commit/5f016fcd3991c389da27edd37668b0fd7db37cf4)) +* python: Complete all files also after -m ([f17407b](https://www.github.com/scop/bash-completion/commit/f17407bc3282f2abd5fb9ea47e07b18cf4a9e898)) +* python: Simplify code ([235f726](https://www.github.com/scop/bash-completion/commit/235f7269773b80fed4b41722de28df93ee0fd817)) +* tar: Don't write to /tmp/jetel ([6bdd922](https://www.github.com/scop/bash-completion/commit/6bdd92202f55d7c530dcbeb2a243604dac546cf1)) +* test suite: Add tar xvf filename test case ([807f903](https://www.github.com/scop/bash-completion/commit/807f903f86ad647425c83f7ad6fc499014c6734e)) +* tar: Fix GNU tar help output parsing regex, fixes #15 ([0b7189d](https://www.github.com/scop/bash-completion/commit/0b7189d4eee4597e11cab02e6b4dcae488db5ca8)) +* tar: Remove unused variable ([7ab05bf](https://www.github.com/scop/bash-completion/commit/7ab05bf9d97ce5a6ced7acdfc21235e06542c3f2)) +* tar: Detect GNU/other from --version only once per session ([88c671a](https://www.github.com/scop/bash-completion/commit/88c671a2c74bfde3bc2ec7c6f74133ac613c61da)) +* test suite: Fix tar failure caused by previous tar change ([198ab64](https://www.github.com/scop/bash-completion/commit/198ab64862777763f9750216131938300bf3a79c)) +* test suite: Tolerate "See 'man feh'" feh --help output ([b4b8916](https://www.github.com/scop/bash-completion/commit/b4b89162e376574980292eaab761d393a6fbd5f9)) +* test suite: Don't insist on property completions if synclient -l fails ([9716a54](https://www.github.com/scop/bash-completion/commit/9716a54837d43cbd8d79c04ac66251df8d3fcf1f)) +* test suite: Fix abook test case ([eae0183](https://www.github.com/scop/bash-completion/commit/eae0183322854ee51500482e2223f5c3091d39b7)) +* : Use [:blank:] instead of $'\t ' tricks where appropriate, fixes #19 ([657fcf6](https://www.github.com/scop/bash-completion/commit/657fcf62c77343ede3a21430a6c8e4faf4cd1dbe)) +* gnokii: Use <<< instead of echo + pipe ([b7ededc](https://www.github.com/scop/bash-completion/commit/b7ededc40fdf02f3ee110e057ebe103338ccbf0f)) +* make: Use <<< instead of printf + pipe ([1a122fb](https://www.github.com/scop/bash-completion/commit/1a122fb5827588d57339fc88f0692dd92a0c14b2)) + +## 2.2 (2016-03-03) + +* feh: Add new sort type ([0354981](https://www.github.com/scop/bash-completion/commit/0354981b1f348263edb7c2e6f1f8dc619a48c476)) +* kcov: Add new sort types, complete --replace-src-path arguments ([6cb7f96](https://www.github.com/scop/bash-completion/commit/6cb7f969745dd6b2075dd61244f8e60445a6a3d5)) +* Add config for cmake to bash-completion. ([94b7e63](https://www.github.com/scop/bash-completion/commit/94b7e63f6d525a029efac07e20f4102fe8563a71)) +* _mac_addresses: Use explicit C locale for ifconfig (Debian: #704832). ([a9db458](https://www.github.com/scop/bash-completion/commit/a9db458339fb518178b1b6cc234930bb869e95ea)) +* aclocal, automake: Install for *-1.10, *-1.12, and *-1.13 too. ([e772425](https://www.github.com/scop/bash-completion/commit/e772425cdd660d4d59914d2e067be07d7f4b3504)) +* cvs rm: Don't filter existing files with -f (RedHat: #949479). ([9852597](https://www.github.com/scop/bash-completion/commit/9852597d8c19567ee1e01c03a297692d9c1cd764)) +* Use == instead of =. ([497c209](https://www.github.com/scop/bash-completion/commit/497c20902a978098512674bbaa37a839e355c782)) +* nmcli completion was integrated upstream ([580a4cf](https://www.github.com/scop/bash-completion/commit/580a4cf6e55ab1afd6b1f8f7efc54436e7046e44)) +* Revert "nmcli completion was integrated upstream" ([cdd2c3d](https://www.github.com/scop/bash-completion/commit/cdd2c3d71d9eec2860ad99ba3f81ef65dbd1e723)) +* nmcli: Deprecate our completion, upstream has one in 0.9.8.0. ([9780b0a](https://www.github.com/scop/bash-completion/commit/9780b0a04472187cb4ac4557e21038caac31fd86)) +* sh: Complete script arguments with all filenames (Alioth: #314226). ([daaa541](https://www.github.com/scop/bash-completion/commit/daaa54100ed061a0c8e7ce89a8bda009530246a3)) +* cvs: Fix checkout -j non-completion. ([bb0739f](https://www.github.com/scop/bash-completion/commit/bb0739fafd87bfca2e5d43e8b448ec1293a43ada)) +* Clean up/compact various globs. ([d99c220](https://www.github.com/scop/bash-completion/commit/d99c2203b9ff6e35ce12fbe0572773a9f3abeadb)) +* wget: Stop completing after --help/--version. ([5786568](https://www.github.com/scop/bash-completion/commit/57865686de2d2ff0c455704428a49d5a3b4f98c8)) +* wget: Drop incorrect -nv arg completion. ([1969d12](https://www.github.com/scop/bash-completion/commit/1969d125bacde3da22c06e5ca729c7e766ce7d65)) +* wget: Add --accept-regex/--reject-regex/--regex-type arg (non)completions. ([5c6b1bb](https://www.github.com/scop/bash-completion/commit/5c6b1bb4a47ca522c111f110f44eff771d9aea5f)) +* perl*: Fix handling of relative paths in @INC. ([18c28bb](https://www.github.com/scop/bash-completion/commit/18c28bb9a2147e662755e393d1ec39f270948d30)) +* perl: Fix -dt: completion. ([97efc7c](https://www.github.com/scop/bash-completion/commit/97efc7ca08f22043ce5c55f41ac093de9c7ca082)) +* hcitool, rfcomm, ciptool, hciconfig: Don't leak $args. ([3a3290d](https://www.github.com/scop/bash-completion/commit/3a3290ddcf81181bbd9f22a739536b65df0c5647)) +* 7z: New completion. ([5a9e8f2](https://www.github.com/scop/bash-completion/commit/5a9e8f219b847a6c99f294b4cc492e77a63a22f0)) +* file-roller: Reuse unzip's xspec. ([42196ef](https://www.github.com/scop/bash-completion/commit/42196ef7fc1f91c51a471a1b50d2c1a48d77560f)) +* 2to3: New completion. ([a4b69e7](https://www.github.com/scop/bash-completion/commit/a4b69e75873b9b24e1da0c6bda22d42365cc97ac)) +* perl: -d/-dt option argument is optional (Alioth: #314242) ([ad455df](https://www.github.com/scop/bash-completion/commit/ad455dfa9de9253d52d6352888777f6a9328eade)) +* dpkg: Suppress unwanted error messages (Debian: #706502) ([9ca8d93](https://www.github.com/scop/bash-completion/commit/9ca8d933c69e5a52e7866227dfc823657c180f40)) +* cppcheck: Add new --enable option argument and --library argument completion ([77ebc93](https://www.github.com/scop/bash-completion/commit/77ebc93a023e6b1bba87b9572c17e824d248c540)) +* export, _variables: Do TZ= completion (Redhat: #994646). ([3f144be](https://www.github.com/scop/bash-completion/commit/3f144beb721525821136f76f53a3147b4688d331)) +* Cosmetics. ([62e0c3b](https://www.github.com/scop/bash-completion/commit/62e0c3ba7245741c9ef2a664a84a8f6c61a6f875)) +* make: Use only posix basic regexps with sed (Alioth: #314345) ([f230cfd](https://www.github.com/scop/bash-completion/commit/f230cfddbd12b8c777040e33bac1174c0e2898af)) +* _longopt: Run commands in C locale. ([a282d02](https://www.github.com/scop/bash-completion/commit/a282d0254cca2e9e1e851e251dc77f3b2aa653ce)) +* aptitude: safe-upgrade accepts package name as parameters (Alioth: #313638, Debian: 673235) ([e91a458](https://www.github.com/scop/bash-completion/commit/e91a45889f3fb8b4007949797fc3f07af24bb52f)) +* bzip2, gzip, lzma: Cleanups. ([61d1d7d](https://www.github.com/scop/bash-completion/commit/61d1d7df42cace84c5d706b43f44ea2083c54723)) +* zopfli: New completion. ([2da4ee9](https://www.github.com/scop/bash-completion/commit/2da4ee9ad5a9016e4e4a89e4822bf6e1688c6175)) +* make: Fix basic regex for portability (Alioth: #314345) ([3ac523f](https://www.github.com/scop/bash-completion/commit/3ac523f57e8d26e0943dfb2fd22f4a8879741c60)) +* _known_hosts_real: Pre-expand \t instead of relying on sed supporting it (Alioth: #314393). ([50ae579](https://www.github.com/scop/bash-completion/commit/50ae57927365a16c830899cc1714be73237bdcb2)) +* dict: Trivial regex cleanup. ([705be00](https://www.github.com/scop/bash-completion/commit/705be005027577ba540212be6b0bbb25e95f78f3)) +* abook, kldunload: Pre-expand \t instead of relying on sed supporting it. ([24f0c58](https://www.github.com/scop/bash-completion/commit/24f0c58c29885f89ef2a3a16db17e73b6cd6f64e)) +* cc, c++: Install minimal completion for non-gcc ones (Alioth: #314417). ([d6600e6](https://www.github.com/scop/bash-completion/commit/d6600e6a10a370961b4bd4e1e060ba79e080a8d7)) +* cc, c++: Check path to binary when finding out if it's gcc (Alioth: #314417). ([ffabc6f](https://www.github.com/scop/bash-completion/commit/ffabc6f2829201815c1a9c69cfdf8bdbe77ff648)) +* f77, f95: Use the same completion as for g77, g95 if they are links to gfortran ([df8782d](https://www.github.com/scop/bash-completion/commit/df8782d76928bd39b3de138305f9b0af36628a9f)) +* 7z: Improve completion ([d048a14](https://www.github.com/scop/bash-completion/commit/d048a14b2ae18c70ddcf54558cdc79eaf7e8d751)) +* mplayer: -dvd-devices takes dvd devices, dirs and .iso files as argument ([d482e74](https://www.github.com/scop/bash-completion/commit/d482e746821f102205475dfb835ca75a7fd02d63)) +* _known_hosts_real: Exclude %h HostName entries (RedHat: #1015935). ([fcc9545](https://www.github.com/scop/bash-completion/commit/fcc9545b44f32b627f75e1589fb93a5c7ad86bff)) +* timeout: New completion. ([63b4995](https://www.github.com/scop/bash-completion/commit/63b499593a595cffd09403852555577e3f590cb5)) +* complete on freerdp-specific known hosts list ([1cfbbdd](https://www.github.com/scop/bash-completion/commit/1cfbbdd52cafd6b995f7241e2b87a41ed0f7a87a)) +* bts: New completion, thanks to Federico Ceratto. ([b2e7951](https://www.github.com/scop/bash-completion/commit/b2e7951cd714bd31e6efd0b6e16c1f916fd94486)) +* appdata-validate: New completion. ([e93cc98](https://www.github.com/scop/bash-completion/commit/e93cc98523e722bc0557ae623b4bd9d16ee01486)) +* uscan: New completion, thanks to Federico Ceratto ([61fa261](https://www.github.com/scop/bash-completion/commit/61fa261502f904c3afa5f053a68cccd243cbfcd4)) +* Refactor bts and uscan, since they use common functions ([780d97c](https://www.github.com/scop/bash-completion/commit/780d97c5ac41a1d170fa294811e8cadffa550248)) +* wtf: Hush stderr when db file doesn't exist. ([f5df66f](https://www.github.com/scop/bash-completion/commit/f5df66f47653ebe781090411a8e03fa052053273)) +* wtf: Don't offer -f if it was already specified. ([e694978](https://www.github.com/scop/bash-completion/commit/e694978346b017d92dfeb7968fc57d018c8721a4)) +* wtf: Look for acronym db from /usr/share/games/bsdgames/acronyms too. ([920bbb8](https://www.github.com/scop/bash-completion/commit/920bbb8582bcd3039ff4e4388e795e3144eb30b6)) +* (testsuite): Limit wtf completions to A* to keep expect happier. ([c527b54](https://www.github.com/scop/bash-completion/commit/c527b543a84363449902e2be5e80786aceaa7931)) +* cppcheck: Include - in --file-list completions. ([4df6d3f](https://www.github.com/scop/bash-completion/commit/4df6d3ffb86cf2cd9f583d5e927f2661a8a83a84)) +* optipng: New completion. ([34a74df](https://www.github.com/scop/bash-completion/commit/34a74df61973d1f49805135e79045e2c7b1589e0)) +* lz4: New completion. ([a2e2f19](https://www.github.com/scop/bash-completion/commit/a2e2f198d820c55857e372f6477c6fe07a23df92)) +* (testsuite) Check for grep and ls invoked without "command", see README ([d98e56f](https://www.github.com/scop/bash-completion/commit/d98e56fb0725f96a5cb39362c2d9a60a39e69154)) +* lintian: Replace some grep+cuts with awk ([93ee009](https://www.github.com/scop/bash-completion/commit/93ee00947ae112f195ed368f3414f3622d113630)) +* gcc, lintian, make, pkgadd, slackpkg: grep -> "command grep" (Debian: #734095) ([e3edf7a](https://www.github.com/scop/bash-completion/commit/e3edf7ac423179f70acbd77d9ffbbf5cfa91ce58)) +* aptitude, dpkg: Replace some grep+cuts with awk ([e777395](https://www.github.com/scop/bash-completion/commit/e777395ac3ce25527e58e04bfc406ae03bdb3b12)) +* ip: Add some addr, addrlabel, and route arg completions ([b5d0cdd](https://www.github.com/scop/bash-completion/commit/b5d0cdd802817708bb1fdb03880eb95e9be9e67b)) +* jpegoptim: New completion ([8617e22](https://www.github.com/scop/bash-completion/commit/8617e227e541ffc3d34c69d861c52f188bd5ae15)) +* Bump copyright years to 2014. ([01fd3b4](https://www.github.com/scop/bash-completion/commit/01fd3b4f55407623dbef58b6b6a756ad623c334f)) +* ssh-keygen: New completion ([0b7d92c](https://www.github.com/scop/bash-completion/commit/0b7d92cf2bb3eb04668c73b6d39726caca617bf9)) +* portsnap: New completion. ([c3770c1](https://www.github.com/scop/bash-completion/commit/c3770c17984bb61255db6adb48886b466c335e03)) +* freebsd-update: New completion. ([5ff5a4e](https://www.github.com/scop/bash-completion/commit/5ff5a4e0f875e8d1a49848408cfe72778889cbe8)) +* testsuite: Add basic tests for portsnap and freebsd-update ([602d188](https://www.github.com/scop/bash-completion/commit/602d18853ccb71baa233c33d93503b0ce27070a0)) +* hwclock,ionice,rtcwake: Deprecate in favor of util-linux ones (Debian: #737672) ([e4b1740](https://www.github.com/scop/bash-completion/commit/e4b17402bbb5d53797a601de93771d8bd0df5213)) +* _*: Install our deprecated completions too, try loading them secondarily ([e201d1b](https://www.github.com/scop/bash-completion/commit/e201d1be7ed92bf35c249d6d01c4001378e0ed77)) +* testsuite: Add basic test cases for deprecated completions ([3e06371](https://www.github.com/scop/bash-completion/commit/3e0637128f67807500f3af042a6f536d1404b968)) +* testsuite: Add basic newgrp test case ([bb76897](https://www.github.com/scop/bash-completion/commit/bb768978ba2eee1ab5d0f4e3d6158d9df1643630)) +* cal,chfn,chsh,dmesg,eject,hexdump,look,newgrp,renice,runuser,su,write: Deprecate on Linux in favor of util-linux ones (Debian: #737672) ([e452f2e](https://www.github.com/scop/bash-completion/commit/e452f2e8d6788458830bf2afe55d641e6adfa940)) +* pyflakes: New completion ([e14617e](https://www.github.com/scop/bash-completion/commit/e14617e498f0e2e2faceea9205f96d72c3e9ef8d)) +* flake8: New completion ([5152356](https://www.github.com/scop/bash-completion/commit/5152356ad1b0c8384d52ea9648529c448bbb4af2)) +* ri: Fix colon handling in class completion. ([24ea53f](https://www.github.com/scop/bash-completion/commit/24ea53f01de9c218a133d8cf7b3c77d6ad07bc26)) +* ri: Fix class completion with ri >= 3. ([3cdcfde](https://www.github.com/scop/bash-completion/commit/3cdcfdeda65a281a4f175a6b2f330c983a4bd217)) +* (testsuite) Avoid complete-ant-cmd.pl errors with our build.xml ([14be62a](https://www.github.com/scop/bash-completion/commit/14be62aae4197a7f98e913c0ada910c5c2ea7f04)) +* FAQ: Clarify that we mean the bash man page for M-/ ([293bbaa](https://www.github.com/scop/bash-completion/commit/293bbaaa90238511b12ffb0efd3d5de0cbd5abfc)) +* profile.d: Don't return from a sourced script (Debian: #741657) ([867282a](https://www.github.com/scop/bash-completion/commit/867282a7341ccfff9a0e8a8ef6bba6e781b66afb)) +* man: Use -w instead of --path ([4927730](https://www.github.com/scop/bash-completion/commit/492773098004700d670b4e1c12eebac506471d90)) +* xrandr: Add (some) --setprovider* arg completion support ([c50313c](https://www.github.com/scop/bash-completion/commit/c50313c30df5eb3a7956b0420f882508e79da0a5)) +* xrandr: Use the invoked command internally, not hardcoded "xrandr" ([b758afc](https://www.github.com/scop/bash-completion/commit/b758afc105fd0656c13f88a5bd2f73bac81399db)) +* qemu: Apply completion to qemu-kvm/-system-i386/-system-x86_64 too ([61ad655](https://www.github.com/scop/bash-completion/commit/61ad655fc4a6c18947ce6f17d4ea8f87abd6c945)) +* qemu: Fix -balloon arg completion ([4a4afd5](https://www.github.com/scop/bash-completion/commit/4a4afd5eab0fcaf19ac1f2ce55c1bb305f89903f)) +* pngfix: New completion ([13ad1f1](https://www.github.com/scop/bash-completion/commit/13ad1f1966f5baa14d9785c4b732dda3a29f4f14)) +* gdb: support --args style completion (Alioth: #314664) ([b1f7803](https://www.github.com/scop/bash-completion/commit/b1f78035565dcca343841cc4fa7ff54b09cc81b9)) +* eog: Complete on *.pgm (RedHat: #1090481) ([77e11c4](https://www.github.com/scop/bash-completion/commit/77e11c41ea376e364ac83ddc54428b18052b8ffe)) +* nslookup: complete on hosts (Alioth: #314673) ([b74d537](https://www.github.com/scop/bash-completion/commit/b74d53761afb48e5e0948b70e7202a1c1cda4897)) +* hostname: New completion ([c924d32](https://www.github.com/scop/bash-completion/commit/c924d32b4c127bc9cc46cb71d3148c8bdbfdd6cf)) +* pypy: New completion identical to python (Alioth: #314501) ([38a013e](https://www.github.com/scop/bash-completion/commit/38a013e22cd30c0cce84caaaff2763d0c39ce131)) +* Use more straightforward way to check bash version ([768a958](https://www.github.com/scop/bash-completion/commit/768a95854616e25c8da3f9d79048f9bbb5ecb2a6)) +* dpkg: Add support in dpkg completion for .ddeb (LP: #568404) ([eafde37](https://www.github.com/scop/bash-completion/commit/eafde3784836391741c2264ad1b350fff1aa276a)) +* make: completion shouldn't be confused by the output of $(info confuse: make) ([54d53c6](https://www.github.com/scop/bash-completion/commit/54d53c622745e907d288d67d832a0b09aaa1d3df)) +* Puppet: use puppet terminology ([ac98c31](https://www.github.com/scop/bash-completion/commit/ac98c31f30b74b32ec0eea8df6c71b866b16b58e)) +* Puppet: puppet -* doesn't imply 'puppet apply' ([20e9bef](https://www.github.com/scop/bash-completion/commit/20e9befbff2b4cac09f7beec58e5ad6eac1425b4)) +* Puppet: puppet parser support ([b56df70](https://www.github.com/scop/bash-completion/commit/b56df708a1bbaf27bf76d06b18448bba6b2d59f6)) +* Puppet: agent: update options list, accordind to 'puppet help agent' ([af5ba56](https://www.github.com/scop/bash-completion/commit/af5ba56089088669e31bb49d855bcc42c98f0951)) +* Puppet: apply: update options list, accordind to 'puppet help apply' ([5a536ae](https://www.github.com/scop/bash-completion/commit/5a536aec4ca4e8bc6c179dfd2f98d71a3c541f1d)) +* Puppet: cert: update options list, accordind to 'puppet help cert' ([b46636a](https://www.github.com/scop/bash-completion/commit/b46636ae16c98045caf9c4dbfa4020f3c08671a5)) +* Puppet: describe: update options list, accordind to 'puppet help describe' ([0bbcc47](https://www.github.com/scop/bash-completion/commit/0bbcc476b2d8f54c8a6a3e633db97586ecb0e23c)) +* puppet: Exit early on -h|-V|--version in addition to --help ([f94d1a6](https://www.github.com/scop/bash-completion/commit/f94d1a6803a488b24b3b7005ce86c19949a381e6)) +* puppet: Parse most subcommand options from "help subcommand" output ([00a80a2](https://www.github.com/scop/bash-completion/commit/00a80a2a830cc5cfea262865e5d97d1f901ca177)) +* puppet: Recognize some short options ([dbe7325](https://www.github.com/scop/bash-completion/commit/dbe732517ef2a2d8c628e3578db330b64d177948)) +* (testsuite) Add puppet subcommand option test case ([d748a5a](https://www.github.com/scop/bash-completion/commit/d748a5a24914a9f5f0173a98bd6435aac3d39747)) +* mpv: New completion alias + adjustments for mplayer (Debian: #749115) ([de78c16](https://www.github.com/scop/bash-completion/commit/de78c1653aad081daf28cd349e0f52801db3a180)) +* _services: README in sysv init dir is not a service ([41cdfc6](https://www.github.com/scop/bash-completion/commit/41cdfc6510093ddb6766aabb1574d2064279620e)) +* __reassemble_comp_words_by_ref: Make work with failglob on (Alioth: #312741) ([732906b](https://www.github.com/scop/bash-completion/commit/732906b25096508fbc5d15d684dea0312ed7fca0)) +* psql: Tell psql to not load .psqlrc as it may change output format (Alioth: #314636) ([9186add](https://www.github.com/scop/bash-completion/commit/9186add6298cac3c684b1123ea3c8006f87fc24b)) +* Quote unset array element to avoid globbing interference (Alioth: #314708) ([84135d7](https://www.github.com/scop/bash-completion/commit/84135d756bd395aa720c3bd08c660bc54d24f90c)) +* Various mostly array element unsetting fixes under failglob ([1ed2377](https://www.github.com/scop/bash-completion/commit/1ed2377c895d3f1826df0820d992f746c10373a9)) +* ssh-add, ssh-keygen: -? needs to be quoted under failglob (Alioth: #314709) ([24c8f1e](https://www.github.com/scop/bash-completion/commit/24c8f1e44e4e3a094745a45896963c4b3edff9ad)) +* Quote _filedir arguments when appropriate to prevent failglob failures ([8566a5a](https://www.github.com/scop/bash-completion/commit/8566a5a89633a6d689192638410914910e2a1523)) +* slapt-src: split options from their arguments ([3a65be4](https://www.github.com/scop/bash-completion/commit/3a65be4a18f67d1b5101ce1d03398728aebe0668)) +* slapt-{get,src}: Fix issue with sed not being able to handle some characters ([70e52c8](https://www.github.com/scop/bash-completion/commit/70e52c8a1fc4ebc3ea5516879505ca5da504b32b)) +* gendiff: Quoting suffix pattern to avoid triggering failglob ([154f388](https://www.github.com/scop/bash-completion/commit/154f3884139825a38e161c2e66837a35e9aa3841)) +* sbopkg, slapt-{get,src}: expand tilde in config file name ([505481c](https://www.github.com/scop/bash-completion/commit/505481c8cc4bdb13b89de8505d5d84c31314245c)) +* slapt-src: Handle --config=FILE option properly ([7220727](https://www.github.com/scop/bash-completion/commit/72207276a5d4a92c9fa0baef1f21941f9f1ad891)) +* _filedir_xspec: Fix with failglob on ([b65232f](https://www.github.com/scop/bash-completion/commit/b65232fa34e310cf357e2ff4b8921e50e260d294)) +* lvm: _lvm_count_args parameter must be quoted in order to failglob not to complain ([3717fe7](https://www.github.com/scop/bash-completion/commit/3717fe7b6d97ba8e8e8eb55ce10c05808dc4d4b8)) +* (testsuite) Add vgcreate test case for _lvm_count_args with failglob on ([615fd18](https://www.github.com/scop/bash-completion/commit/615fd18195793cd867c0a365c25069cdbb89c565)) +* _lvm: using a single-pattern case and invoking function according to words[1] ([01024f5](https://www.github.com/scop/bash-completion/commit/01024f595e9e6e3f243b2abc1a3474529ce1f083)) +* umount: Fix mount points escaping/unescaping with Bash-4.3 ([292830b](https://www.github.com/scop/bash-completion/commit/292830be53f69456d284c10dc5fea28dd393d7bc)) +* (testsuite): move testing of _linux_fstab() to umount.exp ([dcb0ea2](https://www.github.com/scop/bash-completion/commit/dcb0ea2ca29cf2c335f1b075f51290d023fcda2e)) +* _parse_help: Fix failglob failures (Alioth: #314707) ([d238ab5](https://www.github.com/scop/bash-completion/commit/d238ab5445627b6fd9888507d1b7545bb20408a7)) +* modprobe: fix params with multi-line descriptions ([454f67a](https://www.github.com/scop/bash-completion/commit/454f67a0478e2097e765169191151e9cf83fe978)) +* modprobe: Try parsing help before using hardcoding option list ([c6ec8f9](https://www.github.com/scop/bash-completion/commit/c6ec8f979bb6a6c6bdfeae75749a5be4c5145fdb)) +* ssh-add, ssh-keygen: -? needs to be quoted under failglob (take 2) (Alioth: #314709) ([60b8fab](https://www.github.com/scop/bash-completion/commit/60b8fabec499dbd56636548369ff3796e0d0d0fd)) +* isql: Fix failglob failure ([9d250f9](https://www.github.com/scop/bash-completion/commit/9d250f9b53a58c70c7a388e5d2272d8a384d6eb1)) +* Added test/site.{bak,exp} to .gitignore ([afe39fd](https://www.github.com/scop/bash-completion/commit/afe39fd1e171d0ea3d4fb8ec0d8c8c14fa120ed8)) +* adb: New completion ([4bbab19](https://www.github.com/scop/bash-completion/commit/4bbab196cbce908dacbc225de71433272228a985)) +* (testsuite) Use 'set' command posix behaviour when saving env (Alioth: #314720) ([16361c8](https://www.github.com/scop/bash-completion/commit/16361c873ba04d941c56c7e6a3fbe8d446f07ca7)) +* (testsuite) Save shell variables when saving env (Alioth: #314720) ([dbb93ae](https://www.github.com/scop/bash-completion/commit/dbb93ae77ba6613d89081b9592fb3714b604476c)) +* xz: Complete -T/--threads argument ([9e2db8a](https://www.github.com/scop/bash-completion/commit/9e2db8a03ea661eb7f4a4c41cd0558c063c04aca)) +* xmllint, xmlwf, xsltproc: Complete on *.dbk and *.docbook (Alioth: #314770) ([ab8eeb3](https://www.github.com/scop/bash-completion/commit/ab8eeb3a713b1223752336fc4cb0d515c24579cc)) +* xsltproc. TODO fix for previous commit ([7c5c622](https://www.github.com/scop/bash-completion/commit/7c5c622dda132a2c4a78028273f86fd51a9d680c)) +* python(3): Add -X argument non-completion ([eb79f9d](https://www.github.com/scop/bash-completion/commit/eb79f9d97fc384b2cbfdb0c9a782d9ef935356ab)) +* 7z, adb: Trivial cleanups ([d259e71](https://www.github.com/scop/bash-completion/commit/d259e7175851f08cda10ae6c279ab1d0e7bc8045)) +* ant: Don't offer more completions after options that exit ([98d6b5e](https://www.github.com/scop/bash-completion/commit/98d6b5e440fc666256cfb3ee2fe2f07da45f31a7)) +* (testsuite) Add ant -f test case ([40db483](https://www.github.com/scop/bash-completion/commit/40db4831747a0a4f80fcb383c0c7b5398b327538)) +* ant: Support buildfile set in $ANT_ARGS (Alioth: #314735) ([86df56d](https://www.github.com/scop/bash-completion/commit/86df56d5ec986566a33cc5b1067c6dbc6078dab1)) +* mplayer, *xine: Complete on *.mts (Debian: #759219) ([852e0f6](https://www.github.com/scop/bash-completion/commit/852e0f60f0df8264a84a3be543d09f1d13c6f04f)) +* rpmbuild: Complete *.spec on --clean (RedHat: #1132959) ([e879eb0](https://www.github.com/scop/bash-completion/commit/e879eb0a1706cad92d6df8b3c665d1d5227b1f67)) +* rpmbuild: Complete *.spec on --nobuild ([42e1f34](https://www.github.com/scop/bash-completion/commit/42e1f344b7fef71100e42ab97f63e35281116ced)) +* Comment update ([fa064e8](https://www.github.com/scop/bash-completion/commit/fa064e85633cd56000f8bf2cd8eb3bc76eceeeed)) +* _completion_loader: Set empty command to _EmptycmD_ for cross version compat ([7394d74](https://www.github.com/scop/bash-completion/commit/7394d744aee259929012cbcd53a9c268dfe9c025)) +* _init_completion: Handle cword < 0 (LP: #1289597) ([a9c556c](https://www.github.com/scop/bash-completion/commit/a9c556ccad819869a6a5d932aac0a75a99372f08)) +* pigz, unpigz: Handle *.zz ([4038c71](https://www.github.com/scop/bash-completion/commit/4038c71357dd85ee049363c6c48c513e1c1c263d)) +* Protect various compgen invocations from -* leakage (Debian: #766163) ([882649b](https://www.github.com/scop/bash-completion/commit/882649b7123855a0b87fcee7e4bc043ca2cca711)) +* (testsuite) Add cd in dir without subdirs or CDPATH test case ([9444a87](https://www.github.com/scop/bash-completion/commit/9444a8742e3aa8d1ef8eb35a377a860f9e59fa43)) +* _pnames: Add -s for producing (possibly) truncated names (RedHat: #744406) ([52d8316](https://www.github.com/scop/bash-completion/commit/52d8316c5ce4060cf86154eea3ba6fa51447760a)) +* Actually install the lz4 completion ([ed07b18](https://www.github.com/scop/bash-completion/commit/ed07b18e61bc4756c94d3230e6a0b32798087e20)) +* _completion_loader: Protect compgen from -* leakage (Debian: #769399) ([32e6e49](https://www.github.com/scop/bash-completion/commit/32e6e4908885197ae3f48da0f4fe7d182245818b)) +* gphoto2: Fix split argument handing, and colon treatment in --port args ([7d66285](https://www.github.com/scop/bash-completion/commit/7d66285b42f7847e1b5dedf5ed7c4536cb2bb288)) +* : Invoke command to be completed, not its basename ([7d3de61](https://www.github.com/scop/bash-completion/commit/7d3de619d1d84cba29597a54b4f0c0b786e8abe0)) +* gphoto2: Replace tail with awk ([89add74](https://www.github.com/scop/bash-completion/commit/89add74ae07d17eaaff811159e086663e4791d85)) +* ccache: Add -o/--set-config arg name completion ([dfb2d01](https://www.github.com/scop/bash-completion/commit/dfb2d01babcf00ecbb57c97e648d97881004797d)) +* chrome, firefox etc: Complete on *.pdf ([6a60025](https://www.github.com/scop/bash-completion/commit/6a60025e01165cddce61257902358badd738f1fa)) +* strings: Fix -T/--target arg completion with non-English locale ([976ad96](https://www.github.com/scop/bash-completion/commit/976ad96007fbc8edac189737876e485e0cc38e08)) +* upstart support for service completion ([3567d93](https://www.github.com/scop/bash-completion/commit/3567d9354fbc40f050831559df17d442e3177a8d)) +* (testsuite): Add mcrypt -a and -m argument completion tests ([377e240](https://www.github.com/scop/bash-completion/commit/377e24024ee419a50fd21a1ae2e984f19ac512b3)) +* mcrypt: Simplify -m arg completion ([a592a09](https://www.github.com/scop/bash-completion/commit/a592a09cc6fb1d43ef737baf5b31371f55ad19d0)) +* tshark: Simplify cut usage ([23bf3bd](https://www.github.com/scop/bash-completion/commit/23bf3bd412adb3cfff774f019d8c376658d50152)) +* createdb, dropdb: Drop -o default, it does not appear to do anything good here ([e71b452](https://www.github.com/scop/bash-completion/commit/e71b4522d18306dfa98b013441122910a1166ea9)) +* createuser: New completion ([7999f28](https://www.github.com/scop/bash-completion/commit/7999f28f62f49caf2b736fd835152c2579c2646d)) +* dropuser: New completion ([3cf50a1](https://www.github.com/scop/bash-completion/commit/3cf50a1437f9f0b8ef16bd6ea58db18e7a9204f6)) +* profile.d: Avoid some warnings from shells in "nounset" mode (Debian: #776160) ([c725e6b](https://www.github.com/scop/bash-completion/commit/c725e6b195ea6ac2d25dfbb85b7e87bfbe42fe68)) +* cppcheck: Option argument (non-)completion update ([e687c3a](https://www.github.com/scop/bash-completion/commit/e687c3a1085e06502b882f71b4deab79266b9b14)) +* reptyr: Rename file to _reptyr to avoid conflict with upstreamed completion ([6a4ad49](https://www.github.com/scop/bash-completion/commit/6a4ad49fa53cc92d3bd23b5b4db0b3318f2ef136)) +* tune2fs: Add missing return in -M arg completion ([edea6cb](https://www.github.com/scop/bash-completion/commit/edea6cb6da246930c1314384ba2f150efd0c07d5)) +* synclient: New completion ([6a1bf8d](https://www.github.com/scop/bash-completion/commit/6a1bf8d11430fea80864bd0fef46210143d91407)) +* Drop reference to no longer used sysconf_DATA ([ba79e9e](https://www.github.com/scop/bash-completion/commit/ba79e9e5798ac4f25036ddf15885cd3bbaeed4bc)) +* README: Add autotools and cmake tips ([3a8e7bd](https://www.github.com/scop/bash-completion/commit/3a8e7bd0fe45b4ebf76b4cd6da9246034b2e0557)) +* README: Add cmake usage example ([889718b](https://www.github.com/scop/bash-completion/commit/889718be68ccd442ee824f6405d706d8e2734a03)) +* README: Don't hardcode /etc in cmake fallback dir ([2c5efee](https://www.github.com/scop/bash-completion/commit/2c5efeec3a3b8cf29dd2f161935e786988d9dc36)) +* Revert "README: Don't hardcode /etc in cmake fallback dir" ([caaa474](https://www.github.com/scop/bash-completion/commit/caaa4745e40a5d1d9122b0774ba589ef5fafbcbf)) +* Load user completions from $BASH_COMPLETION_USER_DIR/completions ([1d25d72](https://www.github.com/scop/bash-completion/commit/1d25d72ca8633c19cb089dff447d08c531379c59)) +* 2015 ([d423969](https://www.github.com/scop/bash-completion/commit/d423969756d0043007d80a7b30e5b4c611e06883)) +* _filedir: Fix overquoted argument to compgen -d (RedHat: #1171396) ([d2920b7](https://www.github.com/scop/bash-completion/commit/d2920b7e79e5f347fed064b2a5aa952ef200e615)) +* _filedir: Remove unused variable ([80c2bb6](https://www.github.com/scop/bash-completion/commit/80c2bb696437134d6d8a3fb9c9f455fec75f470a)) +* make: Add __BASH_MAKE_COMPLETION__ variable ([f9115ce](https://www.github.com/scop/bash-completion/commit/f9115ce0bb215e9089266d6f1ec20c3375aa970a)) +* _filedir: Avoid some unnecessary work with -d ([40c764a](https://www.github.com/scop/bash-completion/commit/40c764af57ea0cd0c5c5cebeba6c838230d30c93)) +* gnokii: New completion ([3eb1b0d](https://www.github.com/scop/bash-completion/commit/3eb1b0dda81f2bc15a6c4f104cb5f0d2169c3101)) +* gnokii: Various minor and cosmetic fixes ([b07e355](https://www.github.com/scop/bash-completion/commit/b07e35511138adc2a375ea3fcd21aee6a175e4f3)) +* (testsuite): Add basic gnokii test case ([90ebb7e](https://www.github.com/scop/bash-completion/commit/90ebb7eb54b5598a5780dab90c984bad160f4268)) +* gnokii: Drop dead code ([ca138d0](https://www.github.com/scop/bash-completion/commit/ca138d05db3853ea89f09979be3c32eea554de1c)) +* gnokii: Fix completions of options that are prefixes for others ([8930330](https://www.github.com/scop/bash-completion/commit/89303303bd28d2c0b9d1e7e69e607ca2cf650760)) +* gnokii: Include and install it ([1950590](https://www.github.com/scop/bash-completion/commit/1950590367838993fba00586139137a50a1d4f80)) +* make: Fix detection of intermediate targets where make has changed its database whitespace ([4b209b0](https://www.github.com/scop/bash-completion/commit/4b209b0b172ddecff1e9aaf5de9ea64267fb9053)) +* jshint: New completion ([adff509](https://www.github.com/scop/bash-completion/commit/adff509ec54a45957ac3c0f1facbe6dec3c5a0aa)) +* tar: rework the completion completely ([8b23c84](https://www.github.com/scop/bash-completion/commit/8b23c84cc2935b15b8cb2ac1a90d061b914229a6)) +* bsdtar, tar: Remove symlinks from git, have make create them ([81cfa06](https://www.github.com/scop/bash-completion/commit/81cfa067cc1bcb9d508beb8f6689e14e436e2220)) +* (testsuite) Add required "empty" dir for tar ([a8f4507](https://www.github.com/scop/bash-completion/commit/a8f450797b47c25670c87452392161609ea67c36)) +* tar: Style tweaks ([055d1ae](https://www.github.com/scop/bash-completion/commit/055d1ae59f54bf20d22b068631698427f38ce4a0)) +* tar: Plug $line var leak ([d049481](https://www.github.com/scop/bash-completion/commit/d0494819521c1a70e3d83e26f2a55620ea64e89d)) +* eog: Complete on *.ppm (RedHat: #1090481) ([6c2ae9f](https://www.github.com/scop/bash-completion/commit/6c2ae9fb18cb56d89b190286a422b60f03d85ba4)) +* Document how to avoid command_not_found_handler interference ([1d9e705](https://www.github.com/scop/bash-completion/commit/1d9e705639e40c28b3ae4ce2a99c9c7308e3c653)) +* sysctl: Try parsing options from help before usage ([e9fe2d9](https://www.github.com/scop/bash-completion/commit/e9fe2d9f7b9c3401f990b140d58de9e6c6b42a5c)) +* sysctl: Return early on --help, --version ([d01427d](https://www.github.com/scop/bash-completion/commit/d01427df599c8ef2a32c95e286a6c82045d4d26e)) +* ssh: Add -Q argument completion ([b6ffe26](https://www.github.com/scop/bash-completion/commit/b6ffe261f8515d4fddb319424b87d4d38d10dd91)) +* ssh: Query ciphers and macs from ssh before hardcoded fallback ([cf4c7eb](https://www.github.com/scop/bash-completion/commit/cf4c7ebf6c754028957fe0061d0ed247a47ecb1c)) +* ssh: Complete HostbasedKeyTypes,HostKeyAlgorithms,KexAlgorithms values ([2779b66](https://www.github.com/scop/bash-completion/commit/2779b66e5dc8d0278dcde921ed29fc60ce89f181)) +* checksec: New completion ([ffd9038](https://www.github.com/scop/bash-completion/commit/ffd9038923aed3e8be6fe1c746ea3d41407cacb6)) +* pdftotext: New completion ([4289460](https://www.github.com/scop/bash-completion/commit/4289460691719255ca5d34c04d2a7cacc6ccd1ba)) +* pgrep, pidof, pkill, pwdx, vmstat: Add support for procps-ng ([f68589f](https://www.github.com/scop/bash-completion/commit/f68589fde4a95c1b30c9cbb70dcfada133f0f09e)) +* __get_cword: avoid $index < 0 (Alioth: #315107) ([fa1ad7d](https://www.github.com/scop/bash-completion/commit/fa1ad7dff9e7099b14552a8782181e9b00f89cc2)) +* rpm: Add --whatenhances/recommends/suggests/supplements and --recommends/supplements completions ([81acda7](https://www.github.com/scop/bash-completion/commit/81acda727a9ca34eb156c69becf38eac68b50ea7)) +* modplug*: Associate *.oct and *.okt ([69cfaed](https://www.github.com/scop/bash-completion/commit/69cfaed89c25171d40d9d268de7ab6b9412b159f)) +* __load_completion: New function, use in _completion_loader and _xfunc ([cad3abf](https://www.github.com/scop/bash-completion/commit/cad3abfc7ec1cfc2ae17a2330bf9f23993c73f09)) +* mpv: Remove mplayer-aliased completion ([00abd48](https://www.github.com/scop/bash-completion/commit/00abd48e5b1d5d79fff46b7f791b2b90d1d6953b)) +* make: Offer hidden targets when it is clear that the user is trying to complete one of them ([e0c0832](https://www.github.com/scop/bash-completion/commit/e0c08321795c8174fa2275d2683c4ffc1b36db5b)) +* ssh-copy-id: Offer only *.pub to -i ([f9f66c3](https://www.github.com/scop/bash-completion/commit/f9f66c39d35c18c5985bc2baca2242c2e17d539a)) +* sftp: Add -l arg non-completion ([4d82190](https://www.github.com/scop/bash-completion/commit/4d82190da70621d6b0fc375c063e12f97b27edb4)) +* scp, sftp: Fix querying ssh options ([50ea015](https://www.github.com/scop/bash-completion/commit/50ea015f8bc66919eb0ecc7ed351c1f89755f8c0)) +* scp, sftp: Complete -S on commands ([35a0f97](https://www.github.com/scop/bash-completion/commit/35a0f97a5a9bb0aadf834a81761855ad65bb5e28)) +* (testsuite) Ignore files generated by complete-ant-cmd.pl ([f661811](https://www.github.com/scop/bash-completion/commit/f6618113b55e49c4c81f3a2a9fd5dc95a36a683f)) +* make: Don't pick up variables when makefile is reloaded ([c5451db](https://www.github.com/scop/bash-completion/commit/c5451dbd310074f8bceeada0e48e542713dada1e)) +* Load completions also from $XDG_DATA_DIRS (RedHat: #1264094) ([c89dcbb](https://www.github.com/scop/bash-completion/commit/c89dcbbd5510876f6304ef10806b00cc9fda19dc)) +* chronyc: Add -6 option ([7669f0c](https://www.github.com/scop/bash-completion/commit/7669f0c1bece8f4a344d8e22f7d4969f8f141c10)) +* chronyc: Add missing subcommands ([ef26136](https://www.github.com/scop/bash-completion/commit/ef26136ea3f4fcf123c1a4af741be625fbac1a05)) +* chronyc: Update help text parsing ([bc03de5](https://www.github.com/scop/bash-completion/commit/bc03de502c3d8391ee220a3a28ed964db8c5e73a)) +* chronyc: Wrap long lines ([aa404ca](https://www.github.com/scop/bash-completion/commit/aa404ca17d3838b18669e006ab30446cb402988b)) +* chronyc: Parse command args from help output ([5fd0077](https://www.github.com/scop/bash-completion/commit/5fd00776c49f1d4552630c986e70f21e4a6028ad)) +* ssh: Avoid completing commands before hostname ([f8f6ffa](https://www.github.com/scop/bash-completion/commit/f8f6ffa72ed3db9c6628b50f1bd3ef9582b4f264)) +* cppcheck: Add native to --platform completions ([9cbd68b](https://www.github.com/scop/bash-completion/commit/9cbd68becbd728d5fda88a6f456c4c72eac92ec8)) +* minicom: Recognize user ~/.minirc.* as config files ([39acdb2](https://www.github.com/scop/bash-completion/commit/39acdb21e89f89c207089da4c061c193d5d8af84)) +* test suite: Fix ssh-copy-id test on old setups with no identities ([e899139](https://www.github.com/scop/bash-completion/commit/e899139ee38b96ebbf2338d35b4f5e99dce514a4)) +* test suite: Expect failure in modinfo/modprobe if there are no modules ([0a6877e](https://www.github.com/scop/bash-completion/commit/0a6877e8395ac6b46b4bdf3877b674c37aa4dec8)) +* Set up Travis ([e3c8573](https://www.github.com/scop/bash-completion/commit/e3c8573d14866041516beb3a503e3bd752666ec2)) +* test suite: Output tool log on failure in CI ([fa6b80f](https://www.github.com/scop/bash-completion/commit/fa6b80f89c53233fd00b9c33fde2161eef9d8e2a)) +* test suite: Make apt-get test less sensitive to available commands ([7234914](https://www.github.com/scop/bash-completion/commit/7234914a9fb3a17bc116f18bd1a8b6e4beece147)) +* travis: Avoid Travis default ri, use distro one instead ([dc6e8c2](https://www.github.com/scop/bash-completion/commit/dc6e8c257fb895142564eac871daeec78331d522)) +* README: Update POSIX spec link ([ac9f41b](https://www.github.com/scop/bash-completion/commit/ac9f41b93d8d280c9069cfb06efffcef991404d0)) +* Update URLs and various instructions to GitHub ([53215d4](https://www.github.com/scop/bash-completion/commit/53215d4a74ace3477e48dc70e5be19f8bb3c0866)) +* aclocal, automake: Install for versioned 1.14 and 1.15 executables ([caf3b36](https://www.github.com/scop/bash-completion/commit/caf3b364e367bcb2bd518fd436ec134049c2c9e6)) +* build system: Switch to xz compressed tarball ([b51eb9d](https://www.github.com/scop/bash-completion/commit/b51eb9d7f1bc9a7ad6c6f5feb56fca5b963572fa)) +* Drop references to bash-completion-devel@lists.alioth.debian.org ([aee91a9](https://www.github.com/scop/bash-completion/commit/aee91a91baa3c32dc315be39d5f95f8045217594)) +* README: Convert to markdown ([0d3e597](https://www.github.com/scop/bash-completion/commit/0d3e59703fa016f2a8ed0fe6efdfe7fd00fa9250)) +* README: Split contributing to separate CONTRIBUTING doc ([0345d02](https://www.github.com/scop/bash-completion/commit/0345d028ee4ad7793d6293a54bb69929e442041b)) +* Use command built-in to run sed to avoid any custom aliases ([0b37725](https://www.github.com/scop/bash-completion/commit/0b377254203680cb483168f45eaac301db8ac1b3)) +* test suite: Fix ssh partial hostname completion test ([4f13792](https://www.github.com/scop/bash-completion/commit/4f13792b4fe87ebfcd6d9bbe15c9813f2a1b2a94)) +* travis: Run tests with --all to get some more useful output ([d04af62](https://www.github.com/scop/bash-completion/commit/d04af6260a7cfcb1c521298eae346bec9303bfc0)) +* travis: Install more packages for [0-9][ab]* test coverage ([0cec990](https://www.github.com/scop/bash-completion/commit/0cec99072d36ffe68bec89e4e668ec94b4534929)) +* test suite: Use unsupported instead of xfail for modinfo/modprobe cases ([501c106](https://www.github.com/scop/bash-completion/commit/501c10692dfcf744dbf333d78e0ed933b9dc51a8)) +* test suite: Mark unsupported look test case as such, not unresolved ([3dedaa9](https://www.github.com/scop/bash-completion/commit/3dedaa9dd971ea1177561c3f4525ad044ca5dfc5)) +* travis: Add note about (currently) N/A packages ([b5caa09](https://www.github.com/scop/bash-completion/commit/b5caa09b6d1a24d778e87cb65f31590e8ce8b8e6)) +* travis: Install more packages for c* test coverage ([e41426a](https://www.github.com/scop/bash-completion/commit/e41426a57d9924a22af16e2d92b062568470ee61)) +* travis: Install more packages for [de]* test coverage ([1cca6ed](https://www.github.com/scop/bash-completion/commit/1cca6ed104330e1541942204890063f8accf798d)) +* Modify all usages of 'sed' to be run with command bash builtin ([1aad419](https://www.github.com/scop/bash-completion/commit/1aad419db4851fc7fa4b2e384645ecda2f000d88)) +* lint: Check for sed without "command" ([417122b](https://www.github.com/scop/bash-completion/commit/417122bd0293d79921cde05d80ecc1b6654a3542)) +* gnokii, minicom: Use grep through "command" ([536d79f](https://www.github.com/scop/bash-completion/commit/536d79ff42b38b38cc7b7453b0219e6dda888efc)) +* mysql, puppet: sed portability fixes ([f8b0828](https://www.github.com/scop/bash-completion/commit/f8b0828e4fcb25f9628b268fb760aa23cc5db60f)) +* mysql: Fix --default-character-set completion with mariadb ([695b28a](https://www.github.com/scop/bash-completion/commit/695b28aa860d867c49c2ea17e62f1d5b6ebd80a7)) +* travis: Install more packages for [fg]* test coverage ([987af3f](https://www.github.com/scop/bash-completion/commit/987af3f463cbe48f7b31b1a7bed9f3262772b716)) +* travis: Install more packages for [hi]* test coverage ([e0ff9ce](https://www.github.com/scop/bash-completion/commit/e0ff9cea15612e529c9d0702c0cf7ecc61860e67)) +* Update copyright year ([68f3e4e](https://www.github.com/scop/bash-completion/commit/68f3e4eb144125ac3d5dfc57f9482f4815dc9c41)) +* indent: Remove generic long option completion ([c4517d3](https://www.github.com/scop/bash-completion/commit/c4517d393250863afbb9ddc9b481ea6a61519720)) +* Don't complete hostnames found after Hostname in ~/.ssh/config ([4621117](https://www.github.com/scop/bash-completion/commit/46211179bff660992417fccd68e598b4e612e56a)) +* travis: Install more packages for [jkl]* test coverage ([6699288](https://www.github.com/scop/bash-completion/commit/6699288aee3ffd0530ad268fe06bc5c042eecec5)) +* travis: Install more packages for m* test coverage ([3495a48](https://www.github.com/scop/bash-completion/commit/3495a48ecbef38ab5e12ff41ecdbd22cb54c933c)) +* travis: Install more packages for [op]* test coverage ([26c2d23](https://www.github.com/scop/bash-completion/commit/26c2d231dd5e081c7e45d693eeb0f8a667850b0c)) +* travis: Install more packages for [qr]* test coverage ([d491063](https://www.github.com/scop/bash-completion/commit/d4910632f213af7eb6ee537300b1f76ce2faa0b7)) +* travis: Install more packages for [stuvw]* test coverage ([9d12e2c](https://www.github.com/scop/bash-completion/commit/9d12e2c554b7e2963773792f6936dc75df540951)) +* travis: Install more packages for [xyz]* test coverage ([18ca938](https://www.github.com/scop/bash-completion/commit/18ca93839af37b1e494c832016d2a766833ea7f4)) +* Remove various comments related to bash versions we don't support ([ffdc9da](https://www.github.com/scop/bash-completion/commit/ffdc9daecebf5ca4b45995de40469579fd36aac7)) +* ssh: Extract duplicate code to _ssh_configfile ([09f56f8](https://www.github.com/scop/bash-completion/commit/09f56f80a68f2fddc52cf8c91637b80c6ae02164)) +* xmllint, xmlwf, xsltproc: Complete on Mallard *.page files ([1c005b1](https://www.github.com/scop/bash-completion/commit/1c005b19e9b262fdd40c8fc5aae4e75779b1d78b)) +* README: Expand troubleshooting section somewhat ([06996ea](https://www.github.com/scop/bash-completion/commit/06996ea0d4ac83a002613f1d7e50ce68a595cb31)) +* README.md: Not need for autoreconf, fixes #11 ([20f9013](https://www.github.com/scop/bash-completion/commit/20f9013f38d5c54892900654ab037c173e5cc167)) +* zopflipng: New completion ([56c3ea1](https://www.github.com/scop/bash-completion/commit/56c3ea163fd294a144a79d641881f34e625b77db)) +* README.md: Markdown tweaks ([8a748d3](https://www.github.com/scop/bash-completion/commit/8a748d32fae35f2dcf5a7c7061f183a18adae320)) +* README.md: More markdown tweaks ([76d8823](https://www.github.com/scop/bash-completion/commit/76d88231013b0027239a5523f9c70f0ad3f571ee)) +* make-changelog.py: Make work with Python 3 ([8a9cb54](https://www.github.com/scop/bash-completion/commit/8a9cb54d9769fcfebc37d85d204a5893b7ae0eee)) +* make-changelog.py: flake8 fixes ([47ca0cd](https://www.github.com/scop/bash-completion/commit/47ca0cdaba318f6419b20d86050c6ef04ce1ce66)) +* make-changelog.py: Fix footer line output ([d178db6](https://www.github.com/scop/bash-completion/commit/d178db64b28bc5db39a33641930deefeab4baf10)) +* make-changelog.py: Set myself in footer ([7c713e8](https://www.github.com/scop/bash-completion/commit/7c713e872606558fc7314425e3dbaf3d85fea81f)) +* README.md: Note autoreconf need only in unprepared tarball ([3c3b696](https://www.github.com/scop/bash-completion/commit/3c3b696e8a9604f3a0dec159aa5da2c1c4d0f09e)) + +## 2.1 (2013-04-05) + +* eog: New completion. ([3a1cdbd](https://www.github.com/scop/bash-completion/commit/3a1cdbdadc92e041b3b446f4d40d5ffcabe86d4e)) +* wsimport: New completion. ([bffce42](https://www.github.com/scop/bash-completion/commit/bffce4218e33bc61c0551b87e4b5bfbb41ad4223)) +* kcov: Add new sort types (introduced in kcov-9). ([36f1b83](https://www.github.com/scop/bash-completion/commit/36f1b832fd3544dd44dad7b6bce5c115f45cd50d)) +* kcov: Complete arguments of --limits option. ([f604f6c](https://www.github.com/scop/bash-completion/commit/f604f6ce5b952e10ea6053445e9f70c2079943b8)) +* Add .msi completion for Wine ([f3e3fc5](https://www.github.com/scop/bash-completion/commit/f3e3fc5a4d51367a3e8ce29255bb386c809d0947)) +* ssh: Add -O argument completion (Debian: #680652). ([217e143](https://www.github.com/scop/bash-completion/commit/217e143fd69ad2b83ec8187af2e9e1c21dcb759a)) +* Add more complete OpenDocument support to unzip completion. ([6a71ee5](https://www.github.com/scop/bash-completion/commit/6a71ee504c11b798125b9c85359d5b7367a27dd4)) +* Add support for OOXML document format extensions to unzip completion. ([7c7b560](https://www.github.com/scop/bash-completion/commit/7c7b5608c8505633aa55e106f98d2a943937d41a)) +* Fine tune previous commit. ([ca53345](https://www.github.com/scop/bash-completion/commit/ca533452195134de6ceb5c3f894e824fac53849a)) +* wine: Fix extension glob to work on its own. ([e2e64a1](https://www.github.com/scop/bash-completion/commit/e2e64a16329cf0005006dffea590dce20200469d)) +* man: Add support for .lz man pages (RedHat: #839310). ([c9ed166](https://www.github.com/scop/bash-completion/commit/c9ed16694da974ce9faa3f49a274c7c6cfb4abc9)) +* man: Trivial cleanups. ([a624cc2](https://www.github.com/scop/bash-completion/commit/a624cc2c3026981835330f4d001b7df53f8d84ae)) +* clzip, pdlzip, plzip: New lzip alias completions. ([fc107b4](https://www.github.com/scop/bash-completion/commit/fc107b4bdc5a42302b6316ab80755d6cca69d9ba)) +* lzip: Do not append space after equal sign in long options. ([9f0a6e4](https://www.github.com/scop/bash-completion/commit/9f0a6e45f8238e3220db3ffaa058c39110ea7a59)) +* mussh: New completion. ([882d527](https://www.github.com/scop/bash-completion/commit/882d527237c77cdc757672affa070bb1b150b778)) +* mount.linux: Add some new mount options intoduced in Linux 3.5 ([3ea1597](https://www.github.com/scop/bash-completion/commit/3ea1597d3c6c926553b850caad75527a08412eb1)) +* mount.linux: Clean up mount options, remove duplicates. ([3aa040d](https://www.github.com/scop/bash-completion/commit/3aa040d25f5556b6e9bf92c784072aba7620f729)) +* Remove trailing whitespace ([3f9fe7a](https://www.github.com/scop/bash-completion/commit/3f9fe7a853c74d68f64e05ecaca474e7a6819d81)) +* Remove more whitespace ([a9b253c](https://www.github.com/scop/bash-completion/commit/a9b253ca8b475dc2ffda6edc7451af28d23d4eed)) +* Trim trailing whitespace. ([a6ff579](https://www.github.com/scop/bash-completion/commit/a6ff57986f22d19e7a638e398a73a1a3ac19ff13)) +* slackpkg, slapt-get: Update the list of package sets. ([371fb91](https://www.github.com/scop/bash-completion/commit/371fb91b213c3bb4b86eb22e09701ec1be18b7dd)) +* colormake: New make alias completion (LP: #743208, Debian: #682557). ([31e262b](https://www.github.com/scop/bash-completion/commit/31e262bcaf9bee249deb24a0e08cd85346d7a628)) +* Ignore colormake symlink. ([6158bd2](https://www.github.com/scop/bash-completion/commit/6158bd2d86f6122cfc8d3df045e9f4c7c8f3293a)) +* opera: Handle options. ([3c49af9](https://www.github.com/scop/bash-completion/commit/3c49af9ec97b66553c3d756de8f4b5a5f8a54708)) +* mount.linux: Add options completion for davfs. ([f379e92](https://www.github.com/scop/bash-completion/commit/f379e9275c5a966dacd3b2bd45a5b651aae55641)) +* evince: Evince supports opening .pdf.xz files (Alioth: #313739). ([30f9335](https://www.github.com/scop/bash-completion/commit/30f93357c81bf3fbb03ef8a6b3b0f5ce9addde13)) +* Fix __reassemble_comp_words_by_ref for $COMP_CWORD == ${#COMP_WORDS[@]} ([dc15093](https://www.github.com/scop/bash-completion/commit/dc150937d126430f5cc20dfaf3239a71049fe0df)) +* valgrind: Add --soname-synonyms option arguments completion. ([904faab](https://www.github.com/scop/bash-completion/commit/904faab0c57b4f6a65a4f62dc9f644d4771e59fe)) +* eject: New completion. ([b9276c8](https://www.github.com/scop/bash-completion/commit/b9276c8a374ac5e8cbe7ac814fe3c989f903ddd0)) +* fusermount: Complete curlftpfs-mounts for "fusermount -u" (Debian: #685377) ([2897e62](https://www.github.com/scop/bash-completion/commit/2897e62fe7e535eb048f7e08f03ac3fbc3a84fa5)) +* gphoto2: new completion ([92ddcea](https://www.github.com/scop/bash-completion/commit/92ddcea20a473a8d59b1efaea94261b4b36fa35c)) +* nmcli: new completion ([7f1721d](https://www.github.com/scop/bash-completion/commit/7f1721dd9064e5685b984975a7819bfe18b8d71b)) +* cppcheck: Add new standards to --std option. ([1c362f4](https://www.github.com/scop/bash-completion/commit/1c362f4c99eea0ae32ffb6f006f71d1bfb18bc78)) +* make: convert make completion to use smarter parser ([b28d710](https://www.github.com/scop/bash-completion/commit/b28d7108d3677c61bd01c51ccee8bb1cf9e3bfba)) +* Fixed tilde expanding in _filedir_xspec ([fdb080f](https://www.github.com/scop/bash-completion/commit/fdb080ff89195f85e1b76d0752979dfefa777595)) +* make: Do not append space if target is a filepath. ([2babb45](https://www.github.com/scop/bash-completion/commit/2babb45402ee338b888056f01222a602d07a44cd)) +* tar: Fix detection if the $prev is a tar file. ([3622f2f](https://www.github.com/scop/bash-completion/commit/3622f2f9e531ddbb243b39774546cf11ee9ccf3e)) +* _parse_help, _parse_usage: Run commands in C locale. ([8227351](https://www.github.com/scop/bash-completion/commit/822735146f5a5ef71c75f6f8494ad3969eaf2cc5)) +* testsuite/_filedir: Remove the cruft from the a\$b->h unit test (Alioth: #313480) ([23ac383](https://www.github.com/scop/bash-completion/commit/23ac38333e469eac47d35dae7c640bff4a6b5203)) +* make: incremental completion for make with compact display ([39f00f9](https://www.github.com/scop/bash-completion/commit/39f00f92e52b783e7e9e43aac4b4274cc9dee152)) +* make: Convert internal variable names to lowercase, indentation fix. ([b93e399](https://www.github.com/scop/bash-completion/commit/b93e3999b0c485a9808c1d4cb0f825b8019b5a73)) +* lvm volumes: Complete on /dev/mapper/* (RedHat: #851787). ([8e63eaf](https://www.github.com/scop/bash-completion/commit/8e63eafb83342dec5a04fe3c49330c6cbe00f96d)) +* tar: Don't take -I to mean bzip2. ([f321357](https://www.github.com/scop/bash-completion/commit/f32135799155cbde9237567a5a3a811172adf341)) +* feh: Add new options introduced in feh-2.7. ([52163a3](https://www.github.com/scop/bash-completion/commit/52163a337f34cf185fe55833bbd41080a0228baf)) +* wget: New completion. ([e29c6bc](https://www.github.com/scop/bash-completion/commit/e29c6bc872ba437f48eae7c70347c843413de4cc)) +* wget: Fix completion of multiple tags for --{follow,ignore}-tags. ([e0c70ab](https://www.github.com/scop/bash-completion/commit/e0c70abc8b63bed961b736b17e4757ca0a5f1875)) +* useradd: Fix -k, -K, and --home-dir argument completions. ([09d24da](https://www.github.com/scop/bash-completion/commit/09d24da884fcf98a7a22a4487ab79f03c3f20026)) +* useradd, usermod: Support comma separated -G/--groups arg completion. ([8ec4846](https://www.github.com/scop/bash-completion/commit/8ec484692225f2f1565975a763df856dfbb7f27b)) +* wget: Use == instead of =. ([d803323](https://www.github.com/scop/bash-completion/commit/d803323974dd979a55f7f87e96e96b5bf9d9da4f)) +* cppcheck: Add --language/-x argument completion. ([b9189ce](https://www.github.com/scop/bash-completion/commit/b9189ce170388d87c46a4a37f3e05dba0cd8878a)) +* new completion: svcadm ([80356ca](https://www.github.com/scop/bash-completion/commit/80356ca816cfee198bad59359d7a641449183fec)) +* new completion: pkg-get ([6ddec67](https://www.github.com/scop/bash-completion/commit/6ddec67c2f923ce54f3935bc23822c9eaf350430)) +* new completion: pkgadd ([a54fa73](https://www.github.com/scop/bash-completion/commit/a54fa7340a617eabb2c3bfede9a24c9f142505be)) +* new completion: pkgrm ([ff444b5](https://www.github.com/scop/bash-completion/commit/ff444b528397f273d46da7c52a445b924adccc00)) +* new completion: pkgutil ([e5ac55d](https://www.github.com/scop/bash-completion/commit/e5ac55d5df03b04ff082cebd8245fc28c2ef59fd)) +* better entry ([166ac77](https://www.github.com/scop/bash-completion/commit/166ac7754f31d95e7230cb80c521cda01e441faa)) +* fix perms ([8002d32](https://www.github.com/scop/bash-completion/commit/8002d320afee9e38aa39c1acb553402f4f109f84)) +* zathura: Add simple completion for zathura document viewer. ([97eb4da](https://www.github.com/scop/bash-completion/commit/97eb4daa62004ee882961ccd49e7af7418443c81)) +* gpg, mplayer: Restore correct options. ([6be8628](https://www.github.com/scop/bash-completion/commit/6be86286d6db176b785dcea5fdd262b49e133934)) +* lvm: Fix typo in option name: s/continguous/contiguous/. ([b2365b3](https://www.github.com/scop/bash-completion/commit/b2365b3d8743fb0fdca70c5138e66e6b389ba5bd)) +* mplayer: Add -subcp argument completion. ([7f2eb83](https://www.github.com/scop/bash-completion/commit/7f2eb8327c9c59576cd181f813bd27e6e681b02b)) +* mplayer: Add some new option argument completions. ([f3e1079](https://www.github.com/scop/bash-completion/commit/f3e10798e68d9b714a0f527179c48b22ab5c16ce)) +* mplayer: Cleanup. ([2c28608](https://www.github.com/scop/bash-completion/commit/2c2860826fdc624b6aad6532dd46cef79389d872)) +* mplayer: Add opus to the list of supported formats. ([b5dce1c](https://www.github.com/scop/bash-completion/commit/b5dce1c4b69ff2e9935941e54bf9f1ef3ceee542)) +* completions/Makefile.am: symlinks depends on $(DATA) to avoid race conditions ([370b7a0](https://www.github.com/scop/bash-completion/commit/370b7a0d2fdf7f322b59f3c35c1cea19901ef2f2)) +* _command_offset: Restore compopts properly (Alioth: #313890) ([2472fad](https://www.github.com/scop/bash-completion/commit/2472fad5de03ef91864926240a709b3f2b72a173)) +* Update copyright year and release number. ([3b93c22](https://www.github.com/scop/bash-completion/commit/3b93c22a5bb9e47301fca89ec677a9805ea71518)) +* _known_hosts_real: Filter ruptime stdout error spewage (Alioth: #313893). ([f917b75](https://www.github.com/scop/bash-completion/commit/f917b750dda9dc977579c264840878a97ed0fdfe)) +* lv{create,resize,extend}, vg{create,reduce,extend,split}: Fix variable leaks. ([b2d985c](https://www.github.com/scop/bash-completion/commit/b2d985c0bf9c0013a86cb63247d67b0ed39c9e75)) +* man: Fix -P/--pager full path arg completion. ([b8cbf1b](https://www.github.com/scop/bash-completion/commit/b8cbf1ba9401fc99375e01cfc122a7ef2aa620f2)) +* tcpdump: Fix -z full path arg completion. ([f009a1b](https://www.github.com/scop/bash-completion/commit/f009a1bfca25e262a68bbe52520bf91531ae6773)) +* valgrind: Fix full path arg completion. ([c6f6080](https://www.github.com/scop/bash-completion/commit/c6f6080569e3572893a6ff6561b3b8182dd2d2c1)) +* vgcreate: Add missing symlink. ([e3a1a49](https://www.github.com/scop/bash-completion/commit/e3a1a49b972d1ade7342cd53a0a47d2589466fa1)) +* lvm: Take option args into account when counting args (RedHat: #860510). ([e96613e](https://www.github.com/scop/bash-completion/commit/e96613e32e21ea389dddba9756bf3d78070acc4b)) +* lvm: Add _lvm prefix to helper functions. ([609034d](https://www.github.com/scop/bash-completion/commit/609034db74f60eab6ae4531696a44849647f7d42)) +* mount: Fix parsing /etc/fstab on *BSD. ([7d59112](https://www.github.com/scop/bash-completion/commit/7d591128a8baf91dfe3a461ae53f7acded4c7473)) +* feh: Fix list of background styles. ([9e04f3e](https://www.github.com/scop/bash-completion/commit/9e04f3edc8e70c5aeef98866e400f772c0395e10)) +* mount.linux: Add options completion for nfs. ([4a76f5a](https://www.github.com/scop/bash-completion/commit/4a76f5a16646ef3c0407e092a66f9f35e273ff81)) +* mount.linux: Add some new mount options intoduced in Linux 3.7 ([74a37e7](https://www.github.com/scop/bash-completion/commit/74a37e7507ff5c779a8cdd271b2aeb80d33bcc96)) +* chronyc: New completion. ([ff11fed](https://www.github.com/scop/bash-completion/commit/ff11fed5f8f1d73b02d515da3af335644807ab4d)) +* scp: Treat strings with slash before colon or starting with [.~] as local. ([41a37d7](https://www.github.com/scop/bash-completion/commit/41a37d767940af7928282874618e3dc60549de54)) +* useradd,userdel,usermod: Add -R/--root arg completion. ([5c8279b](https://www.github.com/scop/bash-completion/commit/5c8279b818560146176372752c4a87c588207674)) +* userdel: Add -h/--help non-completion. ([1d75b67](https://www.github.com/scop/bash-completion/commit/1d75b671a00337ae74a1295682c130649aef3bfe)) +* luseradd,lusermod,luserdel: New completions. ([08203f7](https://www.github.com/scop/bash-completion/commit/08203f7743ea41e7f10a891c130a18be713bd494)) +* man: Don't expand man page extensions too early. ([49ea121](https://www.github.com/scop/bash-completion/commit/49ea121e5d86eea76bfa18174fd8f70911217d09)) +* ssh: Add some -o and related arg completions. ([45c9ff5](https://www.github.com/scop/bash-completion/commit/45c9ff5f691cfb6decdba1bf362708a698b3d595)) +* fix interface completion ([b9b4c6b](https://www.github.com/scop/bash-completion/commit/b9b4c6bf2ce61d46a798f11a4d04bc55ba276b0a)) +* add -p option completion ([89098f7](https://www.github.com/scop/bash-completion/commit/89098f79fd33216a46f7135a994f4c0a8057671f)) +* nc: New completion. ([26991e1](https://www.github.com/scop/bash-completion/commit/26991e1bf4270a95dfea537b7ea514a1130b65bd)) +* tar: Simplify bzip patterns. ([9c80d8b](https://www.github.com/scop/bash-completion/commit/9c80d8b5217df396efa44e0eccf94616bf585013)) +* tar: Recognize taz and tb2 as compressed tarballs. ([e8daf2d](https://www.github.com/scop/bash-completion/commit/e8daf2d2790b90b2abebd63b7a5534f1ea7e446a)) +* ncftp: Add option completion. ([2eeffee](https://www.github.com/scop/bash-completion/commit/2eeffeea7a5c067f4dc0c7645f664cd6232264f0)) +* Avoid sourcing dirs in completion loader to avoid fd leaks (RedHat: #903540). ([fea1c17](https://www.github.com/scop/bash-completion/commit/fea1c178b47cf7ac95ab27c39a98e0464e19976c)) +* Brown paper bag fix for the previous commit. ([c4cc3eb](https://www.github.com/scop/bash-completion/commit/c4cc3eb63bf120cf81e25cb97780fd3e4a91ebff)) +* modprobe: Don't suggest installing already installed modules. ([d08b9f2](https://www.github.com/scop/bash-completion/commit/d08b9f233559b3dced20050ba312b08fe0de53b4)) +* ngrep: New completion. ([8c57295](https://www.github.com/scop/bash-completion/commit/8c572951330bb0ed3a669fd2d8e4dd219430ff11)) +* tshark: New completion. ([cee32c6](https://www.github.com/scop/bash-completion/commit/cee32c6424113a2149daa2830ecb3fa942781420)) +* _mac_addresses: Fix with net-tools' ifconfig that outputs ether, not HWaddr. ([f6df76e](https://www.github.com/scop/bash-completion/commit/f6df76e8cac6ae47b93c87d594d70dab211b860a)) +* _mac_addresses: Try ARP cache with "ip neigh" if arp is not available. ([87dede9](https://www.github.com/scop/bash-completion/commit/87dede96c0fe8961081310284bfe58972dd801c4)) +* wol: Try "ip addr" before ifconfig for finding out broadcast addresses. ([19ce232](https://www.github.com/scop/bash-completion/commit/19ce23282ca6c00b482ac8044b64d91dbb3b62e6)) +* _mac_addresses: Try local interfaces with "ip link" if ifconfig is N/A. ([b78ef32](https://www.github.com/scop/bash-completion/commit/b78ef321bedfdf8071627366de74451967846f98)) +* _ip_addresses: Try with "ip addr" if ifconfig is not available. ([aa516ac](https://www.github.com/scop/bash-completion/commit/aa516acdc537b14541cb16424d51af6403321705)) +* _available_interfaces: Without -a, try with "ip link" if ifconfig is N/A. ([3064e9d](https://www.github.com/scop/bash-completion/commit/3064e9d707404e5aa59bb8b643d02208fb0f9daa)) +* dnsspoof,filesnarf,macof,sshow,tcpkill,tcpnice,urlsnarf: Fix -i completion. ([7543e0b](https://www.github.com/scop/bash-completion/commit/7543e0baf812e24066b863b5d13fdb1efffc3428)) +* arpspoof,dsniff,ether-wake,nmap: Offer active interfaces only. ([9d15e25](https://www.github.com/scop/bash-completion/commit/9d15e25a9e527e2d310ba0e0501e26350998532a)) +* modinfo: Use ,, for lowercasing instead of tr in a subshell. ([06002d0](https://www.github.com/scop/bash-completion/commit/06002d04c7cbfe9ac7c92508b6dcb7323627d07a)) +* pydoc: New completion. ([5c8a002](https://www.github.com/scop/bash-completion/commit/5c8a002008bd2dfdb9196b57c368193a6e05b1e2)) +* pyflakes: New completion. ([a77d3d5](https://www.github.com/scop/bash-completion/commit/a77d3d550564198c11e2b4823a53979868262a48)) +* python, pydoc: Add module completion. ([0e8d34e](https://www.github.com/scop/bash-completion/commit/0e8d34e6bda72787b6b9833e042d3f55d73a4288)) +* pydoc: Complete on keywords and topics. ([44f1065](https://www.github.com/scop/bash-completion/commit/44f1065ada14dda97d3c0417b120207d460e0be0)) +* pylint: New completion. ([f1100ef](https://www.github.com/scop/bash-completion/commit/f1100ef25a69a9910882c5692926cab22c173496)) +* xrandr: Don't leak $i when completing --mode. ([d66fc76](https://www.github.com/scop/bash-completion/commit/d66fc76be6058098d98e07e049db92079268dc0f)) +* xrandr: Cleanups. ([a3d4266](https://www.github.com/scop/bash-completion/commit/a3d4266cab93e2dacf4fc058344f10a0e0860313)) +* xrandr: Avoid --mode completion error when --output is not given. ([225b395](https://www.github.com/scop/bash-completion/commit/225b395b494d8c4f2167429cc58256e5898d1d14)) +* xrandr --mode: Clean up one awk call. ([1e6a791](https://www.github.com/scop/bash-completion/commit/1e6a79196cc4942d24ff78d7955e4c295786e883)) +* xrandr: Use _parse_help. ([ae42c96](https://www.github.com/scop/bash-completion/commit/ae42c9675838fc92a7b77f71c0a4988c8e724822)) +* xrandr: Add bunch of option arg non-completions. ([ba50a54](https://www.github.com/scop/bash-completion/commit/ba50a546418d88cfc45653cb1e91b43764eb9a3b)) +* vipw: Add -R/--root arg completion. ([23a049a](https://www.github.com/scop/bash-completion/commit/23a049a801a6ce2c86e343710cc0245e003df0cb)) +* host: Complete with known hosts. ([eb0be65](https://www.github.com/scop/bash-completion/commit/eb0be65d630e348d8e644fb70d8e2a86b00e3bdc)) +* groupmems: Add -R/--root arg completion. ([250d5eb](https://www.github.com/scop/bash-completion/commit/250d5eb93256bec97be3f5a01a1344939928b978)) +* acpi,chpasswd,dmesg,gkrellm,groupmems,hwclock,lastlog,pwd,vipw: Complete options even without "-" given. ([452e938](https://www.github.com/scop/bash-completion/commit/452e938766c784ce6750f8a718cb90a84b2e9d7d)) +* ip: Remove some stale TODOs. ([06fd510](https://www.github.com/scop/bash-completion/commit/06fd510c44c17db856678e0d572c14b0cebb2e00)) +* ip: Improve addr show and link show completions. ([61fe8d1](https://www.github.com/scop/bash-completion/commit/61fe8d10a8e15285e2ad152017403e8bb609614b)) +* _available_interfaces: Try with "ip link" if ifconfig is N/A also with -a. ([eef7941](https://www.github.com/scop/bash-completion/commit/eef7941842f309491d52a9fef457a8fbb6a4e6a2)) +* make: Don't leak $mode. ([2758c4f](https://www.github.com/scop/bash-completion/commit/2758c4fd7eacafdfd27772e46ccd00731d36931d)) +* (testsuite) Fix pwd unit test. ([23406dc](https://www.github.com/scop/bash-completion/commit/23406dcf20f4718775e8556766be7d55a879a4be)) +* make: Make work in POSIX mode. ([c0818b0](https://www.github.com/scop/bash-completion/commit/c0818b005ab8056bd4bb0a1894bfcd7de148238e)) +* (testsuite) Make pydoc test more likely to work with our limited expect buffer size. ([0837ad0](https://www.github.com/scop/bash-completion/commit/0837ad07d93c62e2b6b9cb917239183d9fbda95a)) +* cpio: Cleanups. ([e1a0759](https://www.github.com/scop/bash-completion/commit/e1a075971d37ed563ad22cc5a1df548a677d67da)) +* cpio: Recognize pass thru when -p is bundled w/other options (RedHat: #912113). ([eb396b5](https://www.github.com/scop/bash-completion/commit/eb396b58a709201e61daf2e381abecb411863b2a)) +* vpnc: Use _parse_help instead of hardcoding options, add basic test case. ([e479610](https://www.github.com/scop/bash-completion/commit/e4796104bc81247bceb591164b227b3cd762c46f)) +* vpnc: Add bunch of option arg (non)completions. ([e7cd7ba](https://www.github.com/scop/bash-completion/commit/e7cd7ba7df96a5a2bc74693fdede77ca06349af0)) +* genisoimage: Use _parse_help instead of hardcoding options, add basic test case. ([e424ed3](https://www.github.com/scop/bash-completion/commit/e424ed3e52f90884377cb2384498b2f907aff1e9)) +* : Line continuation, whitespace, and compgen -W ... -- "$cur" quoting cleanups. ([6185297](https://www.github.com/scop/bash-completion/commit/6185297fc90e82c2788a8f3ea0fd42d54267c499)) +* file-roller: New completion. ([7a1aad7](https://www.github.com/scop/bash-completion/commit/7a1aad780e9f64ad213caed8aa71f45e12294e63)) +* strings: New completion. ([ad8d1f1](https://www.github.com/scop/bash-completion/commit/ad8d1f1a8f879e696956ce0bd7733ef5f3365a6b)) +* ss: New completion. ([12ae7eb](https://www.github.com/scop/bash-completion/commit/12ae7eb21451710492a8bc450e07f6c3bd79a4ec)) +* hexdump: New completion. ([552a2f2](https://www.github.com/scop/bash-completion/commit/552a2f2a94cf03ef6ee8d53ba8bad1dbb52af640)) +* xxd: New completion. ([e38e68f](https://www.github.com/scop/bash-completion/commit/e38e68f96cd7d9d1c973462368003e12661305f9)) +* hexdump: Actually install for hd as well. ([73d1f0f](https://www.github.com/scop/bash-completion/commit/73d1f0f16482b3261291454f37bd9e663fbafaa8)) +* udevadm: Deprecate ours, one is shipped in systemd >= 196 (RedHat: #919246). ([48158ee](https://www.github.com/scop/bash-completion/commit/48158ee3e454fe4f6baf30bc59884962aaf3ce8e)) +* Fix __ltrim_colon_completions() fail on parameter (\$1) containing a glob. ([e191799](https://www.github.com/scop/bash-completion/commit/e191799dea5b38272dba7e5efe60b3adf86311e5)) +* interdiff: New completion. ([796fbbd](https://www.github.com/scop/bash-completion/commit/796fbbdc86e10df67f4930597ce56f9fab5f9457)) +* koji: Complete on build targets when --target is given to wait-repo. ([2f2f127](https://www.github.com/scop/bash-completion/commit/2f2f1278c7ae535d1c3763370e22e7f4083a50e7)) +* lua: New completion. ([99153fb](https://www.github.com/scop/bash-completion/commit/99153fb1ef75b9beec2d85966883bf3e99d095ad)) +* luac: New completion. ([29f5a4a](https://www.github.com/scop/bash-completion/commit/29f5a4a5f4403f246e22fb8c2133e8696d2f0e41)) +* pkg-config: Try to complete --variable= if package name is already given. ([408cb08](https://www.github.com/scop/bash-completion/commit/408cb08051cf18404f89e3fb89c4924cc3fa04ea)) +* tar: Fix completing files inside *.tlz when J is explicitly given. ([d02d940](https://www.github.com/scop/bash-completion/commit/d02d94080d950768bfeb8c830a678da55549f824)) +* tar: Support *.tar.lz (Debian: #703599). ([beaba62](https://www.github.com/scop/bash-completion/commit/beaba62b346bc588d1f9466f338f64073ad2716f)) +* patch: New full featured completion. ([7afc973](https://www.github.com/scop/bash-completion/commit/7afc97366f0a931cb98bd151c5971d4c4c926e59)) +* unzip/zipinfo: Associate with more StarOffice extensions. ([f0a3147](https://www.github.com/scop/bash-completion/commit/f0a3147179ea06bdcd463e2d160df97255656e95)) +* jar: Reuse unzip's xspec (RedHat: #928253). ([3cb64ac](https://www.github.com/scop/bash-completion/commit/3cb64accaf281f6315baa7bced2c72e1eff9d12f)) +* cppcheck: Complete --include= with filenames. ([1a3967c](https://www.github.com/scop/bash-completion/commit/1a3967c8d4d8d9027040e00ecf0756dafaeb88ec)) +* Fix helper script to create changelogs ([4d096e0](https://www.github.com/scop/bash-completion/commit/4d096e0b873478c7b01c5019038c646b7184da60)) +* Releasing 2.1 ([3085c7e](https://www.github.com/scop/bash-completion/commit/3085c7e12179817a02a611016606391295c69942)) + +## 2.0 (2012-06-17) + +* sudo: Handle options (Alioth: #311414). ([91a61af](https://www.github.com/scop/bash-completion/commit/91a61afe59eeca58736e55745ae76ad6641a6a12)) +* sudo: Fix option list parsing ([6621f37](https://www.github.com/scop/bash-completion/commit/6621f37c5dc2cf59ba2c34ee038f5699418e643e)) +* sudoedit: New completion. ([d0a1495](https://www.github.com/scop/bash-completion/commit/d0a14954ab45cb79aba9bff44d5ba910eac7925d)) +* ssh-add: New completion. ([28f15fd](https://www.github.com/scop/bash-completion/commit/28f15fd05c28ee84e79ee2d5f17b5867e682efef)) +* pwd: New completion. ([6943138](https://www.github.com/scop/bash-completion/commit/694313874a8ef025c5bbbf2a57de058fb684e9b9)) +* _command_offset: Properly quote arguments of eval (Alioth: #313499). ([2e97527](https://www.github.com/scop/bash-completion/commit/2e975278c59de9ab6caa5ace65de4b49c6678e65)) +* Fix completion loading when a symlink is sourced, thanks to Jonathan Nieder ([318759c](https://www.github.com/scop/bash-completion/commit/318759c8497cfce3704bc1b97c41459a5be08f7b)) +* Revert "Fix completion loading when a symlink is sourced, thanks to Jonathan Nieder" ([2ad325d](https://www.github.com/scop/bash-completion/commit/2ad325d4afc4ef96aedc7b91c8e75502647c260d)) +* mount.linux: Add some new mount options intoduced in Linux 3.0-3.2 ([1cb1e31](https://www.github.com/scop/bash-completion/commit/1cb1e31e182b0503ea82f9f74c9b43fe91799844)) +* _modules: Ignore error messages. ([db53fc7](https://www.github.com/scop/bash-completion/commit/db53fc77a5349088b24830b490b16dfcc6bee540)) +* modprobe, modinfo, insmod: Move modprobe and modinfo completions to their own files. ([f67818e](https://www.github.com/scop/bash-completion/commit/f67818e023f9afbeef8698fdd3c08eb0f90ad468)) +* sbopkg: Use _parse_help. ([32e8f33](https://www.github.com/scop/bash-completion/commit/32e8f3301801c9ff86f9620ca135f83f71590e29)) +* sbopkg, slackpkg, slapt-{get,src}: Use shorter form of the check if file exists. ([3388314](https://www.github.com/scop/bash-completion/commit/33883145af5e3290105e2f784f84c7468617d5ee)) +* rmmod: Add option completions. ([47c49db](https://www.github.com/scop/bash-completion/commit/47c49dbfec80c43695e4c95c4cc1e5781c685d93)) +* testsuite/generate: Generate less linefeeds. ([068e422](https://www.github.com/scop/bash-completion/commit/068e422222dd862c33137b0d88eab7fe08d9e71e)) +* insmod: Install for insmod.static too. ([d02b4e1](https://www.github.com/scop/bash-completion/commit/d02b4e15e3d130d426bcee1a7b03cc72f6144c90)) +* mplayer: Add -monitoraspect arg completion. ([a90d7d8](https://www.github.com/scop/bash-completion/commit/a90d7d861a53fa7aee6be505678cd43fb578cafc)) +* mplayer: Add generic handling of options that take arguments. ([45c0886](https://www.github.com/scop/bash-completion/commit/45c0886accafd08272fa17c5daad85a1ee52cd56)) +* Workaround bash bug that fails to complete <, > ([6f3d650](https://www.github.com/scop/bash-completion/commit/6f3d650e2309feff4f3e80717409ebccb2d38362)) +* testsuite: Fix spurious modinfo and modprobe test failures on systems that have /lib and /lib64 dirs. ([d7a6fb1](https://www.github.com/scop/bash-completion/commit/d7a6fb1f47d5daafb555f09fb5d9bd544ae99ec6)) +* _filedir: Properly quote paths to avoid unexpected expansion. ([98f90eb](https://www.github.com/scop/bash-completion/commit/98f90ebdf8b7ccf49e7854640712af1ff4a47871)) +* Properly declare 'symlinks' dependencies ([ec7fe00](https://www.github.com/scop/bash-completion/commit/ec7fe0006632f2c008414bb3e8c84fa4862c962f)) +* pigz: Add -p/--processes arg completion. ([cff897e](https://www.github.com/scop/bash-completion/commit/cff897eda8886c93b5b8c0e939588af36983a5f4)) +* apt-get: add 'changelog' to completed commands ([ae98bfa](https://www.github.com/scop/bash-completion/commit/ae98bfa721ff9ff4cd9c64075d2eb7fe01d76828)) +* Really complete 'changelog' ([071ba93](https://www.github.com/scop/bash-completion/commit/071ba93a0b9b5db37dc7c5b4b2423507d8f6b741)) +* su: Add linux-specific completion ([d2aedc8](https://www.github.com/scop/bash-completion/commit/d2aedc83e143e7d506c8c5340dac4a820cc50076)) +* testsuite: Add basic su test case. ([f41d7e2](https://www.github.com/scop/bash-completion/commit/f41d7e2ff660fdf9a95490d4fb438eefa565e9d1)) +* su: Fix long option handling. ([e4fe946](https://www.github.com/scop/bash-completion/commit/e4fe946621d824fe04f5c8a8f4f774342b53df40)) +* su: Add --session-command arg completion. ([e7c4035](https://www.github.com/scop/bash-completion/commit/e7c4035089548efdf9a15fb96a289585b8b322d1)) +* su: Complete -s/--shell with shells instead of all files. ([91528b5](https://www.github.com/scop/bash-completion/commit/91528b527145bec711b4b3ea8c65335a6ed617b0)) +* vmstat: New completion. ([bed5694](https://www.github.com/scop/bash-completion/commit/bed56941110985446aed52302f437c50b8182524)) +* lyx: Remove simple completion, upstream has more complete one (Debian: #662203) ([a062777](https://www.github.com/scop/bash-completion/commit/a062777d4b9c7dc8a51d1e87c938b48fed810232)) +* insmod, modprobe: Don't hardcode path to modinfo (Alioth: #313569) ([199a63b](https://www.github.com/scop/bash-completion/commit/199a63bd4db2020c8d6aaad6723cf881c023c0ff)) +* man: --path option is supported on Darwin (Alioth: #313584) ([fb2d657](https://www.github.com/scop/bash-completion/commit/fb2d657fac6be93a1c4ffa76018d8042859e0a03)) +* man: Move variable declaration to the right place. ([39ac464](https://www.github.com/scop/bash-completion/commit/39ac4642bff9cd9813b8d4b2758b17fe945584cc)) +* testsuite/generate: Tweak linefeeds. ([1fc97c4](https://www.github.com/scop/bash-completion/commit/1fc97c47baf7453b6a27f5e0104c9d434e59acc1)) +* acpi: New completion. ([0ab693c](https://www.github.com/scop/bash-completion/commit/0ab693ca50206e46f23fccba52eeb8516e2e6fc9)) +* hwclock: New completion. ([3d7102b](https://www.github.com/scop/bash-completion/commit/3d7102b9a5b138091122bad601cc3c104df0ce8f)) +* feh: Update option argument completions. ([d2a3db0](https://www.github.com/scop/bash-completion/commit/d2a3db0b7a0cfc7e0da037a003873c19b8fc22a2)) +* fbi, feh: Complete more supported file formats. ([63574c8](https://www.github.com/scop/bash-completion/commit/63574c8f14fb813bea08e59e43a170ff0f4cf592)) +* fbgs: Add new options introduced in fbida-2.09. ([4710d1b](https://www.github.com/scop/bash-completion/commit/4710d1bf48f9fde1becfcc902aa1c91312a58a91)) +* cppcheck: Complete new --relative-paths option arguments ([587d268](https://www.github.com/scop/bash-completion/commit/587d26834ac7116afedfdad86f6cc7a931fbf57d)) +* ri: Rename ri_get_methods helper to add leading underscore ([8b3f19a](https://www.github.com/scop/bash-completion/commit/8b3f19a82e60c725f8588a91b1679dde4b1b1967)) +* _expand: Suppress unwanted bash error messages (Alioth: #313497) ([ccda61d](https://www.github.com/scop/bash-completion/commit/ccda61d928505abfa839a2c048e3b3d7f89d3a9e)) +* make: Add generic variable completion. ([f7240b8](https://www.github.com/scop/bash-completion/commit/f7240b82a4d45f03b741f11b771fae17d3c1c713)) +* man: Recognize 3gl as man page filename extension -- at least Mesa uses it. ([739c6d2](https://www.github.com/scop/bash-completion/commit/739c6d2833370e618fcdc37b5a72c15426313fae)) +* _realcommand: Try greadlink before readlink (Alioth: #313659). ([32f2239](https://www.github.com/scop/bash-completion/commit/32f223963a013e4875c999109c0a2fa8f9a0ecdf)) +* Comment spelling fix. ([f990d5e](https://www.github.com/scop/bash-completion/commit/f990d5e617954c57e73209dba8a8061f87d538a4)) +* Spelling fix. ([7532eda](https://www.github.com/scop/bash-completion/commit/7532eda90ff631611e003e9b51dca8a0e558e95c)) +* qiv: Add *.svg. ([e0dc594](https://www.github.com/scop/bash-completion/commit/e0dc594d2aabc5040ce0cf53bb73e14f60218025)) +* xmllint: Add *.svgz. ([b54aded](https://www.github.com/scop/bash-completion/commit/b54adedd4f158ac41ecd6a8c6cc7d8faf51dc069)) +* add xz compression extension for kernel modules ([67d30da](https://www.github.com/scop/bash-completion/commit/67d30da6b79cf7983058a1840bce215990094246)) +* autotools: Use MKDIR_P instead of mkdir_p (Alioth: #313671). ([f8ac6a5](https://www.github.com/scop/bash-completion/commit/f8ac6a5aeb287763341e4db2dacd1eb2c3cdecf6)) +* lbzip2: Add -n argument completion. ([d141f9c](https://www.github.com/scop/bash-completion/commit/d141f9c6ebd8659638de9d5de64e202ac1f450c0)) +* _tilde*: Escape tilde in [[ $1 == \~* ]] tests (RedHat: #817902). ([709d6e0](https://www.github.com/scop/bash-completion/commit/709d6e06902df7205280d0626995fc5b6abe6e89)) +* scp: Recognise symlinks to directories as directories (Debian: #666055). ([89acac9](https://www.github.com/scop/bash-completion/commit/89acac9910a27cc9428314e66c3bdbfc48c65f41)) diff --git a/CHANGES b/CHANGES deleted file mode 100644 index 8a45281c4a5..00000000000 --- a/CHANGES +++ /dev/null @@ -1,2137 +0,0 @@ -bash-completion (2.8) - - [ Andrea Dari ] - * dpkg: Add -V/--verify arg completion - - [ Ben Wiederhake ] - * Add support for .lz4 extension to file-roller (#158) - - [ Eric A. Zarko ] - * unzip, zipinfo: Associate *.gar (#165) - - [ Gabriel F. T. Gomes ] - * openssl: Add completion for the genpkey, pkey, pkeyparam, and - pkeyutl commands - - [ Gonzalo Tornaría ] - * test: run bash with --norc to avoid system bashrc - - [ Gábor Bernát ] - * tox: New completion (#163) - - [ Halt ] - * mplayer: Disable user config when parsing options - - [ Henry-Joseph Audéoud ] - * ebtables: new completion (#150) - - [ Jakub Jelen ] - * ssh,ssh-add,ssh-keygen: Complete pkcs11 options with *.so - - [ Kevin Pulo ] - * mkdir: Complete on files in addition to dirs - - [ Luca Capello ] - * dpkg-query: Fix -W/--show completion - - [ Mark Friedenbach ] - * Add support for .lzo extension (--lzop) to tar (#155) - - [ Martin d'Anjou ] - * java: Complete *.war - - [ Mateusz Piotrowski ] - * kldunload: Increase robustness of compgen filters (#185) - * kldunload: Show modules with digits - - [ Michał Górny ] - * lftp: Support ~/.local/... bookmark location (#144) - * test suite: Support overriding default match buffer size (#141) - - [ Pawel ] - * man: Don't use $MANPATH directly (#161) - - [ Uwe Storbeck ] - * dpkg: Complete --vextract on deb files - * dpkg: Fix man page section in comment - - [ Ville Skyttä ] - * make-changelog.py: Use python3 - * test: Fix getting username in non-login shells - * test/unit: Whitespace tweaks - * info, man, rsync: Defer _expand invocation - * _expand: Reuse __expand_tilde_by_ref and _tilde logic, clean up - * test: Add some _expand unit tests - * bzip2, gzip, and other compressors: Use _tilde instead of _expand - * test: Add assert_complete_homedir, use in dpkg and ls - * dd, find, gcc: Remove unnecessary tilde expansion - * dd: Omit space only when offering one completion ending with = - * __expand_tilde_by_ref: Eval tilde expansion only, simplify - * Bump copyright years to -2018 - * mkdir: Complete files without appending space - * __load_completion: Load "xspec" completions dynamically too - * __load_completion: Code cleanup - * _avaiable_interfaces: Get rid of eval - * make: Pass script to sed as parameter instead of using process - substitution - * ccze: New completion - * *: Comma separated opt arg completion improvements - * test suite: Some more mplayer and mencoder coverage - * tox: Complete comma separated -e arguments - * xdg-mime,xdg-settings: Fix inclusion in tarball - * geoiplookup: New completion - * ping*,ssh,scp,sftp,tracepath6: Filter IPv4/IPv6 literal addresses - * _known_hosts_real: Add option to filter IPv4 and IPv6 addresses - * radvdump: New completion - * lsscsi: New completion - * python: Support completing dotted module hierarchies - * test/docker: Tweak work dir, add bash as default cmd - * test: Try to skip postconf variable test on broken postfix configs - altogether - * Revert "travis: Don't build local docker images, use vskytta/bash- - completion ones" - * test: Add "postconf -" test case - * test: Work around broken centos/fedora postfix config in non-IPv6 - setup - * travis: Don't build local docker images, use vskytta/bash- - completion ones - * pycodestyle: New completion - * flake8: Various option arg completion improvements - * perltidy: New completion - * lowriter,localc etc: Use corresponding oo* completions - * cryptsetup: Update option lists - * pv: New completion - * getconf: New completion - * nproc: New completion - * _known_hosts_real: Document -a better - * ssh: Add -J/ProxyJump completion - * ssh: Declare $prefix closer to use - * test: Ignore duplicates in find_unique_completion_pair list - * test: dpkg,ls,_tilde: Skip gracefully if no uniq user for - completion is found - * xdg-mime: New completion - * ssh-keygen: Add -E arg completion - * reportbug: Don't hardcode option lists, split option args at = - * reportbug: Add -A/--attach arg completion - * apt-get: Complete *.deb on install if argument contains a slash - * ri: Fix integrated ri 1.8 class completion - * test: Add files to test older ri with - * Whitespace - * test: Remove things moved to library.exp from bashrc - * test: Add some comments regarding bash init in library.exp - * xdg-settings: New completion - * tox: Remove spurious executable bits - * tox: Include ALL in -e completions - * tox: Avoid stderr spewage when -e invoked without tox.ini - * pylint: Invoke python3 to search for modules if command contains 3 - * pylint: Install for pylint-2 and pylint-3 too - * test suite: Add bunch of man and MANPATH test cases - * test suite: Make man test subject names less generic - * test suite: man cleanup - * rfkill: Rename to _rfkill to avoid conflict with util-linux >= - 2.31 - * test: Use prebuilt docker hub bash-completion images - * README.md: Whitespace cleanup - * iptables: Use invoked command instead of hardcoded "iptables" - * iptables: Avoid stderr trashing when invoked as non-root - * iptables: Parse options from --help output - * vpnc: Add some option argument (non)completions - * vpnc: Improve config completions - * test suite: Drop no longer needed fedoradev /usr/bin/which - workaround - * test suite: Skip fedoradev GPG checks at least for now - * lspci: New completion - * lsusb: New completion - * oggdec: New completion - * alias: Fix completion followed by = (#146) - * *: Protect shopt reset from non-default $IFS - * test suite: Limit amount of info and pinfo test output - * test suite: Add info and pinfo option test cases - * test suite: Add basic hid2hci and munin-node-configure test cases - * aptitude: Add keep to commands list (Debian: #867587) - * *: Protect _known_hosts_real from user input treated as options - * curl: Fix -x etc option argument hostname completion - * groupdel: Parse and handle long options - * aptitude-curses: Use aptitude completion - * test suite: Install aptitude in ubuntu14 container - * test suite: Enable wine in ubuntu14 - * xm: Don't leak args and commands environment variables - * uscan: Don't leak cword and words environment variables - * test suite: Add bunch of missing basic test cases - * ktutil: Don't leak i and command environment variables - * test suite: Limit amount of output from process name completion - * test suite: Limit number of screen -T completion matches - - [ j^ ] - * xine etc, ogg123, mplayer -audiofile: Associate with *.oga - - -- Ville Skyttä Sat, 17 Mar 2018 10:30:07 +0200 - -bash-completion (2.7) - - [ Eli Young ] - * Makefile: update default compatdir (#132) - - [ Ville Skyttä ] - * Make user completion file configurable, disable in tests - * test suite: Generalize xspec completion install check - * pyflakes: Remove redundant xspec completion - * test suite: Fix __expand_tilde_by_ref test expectation output - * pdfunite: New *.pdf completion - - -- Ville Skyttä Sat, 01 Jul 2017 14:08:43 +0300 - -bash-completion (2.6) - - [ Björn Kautler ] - * Add missing sidedoor to .gitignore (#114) - - [ Ville Skyttä ] - * test suite: Mark expected centos6 CI _filedir failures as such - * Expose version in BASH_COMPLETION_VERSINFO, use it in profile.d - script - * test suite: Skip an expected make test case failure in centos6 CI - * test suite: Fix ifdown and ifup CI test skipping - * test suite: Ignore env var pulled in by use of scp in tests - * test suite: If colon trim doesn't do anything, trim as usual - * tar: Comment spelling fixes - * test suite: Mark dpkg -L test case untested if no packages - installed - * test suite: Cosmetic tweaks - * dpkg: Fix dpkg -i home dir completion - * test suite: Improve ls home dir test descriptions - * python: Split module completion to separate helper - * micropython: New completion, aliased from python - * test suite: Add Python module completion test case - * python: Fix traceback avoidance on module completion error - * openssl: Parse available digests from dgst -h - * openssl: Add sha2 commands - * gm: New completion, commands only for now - * (test suite): Test screen -T completions - * (test suite): Set TERM to dumb, not dummy - * Revert "(test suite): Fix alias and cd cursor position tests" - * mplayer: Remove duplicate *.m4a and *.m4v associations - * mplayer, xine, etc: Associate *.mp4a and *.mp4v - * xine etc: Fix *.m4a association - * bind: Add option and argument (non-)completions - * _user_at_host: Set nospace only when completing username part - * _user_at_host: Append @ suffix to username part completions - * man: Don't check OSTYPE or GNU userland, just enable on all - systems - * (test suite): Set dcop result to untested if dcop server is not - running - * (test suite): Don't insist on loading all completions dynamically - * _configured_interfaces: Parse from /etc/network/interfaces.d/* on - Debian - * py.test: New completion - * oowriter: Associate with *.pdf - * Don't define BASH_COMPLETION_COMPAT_DIR - * ri: Add option and arg completions - * (test suite): Add our own dummy ri test fixture - * (test suite): Info test needs docs, don't exclude from CentOS - * (test suite): Fix CentOS 6 tcllib setup - * (test suite): Simplify renice test, fix with only one completion - * (test suite): Don't assume configured interfaces in CI setups - * Don't offer * as configured interface when there are none - * (test suite): Add basic CentOS 6 container for bash 4.1 coverage - * (test suite): Ignore runtime loaded env function changes - * (test suite): Add mailman bin dir to PATH for arch test - * arch: Parse options from --help - * (test suite): Load tested completions dynamically - * (test suite): Accept non-whitespace single word in - assert_complete_any - * (test suite): Avoid interference from user and system dirs (#87) - * (test suite): Install some things N/A in ubuntu14 to fedoradev - * (test suite): Add unrar to ubuntu14 container - * (test suite): Fix alias and cd cursor position tests - * (test suite): Add basic alpine test case - * alpine: Parse opts from -h output, add some opt arg completions - * (test suite): Install jshint globally in ubuntu14 - * (test suite): Add mailman bin dir to PATH for some mailman tools - * (test suite): Install jshint to ubuntu14 container with npm - * unshunt: Parse options from --help - * (test suite): Test lsof on ubuntu14 - * (test suite): Add basic hping3 test case - * (test suite): Add our ./configure to PATH to test it, test opts - * (test suite): Add bunch of packages to ubuntu14 container - * (test suite): Ensure /usr/(local/)games is in $PATH - * (test suite): Fix perl -d* test cases with no Devel::* installed - * (test suite): curl has lots of options, add more test prefix - * (test suite): Fix tar test case for ones having --owner-map - * (test suite): Unsupport various kill, renice cases if ps is N/A - * (test suite): Make chkconfig test behave better in container - * (test suite): Don't assume mounted filesystems in quota* tests - * newlist: Parse options from --help, add some arg non-completions - * (test suite): Delete trailing whitespace - * (test suite): Don't assume lists set up in newlist test cases - * (docker): Pull in missing fedoradev xvfb-run which dependency - * mr: Avoid stderr trash and test suite failure if man is N/A - * (test suite): Fix mmsitepass completion test - * tshark -G: Avoid stderr noise when running as superuser - * (docker): Run completion tests with xvfb-run, e.g. for gkrellm - * ssh-keygen: Make option parsing work with OpenSSH < 7 - * synclient, udevadm: Avoid use of posix char classes for awk - * test suite: Add WIP Fedora dev config - * Travis: Switch tests to docker, update to Ubuntu 14 - * xv: Associate with *.j2c, *.j2k, *.jp2, *.jpf, and *.jpg2 (Debian: - #859774) - * eog: Associate with *.j2c and *.jpg2 - * Bump copyright years - * xine etc: Associate uppercase *.WM[AV] - * mplayer: Associate *.weba (#112) - * xine etc: Associate *.webm and *.weba (#112) - - -- Ville Skyttä Tue, 27 Jun 2017 12:29:33 +0300 - -bash-completion (2.5) - - [ BartDeWaal ] - * Support for python gui source files (#91) - - [ Ben Webber ] - * mr: New completion - - [ Christian Kujau ] - * ssh-keygen: support ed25519 keys (#79) - - [ Dara Adib ] - * Add sidedoor to _ssh() completion (#106) - - [ George Kola ] - * .ipa is just a zip file and we should let unzip handle it (#71) - - [ Miroslav Šustek ] - * ant: parse targets in imported buildfiles (#84) - - [ Reuben Thomas ] - * Add more tests for ccache - * ccache: fix completing compiler's flags - - [ Ville Skyttä ] - * test suite: Add java/javac non-completion fixture - * javac: Complete -cp like -classpath - * travis: Skip bluez and nis for now due to post-install script - issues - * test/config/*: Delete trailing whitespace - * (test suite): Avoid loading user's ~/.bash_completion, fixes #87 - * ip: Recognize a as alias for address and l for link - * ip: Recognize address in addition to addr - * mr: Disable "clean" test case, command N/A before mr 1.20141023 - * ssh-keygen: Parse switches with _parse_usage, not _parse_help - * mplayer: Associate with *.mjpg, *.mjpeg (Debian: #837779) - * dd: Sync completions with coreutils 8.24 - * travis: Add mr - * perl: Remove full path to cat in PERLDOC_PAGER call - * deja-dup: New completion - * CONTRIBUTING: Reorder sections - * *: Move indentation settings to .editorconfig - * make: Declare _make_target_extract_script like other functions - * Travis: zopfli is AWOL? - * *: Whitespace fixes - - [ Zearin ] - * Minor edits to README.md (mostly formatting) (#110) - - [ l3nticular ] - * Fix bug in 'make' completion when using BSD sed (#108) - - [ osu ] - * Add support for Include in ssh config (#70) (#80) - - -- Ville Skyttä Sat, 04 Feb 2017 18:07:27 +0200 - -bash-completion (2.4) - - [ Arash Esbati ] - * xetex, xelatex, luatex, lualatex: Associate with tex files - - [ Gene Pavlovsky ] - * Use shell globbing instead of ls to source files in compat dir - - [ Grisha Levit ] - * Support completing array variables and expansions - * Add tests for declare/typeset - * Better handling of typeset/declare - - [ Kylie McClain ] - * tar: silence --version's stderr output - - [ Paul M. Lambert ] - * Support pod document files for perldoc (#39) - - [ Richard Alpe ] - * tipc: fix missing last char in link name completion - * tipc: handle complete words without trailing space - * tipc: suppress tipc error messages - * tipc: use double brackets in if conditions - * tipc: make loop variables local - * tipc: remove unnecessary return values - * tipc: readd call to complete command - * tipc: use cur variable for flag completion - * tipc: add command prefix to link sed - * tipc: remove unnecessary function _tipc_get_val() - * tipc: use bash here string instead of echo - * tipc: merge functions into main - * tipc: add test framework - * tipc: add tipc completions - - [ Ville Skyttä ] - * Release 2.4 - * rpm: Offer --filetriggers with -q - * javadoc: Add bunch of option arg (non)completions - * lrzip: Add -m arg noncompletion - * pkg-get: Don't use hyphens in function names - * jarsigner: Add some option arg (non)completions - * pkg-get,pkgrm: Drop unnecessary _have calls - * *: Trivial cleanups - * *: Remove redundant return 0's - * pypy*: Add basic --jit arg completion - * pypy3: Alias to python - * hcitool,svcadm,tar: Spelling fixes - * Travis: Install more packages for more test coverage - * (test suite): Pass assert_complete_any for exact/only given arg - completed - * tipc: Invoke ls with "command" - * tipc: Indentation fix - * (test suite): Fix fallout from - fec077d555f112b9f455c45860f90a3b47392fcf - * (test suite): Remove Bash::Completion.3pm.gz from git, create on - the fly - * (test suite): Remove test/fixtures/_filedir/a"b from git, create - on the fly - * CONTRIBUTING: Note patch preferences if not using GitHub pull - requests - * python: Support -Q and -W arg completion without space - * apache2ctl, aspell, make: Don't hardcode completion generator - command - * mysql: Avoid --default-character-set error with failglob, fixes - #46 - * test suite: Add perldoc module+pod completion test case - * perl: Remove some duplicated code - * pushd: Use _cd completion for CDPATH support, closes #38 - * test suite: Add basic pushd test case - * abook: Parse long options from command including full path - * pyvenv: New completion - * chroot: New (generic long options) completion, see #38 - * Travis: First steps toward testing with OS X - * test suite: Add bashcomp_bash env var for better control on tested - bash - * aptitude: List packages using _apt_cache_packages, fixes #33 - * vncviewer: Cleanup shopt use, drop an eval - * make: Avoid a grep - * rpm: Fix --whatenhances arg completion - * aspell, minicom, mysql: Replace use of ls with printf - * cppcheck: Complete filenames too for --platform - * man: Prioritize MANPATH, simplify, add fallback e.g. for busybox, - fixes #28 - * aclocal: Install completion for 1.14 and 1.15, fixes #25 - * mpv: Don't install symlink for it, fixes #24 - * test suite: Add function and declare test cases - * CONTRIBUTING: Highlight request for test cases - - [ Wayne Scott ] - * The BitKeeper completion used the wrong set of commands - - -- Ville Skyttä Fri, 12 Aug 2016 22:43:27 +0300 - -bash-completion (2.3) - - [ Daniel Milde ] - * Completion for python zip archives - - [ Liuhua Wang ] - * lvm: pvcreate should be able to use all block devcices - * lvm: fix all commands that should get all PVs - - [ Ville Skyttä ] - * Release 2.3 - * make-changelog: Don't output "Merge pull request" entries - * make: Use <<< instead of printf + pipe - * gnokii: Use <<< instead of echo + pipe - * *: Use [:blank:] instead of $'\t ' tricks where appropriate, fixes - #19 - * test suite: Fix abook test case - * test suite: Don't insist on property completions if synclient -l - fails - * test suite: Tolerate "See 'man feh'" feh --help output - * test suite: Fix tar failure caused by previous tar change - * tar: Detect GNU/other from --version only once per session - * tar: Remove unused variable - * tar: Fix GNU tar help output parsing regex, fixes #15 - * test suite: Add tar xvf filename test case - * tar: Don't write to /tmp/jetel - * python: Simplify code - * python: Complete all files also after -m - * python: Don't offer options after -c - * python: Complete all files only if -c is before current word - * test suite: Add some python test cases - * unzip, zipinfo: Complete on *.pyz - * travis: configure and run completions syntax check - * make check: Test syntax of all completion files - * CONTRIBUTING.md: Ask for test cases - - -- Ville Skyttä Mon, 28 Mar 2016 18:32:47 +0300 - -bash-completion (2.2) - - [ Barry Warsaw ] - * _init_completion: Handle cword < 0 (LP: #1289597) - - [ Damien Nadé ] - * (testsuite) Use 'set' command posix behaviour when saving env - (Alioth: #314720) - * Added test/site.{bak,exp} to .gitignore - * _parse_help: Fix failglob failures (Alioth: #314707) - * _lvm: using a single-pattern case and invoking function according - to words[1] - * lvm: _lvm_count_args parameter must be quoted in order to failglob - not to complain - * gendiff: Quoting suffix pattern to avoid triggering failglob - - [ Dams Nadé ] - * ssh-add, ssh-keygen: -? needs to be quoted under failglob (Alioth: - #314709) - * Quote unset array element to avoid globbing interference (Alioth: - #314708) - - [ David Paleino ] - * Refactor bts and uscan, since they use common functions - * uscan: New completion, thanks to Federico Ceratto - * bts: New completion, thanks to Federico Ceratto. - - [ Guillaume Rousse ] - * complete on freerdp-specific known hosts list - * nmcli completion was integrated upstream - - [ Igor Murzov ] - * isql: Fix failglob failure - * ssh-add, ssh-keygen: -? needs to be quoted under failglob (take 2) - (Alioth: #314709) - * (testsuite): move testing of _linux_fstab() to umount.exp - * umount: Fix mount points escaping/unescaping with Bash-4.3 - * slapt-src: Handle --config=FILE option properly - * sbopkg, slapt-{get,src}: expand tilde in config file name - * slapt-{get,src}: Fix issue with sed not being able to handle some - characters - * slapt-src: split options from their arguments - * Quote _filedir arguments when appropriate to prevent failglob - failures - * psql: Tell psql to not load .psqlrc as it may change output format - (Alioth: #314636) - * testsuite: Add basic tests for portsnap and freebsd-update - * mplayer: -dvd-devices takes dvd devices, dirs and .iso files as - argument - * 7z: Improve completion - * f77, f95: Use the same completion as for g77, g95 if they are - links to gfortran - * aptitude: safe-upgrade accepts package name as parameters (Alioth: - #313638, Debian: 673235) - * _longopt: Run commands in C locale. - * make: Use only posix basic regexps with sed (Alioth: #314345) - * cppcheck: Add new --enable option argument and --library argument - completion - * dpkg: Suppress unwanted error messages (Debian: #706502) - * perl: -d/-dt option argument is optional (Alioth: #314242) - * Add config for cmake to bash-completion. - * kcov: Add new sort types, complete --replace-src-path arguments - * feh: Add new sort type - - [ Mathieu Parent ] - * Puppet: describe: update options list, accordind to 'puppet help - describe' - * Puppet: cert: update options list, accordind to 'puppet help cert' - * Puppet: apply: update options list, accordind to 'puppet help - apply' - * Puppet: agent: update options list, accordind to 'puppet help - agent' - * Puppet: puppet parser support - * Puppet: puppet -* doesn't imply 'puppet apply' - * Puppet: use puppet terminology - - [ Matthew Gamble ] - * Modify all usages of 'sed' to be run with command bash builtin - * Use command built-in to run sed to avoid any custom aliases - - [ Matthieu Crapet ] - * man: Use -w instead of --path - - [ Michael Gold ] - * profile.d: Avoid some warnings from shells in "nounset" mode - (Debian: #776160) - - [ Miroslav Lichvar ] - * chronyc: Update help text parsing - * chronyc: Add missing subcommands - * chronyc: Add -6 option - - [ Nevo Hed ] - * minicom: Recognize user ~/.minirc.* as config files - - [ Ondrej Oprala ] - * __get_cword: avoid $index < 0 (Alioth: #315107) - - [ Patrick Monnerat ] - * rpmbuild: Complete *.spec on --clean (RedHat: #1132959) - - [ Pavel Raiskup ] - * tar: rework the completion completely - - [ Peter Cordes ] - * upstart support for service completion - - [ Peter Dave Hello ] - * freebsd-update: New completion. - * portsnap: New completion. - - [ Peter Wu ] - * modprobe: fix params with multi-line descriptions - * gdb: support --args style completion (Alioth: #314664) - - [ Rainer Müller ] - * make: Fix basic regex for portability (Alioth: #314345) - - [ Raphaël Droz ] - * gnokii: New completion - - [ Rune Schjellerup Philosof (Olberd) ] - * dpkg: Add support in dpkg completion for .ddeb (LP: #568404) - - [ Shaun McCance ] - * xmllint, xmlwf, xsltproc: Complete on Mallard *.page files - - [ Stefano Rivera ] - * pypy: New completion identical to python (Alioth: #314501) - - [ Thilo Six ] - * Use more straightforward way to check bash version - * _mac_addresses: Use explicit C locale for ifconfig (Debian: - #704832). - - [ Tristan Wibberley ] - * make: Don't pick up variables when makefile is reloaded - * make: Offer hidden targets when it is clear that the user is - trying to complete one of them - * make: Fix detection of intermediate targets where make has changed - its database whitespace - * make: Add __BASH_MAKE_COMPLETION__ variable - * make: completion shouldn't be confused by the output of $(info - confuse: make) - - [ Uwe Kleine-König ] - * Don't complete hostnames found after Hostname in ~/.ssh/config - - [ Ville Skyttä ] - * Release 2.2 - * README.md: Note autoreconf need only in unprepared tarball - * make-changelog.py: Set myself in footer - * make-changelog.py: Fix footer line output - * make-changelog.py: flake8 fixes - * make-changelog.py: Make work with Python 3 - * README.md: More markdown tweaks - * README.md: Markdown tweaks - * zopflipng: New completion - * README.md: Not need for autoreconf, fixes #11 - * README: Expand troubleshooting section somewhat - * Merge pull request #9 from shaunix/master - * ssh: Extract duplicate code to _ssh_configfile - * Remove various comments related to bash versions we don't support - * travis: Install more packages for [xyz]* test coverage - * travis: Install more packages for [stuvw]* test coverage - * travis: Install more packages for [qr]* test coverage - * travis: Install more packages for [op]* test coverage - * travis: Install more packages for m* test coverage - * travis: Install more packages for [jkl]* test coverage - * Merge pull request #7 from ukleinek/master - * indent: Remove generic long option completion - * Update copyright year - * travis: Install more packages for [hi]* test coverage - * travis: Install more packages for [fg]* test coverage - * mysql: Fix --default-character-set completion with mariadb - * mysql, puppet: sed portability fixes - * gnokii, minicom: Use grep through "command" - * lint: Check for sed without "command" - * Merge pull request #2 from djmattyg007/avoid_sed_alias - * travis: Install more packages for [de]* test coverage - * travis: Install more packages for c* test coverage - * travis: Add note about (currently) N/A packages - * test suite: Mark unsupported look test case as such, not - unresolved - * test suite: Use unsupported instead of xfail for modinfo/modprobe - cases - * travis: Install more packages for [0-9][ab]* test coverage - * travis: Run tests with --all to get some more useful output - * test suite: Fix ssh partial hostname completion test - * README: Split contributing to separate CONTRIBUTING doc - * README: Convert to markdown - * Drop references to bash-completion-devel@lists.alioth.debian.org - * build system: Switch to xz compressed tarball - * aclocal, automake: Install for versioned 1.14 and 1.15 executables - * Update URLs and various instructions to GitHub - * README: Update POSIX spec link - * travis: Avoid Travis default ri, use distro one instead - * test suite: Make apt-get test less sensitive to available commands - * test suite: Output tool log on failure in CI - * Set up Travis - * test suite: Expect failure in modinfo/modprobe if there are no - modules - * test suite: Fix ssh-copy-id test on old setups with no identities - * cppcheck: Add native to --platform completions - * ssh: Avoid completing commands before hostname - * chronyc: Parse command args from help output - * chronyc: Wrap long lines - * Load completions also from $XDG_DATA_DIRS (RedHat: #1264094) - * (testsuite) Ignore files generated by complete-ant-cmd.pl - * scp, sftp: Complete -S on commands - * scp, sftp: Fix querying ssh options - * sftp: Add -l arg non-completion - * ssh-copy-id: Offer only *.pub to -i - * mpv: Remove mplayer-aliased completion - * __load_completion: New function, use in _completion_loader and - _xfunc - * modplug*: Associate *.oct and *.okt - * rpm: Add --whatenhances/recommends/suggests/supplements and - --recommends/supplements completions - * pgrep, pidof, pkill, pwdx, vmstat: Add support for procps-ng - * pdftotext: New completion - * checksec: New completion - * ssh: Complete HostbasedKeyTypes,HostKeyAlgorithms,KexAlgorithms - values - * ssh: Query ciphers and macs from ssh before hardcoded fallback - * ssh: Add -Q argument completion - * sysctl: Return early on --help, --version - * sysctl: Try parsing options from help before usage - * Document how to avoid command_not_found_handler interference - * eog: Complete on *.ppm (RedHat: #1090481) - * tar: Plug $line var leak - * tar: Style tweaks - * (testsuite) Add required "empty" dir for tar - * bsdtar, tar: Remove symlinks from git, have make create them - * jshint: New completion - * gnokii: Include and install it - * gnokii: Fix completions of options that are prefixes for others - * gnokii: Drop dead code - * (testsuite): Add basic gnokii test case - * gnokii: Various minor and cosmetic fixes - * _filedir: Avoid some unnecessary work with -d - * _filedir: Remove unused variable - * _filedir: Fix overquoted argument to compgen -d (RedHat: #1171396) - * 2015 - * Load user completions from $BASH_COMPLETION_USER_DIR/completions - * Revert "README: Don't hardcode /etc in cmake fallback dir" - * README: Don't hardcode /etc in cmake fallback dir - * README: Add cmake usage example - * README: Add autotools and cmake tips - * Drop reference to no longer used sysconf_DATA - * synclient: New completion - * tune2fs: Add missing return in -M arg completion - * reptyr: Rename file to _reptyr to avoid conflict with upstreamed - completion - * cppcheck: Option argument (non-)completion update - * dropuser: New completion - * createuser: New completion - * createdb, dropdb: Drop -o default, it does not appear to do - anything good here - * tshark: Simplify cut usage - * mcrypt: Simplify -m arg completion - * (testsuite): Add mcrypt -a and -m argument completion tests - * strings: Fix -T/--target arg completion with non-English locale - * chrome, firefox etc: Complete on *.pdf - * ccache: Add -o/--set-config arg name completion - * gphoto2: Replace tail with awk - * *: Invoke command to be completed, not its basename - * gphoto2: Fix split argument handing, and colon treatment in --port - args - * _completion_loader: Protect compgen from -* leakage (Debian: - #769399) - * Actually install the lz4 completion - * _pnames: Add -s for producing (possibly) truncated names (RedHat: - #744406) - * (testsuite) Add cd in dir without subdirs or CDPATH test case - * Protect various compgen invocations from -* leakage (Debian: - #766163) - * pigz, unpigz: Handle *.zz - * _completion_loader: Set empty command to _EmptycmD_ for cross - version compat - * Comment update - * rpmbuild: Complete *.spec on --nobuild - * mplayer, *xine: Complete on *.mts (Debian: #759219) - * ant: Support buildfile set in $ANT_ARGS (Alioth: #314735) - * (testsuite) Add ant -f test case - * ant: Don't offer more completions after options that exit - * 7z, adb: Trivial cleanups - * python(3): Add -X argument non-completion - * xsltproc. TODO fix for previous commit - * xmllint, xmlwf, xsltproc: Complete on *.dbk and *.docbook (Alioth: - #314770) - * xz: Complete -T/--threads argument - * (testsuite) Save shell variables when saving env (Alioth: #314720) - * adb: New completion - * modprobe: Try parsing help before using hardcoding option list - * (testsuite) Add vgcreate test case for _lvm_count_args with - failglob on - * _filedir_xspec: Fix with failglob on - * Various mostly array element unsetting fixes under failglob - * __reassemble_comp_words_by_ref: Make work with failglob on - (Alioth: #312741) - * _services: README in sysv init dir is not a service - * mpv: New completion alias + adjustments for mplayer (Debian: - #749115) - * (testsuite) Add puppet subcommand option test case - * puppet: Recognize some short options - * puppet: Parse most subcommand options from "help subcommand" - output - * puppet: Exit early on -h|-V|--version in addition to --help - * hostname: New completion - * nslookup: complete on hosts (Alioth: #314673) - * eog: Complete on *.pgm (RedHat: #1090481) - * pngfix: New completion - * qemu: Fix -balloon arg completion - * qemu: Apply completion to qemu-kvm/-system-i386/-system-x86_64 too - * xrandr: Use the invoked command internally, not hardcoded "xrandr" - * xrandr: Add (some) --setprovider* arg completion support - * profile.d: Don't return from a sourced script (Debian: #741657) - * FAQ: Clarify that we mean the bash man page for M-/ - * (testsuite) Avoid complete-ant-cmd.pl errors with our build.xml - * ri: Fix class completion with ri >= 3. - * ri: Fix colon handling in class completion. - * flake8: New completion - * pyflakes: New completion - * cal,chfn,chsh,dmesg,eject,hexdump,look,newgrp,renice,runuser,su,wr - ite: Deprecate on Linux in favor of util-linux ones (Debian: - #737672) - * testsuite: Add basic newgrp test case - * testsuite: Add basic test cases for deprecated completions - * _*: Install our deprecated completions too, try loading them - secondarily - * hwclock,ionice,rtcwake: Deprecate in favor of util-linux ones - (Debian: #737672) - * ssh-keygen: New completion - * Bump copyright years to 2014. - * jpegoptim: New completion - * ip: Add some addr, addrlabel, and route arg completions - * aptitude, dpkg: Replace some grep+cuts with awk - * gcc, lintian, make, pkgadd, slackpkg: grep -> "command grep" - (Debian: #734095) - * lintian: Replace some grep+cuts with awk - * (testsuite) Check for grep and ls invoked without "command", see - README - * lz4: New completion. - * optipng: New completion. - * cppcheck: Include - in --file-list completions. - * (testsuite): Limit wtf completions to A* to keep expect happier. - * wtf: Look for acronym db from /usr/share/games/bsdgames/acronyms - too. - * wtf: Don't offer -f if it was already specified. - * wtf: Hush stderr when db file doesn't exist. - * appdata-validate: New completion. - * timeout: New completion. - * _known_hosts_real: Exclude %h HostName entries (RedHat: #1015935). - * cc, c++: Check path to binary when finding out if it's gcc - (Alioth: #314417). - * cc, c++: Install minimal completion for non-gcc ones (Alioth: - #314417). - * abook, kldunload: Pre-expand \t instead of relying on sed - supporting it. - * dict: Trivial regex cleanup. - * _known_hosts_real: Pre-expand \t instead of relying on sed - supporting it (Alioth: #314393). - * zopfli: New completion. - * bzip2, gzip, lzma: Cleanups. - * Cosmetics. - * export, _variables: Do TZ= completion (Redhat: #994646). - * 2to3: New completion. - * file-roller: Reuse unzip's xspec. - * 7z: New completion. - * hcitool, rfcomm, ciptool, hciconfig: Don't leak $args. - * perl: Fix -dt: completion. - * perl*: Fix handling of relative paths in @INC. - * wget: Add --accept-regex/--reject-regex/--regex-type arg - (non)completions. - * wget: Drop incorrect -nv arg completion. - * wget: Stop completing after --help/--version. - * Clean up/compact various globs. - * cvs: Fix checkout -j non-completion. - * sh: Complete script arguments with all filenames (Alioth: - #314226). - * nmcli: Deprecate our completion, upstream has one in 0.9.8.0. - * Revert "nmcli completion was integrated upstream" - * Use == instead of =. - * cvs rm: Don't filter existing files with -f (RedHat: #949479). - * aclocal, automake: Install for *-1.10, *-1.12, and *-1.13 too. - - -- Ville Skyttä Thu, 03 Mar 2016 17:22:50 +0200 - -bash-completion (2.1) - - [ AllKind ] - * Fix __ltrim_colon_completions() fail on parameter (\$1) containing - a glob. - - [ Andreas Müller ] - * completions/Makefile.am: symlinks depends on $(DATA) to avoid race - conditions - - [ Christian von Roques ] - * Fix __reassemble_comp_words_by_ref for $COMP_CWORD == ${#COMP_WORDS[@]} - - [ David Paleino ] - * Fix helper script to create changelogs - - [ Guillaume Rousse ] - * New completions: nmcli, gphoto2 - * Improved completions: - - dsniff: add -p option completion - - dsniff: fix interface completion - - - [ Igor Murzov ] - * _command_offset: Restore compopts properly (Alioth: #313890) - * _parse_help, _parse_usage: Run commands in C locale. - * New completions: wget, zathura - * Improved completions: - - cppcheck: Add new standards to --std option. - - evince: Evince supports opening .pdf.xz files (Alioth: #313739). - - feh: Add new options introduced in feh-2.7. - - feh: Fix list of background styles. - - fusermount: Complete curlftpfs-mounts for "fusermount -u" (Debian: - #685377) - - kcov: Add new sort types (introduced in kcov-9). - - kcov: Complete arguments of --limits option. - - lvm: Fix typo in option name: s/continguous/contiguous/. - - make: Do not append space if target is a filepath. - - mount: Fix parsing /etc/fstab on *BSD. - - mount.linux: Add some new mount options intoduced in Linux 3.5 and 3.7 - - mount.linux: Add options completion for nfs and davfs. - - mount.linux: Clean up mount options, remove duplicates. - - mplayer: Add opus to the list of supported formats. - - mplayer: Add -subcp argument completion. - - opera: Handle options. - - slackpkg, slapt-get: Update the list of package sets. - - tar: Fix detection if the $prev is a tar file. - - valgrind: Add --soname-synonyms option arguments completion. - * Testsuite: - - _filedir: Remove the cruft from the a\$b->h unit test (Alioth: #313480) - - [ Jeroen Hoek ] - * Improved completions: - - unzip: Add support for OpenDocument formats. - - [ Ken Sharp ] - * Improved completions: - - wine: add .msi completion - - [ Martin Ueding ] - * Stylistic cleanup - - [ Tristan Wibberley ] - * Improved completions: - - make: incremental completion for make with compact display - - make: convert make completion to use smarter parser - - [ Ville Skyttä ] - * Avoid sourcing dirs in completion loader to avoid fd leaks (RedHat: #903540) - * Ignore colormake symlink. - * Line continuation, whitespace, and compgen -W ... -- "$cur" - quoting cleanups. - * _available_interfaces: Try with "ip link" if ifconfig is not available. - * _ip_addresses: Try with "ip addr" if ifconfig is not available. - * _known_hosts_real: Filter ruptime stdout error spewage (Alioth: #313893). - * _mac_addresses: Try local interfaces with "ip link" if ifconfig not - available. - * _mac_addresses: Try ARP cache with "ip neigh" if arp is not available. - * _mac_addresses: Fix with net-tools' ifconfig that outputs ether, not HWaddr. - * New completions: chronyc, eject, eog, file-roller, hexdump, interdiff, lua, - luac, luseradd, luserdel, lusermod, mussh, nc, ngrep, patch, pydoc, - pyflakes, pylint, ss, strings, tshark, wsimport, xxd - * Improved completions: - - acpi, chpasswd, dmesg, gkrellm, groupmems, hwclock, lastlog, pwd, vipw: - Complete options even without "-" given. - - arpspoof, dsniff, ether-wake, nmap: Offer active interfaces only. - - clzip, pdlzip, plzip: New lzip alias completions. - - colormake: New make alias completion (LP: #743208, Debian: #682557) - - cpio: Recognize pass thru when -p is bundled w/other options - (RedHat: #912113). - - cppcheck: Add --language/-x argument completion. - - cppcheck: Complete --include= with filenames. - - dnsspoof, filesnarf, macof, sshow, tcpkill, tcpnice, urlsnarf: Fix -i - completion. - - genisoimage: Use _parse_help instead of hardcoding options, add basic test - case. - - groupmems: Add -R/--root arg completion. - - hexdump: Actually install for hd as well. - - host: Complete with known hosts. - - ip: Improve addr show and link show completions. - - ip: Remove some stale TODOs. - - jar: Reuse unzip's xspec (RedHat: #928253). - - koji: Complete on build targets when --target is given to wait-repo. - - lv{create,resize,extend}, vg{create,reduce,extend,split}: Fix variable - leaks. - - lvm: Add _lvm prefix to helper functions. - - lvm: Take option args into account when counting args (RedHat: #860510). - - lvm volumes: Complete on /dev/mapper/* (RedHat: #851787). - - lzip: Do not append space after equal sign in long options. - - make: Convert internal variable names to lowercase, indentation fix. - - make: Don't leak $mode. - - make: Make work in POSIX mode. - - man: Add support for .lz man pages (RedHat: #839310). - - man: Don't expand man page extensions too early. - - man: Fix -P/--pager full path arg completion. - - modinfo: Use ,, for lowercasing instead of tr in a subshell. - - modprobe: Don't suggest installing already installed modules. - - ncftp: Add option completion. - - pkg-config: Try to complete --variable= if package name is already given. - - pydoc: Complete on keywords and topics. - - python, pydoc: Add module completion. - - scp: Treat strings with slash before colon or starting with [.~] as local. - - ssh: Add some -o and related arg completions. - - ssh: Add -O argument completion (Debian: #680652). - - tar: Don't take -I to mean bzip2. - - tar: Fix completing files inside *.tlz when J is explicitly given. - - tar: Simplify bzip patterns. - - tar: Support *.tar.lz (Debian: #703599). - - tar: Recognize taz and tb2 as compressed tarballs. - - tcpdump: Fix -z full path arg completion. - - unzip/zipinfo: Associate with more StarOffice extensions. - - useradd, userdel, usermod: Add -R/--root arg completion. - - useradd, usermod: Support comma separated -G/--groups arg completion. - - useradd: Fix -k, -K, and --home-dir argument completions. - - userdel: Add -h/--help non-completion. - - valgrind: Fix full path arg completion. - - vgcreate: Add missing symlink. - - vipw: Add -R/--root arg completion. - - vpnc: Add bunch of option arg (non)completions. - - vpnc: Use _parse_help instead of hardcoding options, add basic test case. - - wget: Use == instead of =. - - wine: Fix extension glob to work on its own. - - wol: Try "ip addr" before ifconfig for finding out broadcast addresses. - - xrandr: Add bunch of option arg non-completions. - - xrandr: Use _parse_help. - - xrandr --mode: Clean up one awk call. - - xrandr: Avoid --mode completion error when --output is not given. - - xrandr: Don't leak $i when completing --mode. - * Deprecated completions: - - udevadm: one is shipped in systemd >= 196 (RedHat: #919246). - * Testsuite: - - Make pydoc test more likely to work with our limited expect buffer size. - - Fix pwd unit test - - [ Yann Rouillard ] - * New completions: pkgutil, pkgrm, pkgadd, pkg-get, svcadm. - - [ wonder.mice ] - * Fixed tilde expanding in _filedir_xspec - - -- David Paleino Fri, 05 Apr 2013 12:05:15 +0200 - -bash-completion (2.0) - - [ Anthony Ramine ] - * Properly declare 'symlinks' dependencies - - [ David Paleino ] - * apt-get: add 'changelog' to completed commands - - [ Guillaume Rousse ] - * Add xz compression extension for kernel modules - - [ Igor Murzov ] - * sudo: Handle options (Alioth: #311414). - * sudoedit: New completion. - * _command_offset: Properly quote arguments of eval (Alioth: - #313499). - * mount.linux: Add some new mount options intoduced in Linux 3.0-3.2 - * _modules: Ignore error messages. - * modprobe, modinfo, insmod: Move modprobe and modinfo completions - to their own files. - * sbopkg: Use _parse_help. - * sbopkg, slackpkg, slapt-{get,src}: Use shorter form of the check - if file exists. - * _filedir: Properly quote paths to avoid unexpected expansion. - * su: Add linux-specific completion - * insmod, modprobe: Don't hardcode path to modinfo (Alioth: #313569) - * man: --path option is supported on Darwin (Alioth: #313584) - * man: Move variable declaration to the right place. - * feh: Update option argument completions. - * fbi, feh: Complete more supported file formats. - * fbgs: Add new options introduced in fbida-2.09. - * cppcheck: Complete new --relative-paths option arguments - * _expand: Suppress unwanted bash error messages (Alioth: #313497) - - [ Itaï BEN YAACOV ] - * scp: Recognise symlinks to directories as directories (Debian: - #666055). - - [ Jonathan Nieder ] - * ri: Rename ri_get_methods helper to add leading underscore - - [ Ville Skyttä ] - * rmmod: Add option completions. - * testsuite/generate: Generate less linefeeds. - * insmod: Install for insmod.static too. - * mplayer: Add -monitoraspect arg completion. - * mplayer: Add generic handling of options that take arguments. - * testsuite: Fix spurious modinfo and modprobe test failures on - systems that have /lib and /lib64 dirs. - * pigz: Add -p/--processes arg completion. - * testsuite: Add basic su test case. - * su: Fix long option handling. - * su: Add --session-command arg completion. - * su: Complete -s/--shell with shells instead of all files. - * lyx: Remove simple completion, upstream has more complete one - (Debian: #662203) - * testsuite/generate: Tweak linefeeds. - * make: Add generic variable completion. - * man: Recognize 3gl as man page filename extension -- at least Mesa - uses it. - * _realcommand: Try greadlink before readlink (Alioth: #313659). - * Comment spelling fix. - * qiv: Add *.svg. - * xmllint: Add *.svgz. - * autotools: Use MKDIR_P instead of mkdir_p (Alioth: #313671). - * lbzip2: Add -n argument completion. - * *_tilde*: Escape tilde in [[ $1 == \~* ]] tests (RedHat: #817902). - * New completions: - - acpi, hwclock, pwd, ssh-add, vmstat - - [ Sung Pae ] - * Workaround bash bug that fails to complete <, > - - -- David Paleino Sun, 17 Jun 2012 20:01:36 +0200 - -bash-completion (1.99) - - * Hopefully the last 2.0 preview. - - [ David Paleino ] - * Correctly list purgeable packages for dpkg --listfiles and dpkg - --purge (Debian: #647684) - * Fix bash_completion paths in README (Debian: #647941) - - [ Florian Hubold ] - * xv: Add *.eps and *.ps to filename completions (Alioth: #313477) - - [ Igor Murzov ] - * Add and use _sysvdirs() function that sets correct SysV init - directory. - * cppcheck: Add new options introduced in cppcheck-1.52. - * cppcheck: Several ids separated by commas can be given for - --enable=. - * _known_hosts_real: Add some quotes (Alioth #313158) - * Merge completions/service into the bash_completion script. - * _modules: Follow symlinks in /lib/modules/$(uname -r) (Alioth: - #313461) - * mount, umount: Add linux-specific completions. - * mount: Don't suggest short options. - * pidof: Don't check OS type (Alioth #311403) - * removepkg: Make it possible to complete filenames. - * umount: Fix for completion of relative paths. - * upgradepkg: Support oldpackage%newpackage notation. - * wine: Complete all files after an .exe (Alioth #313131) - * New completions: - - htop, nethogs. - - [ Jan Kratochvil ] - * rpm: Treat -r as --root (RedHat: #759224). - - [ Raphaël Droz ] - * Added a word about compopt -o nospace in styleguide.txt. - * _ip_addresses: Make it locale agnostic. - - [ Ville Skyttä ] - * cc, c++: Install gcc completion if compiler looks like GCC - (Alioth: #311408). - * cppcheck: Offer header filename completions too. - * curl: Add bunch of new option argument completions. - * dequote: Use printf instead of echo (Alioth: #312163). - * dict: Speed up word completion with common use cases and large - word lists. - * dmesg: Adapt to versions returning long options. - * Document $split && return. - * _filedir, _tilde: Ignore compopt stderr for direct invocations in - unit tests. - * Include doc/ in dist tarball. - * _known_hosts_real: Handle more than two hostnames per known hosts - line (Debian: #647352). - * _known_hosts_real: Include hosts reported by ruptime (Alioth: - #313308). - * _known_hosts_real: Support > 1 files per *KnownHostsFile line - (Debian: #650514). - * lintian: Use <<< instead of echo and a pipe (Alioth: #312163). - * lrzip: -T no longer takes an argument since version 0.570. - * _mac_addresses: Grab addresses from FreeBSD's ifconfig -a output - too. - * make: Add -j/--jobs completion, complete up to number of CPUs * 2. - * _muttconffiles: Use printf instead of echo (Alioth: #312163). - * _parse_help, _parse_usage: If first arg is "-", read from stdin. - * rpm: Add --delsign completion, don't suggest --resign (identical - to --addsign). - * _variables: New function split from _init_completion. - * vi and friends: Fix /etc/ld.so.conf.d/* completion (Alioth: - #312409). - * New completions: - - plague-client, desktop-file-validate, valgrind, ccache, iperf, - koji, lzip, udevadm. - - -- David Paleino Sat, 07 Jan 2012 23:52:36 +0100 - -bash-completion (1.90) - - * bash-completion 2 preview: dynamic loading of completions. - - [ David Paleino ] - * If _filedir 'ext' returns nothing, just fallback to generic file - completion. It is optional, and off by default. Patch by Clint Byrum - (Debian: #619014, LP: #533985) - * Fix __get_cword_at_cursor_by_ref: check for $index when completing with a - cword+1 argument already present (Debian: #622383) - * Layout change: everything is now in /usr/share/bash-completion/, rather - than in /etc/. - * Get rid of BASH_COMPLETION_DIR, BASH_COMPLETION_HELPERS_DIR, BASH_COMPLETION - * Fix autotools to use pkgdatadir instead of redefining datadir, get rid of - helpersdir. - * Implemented a blacklist for unwanted third-parties completions - * New completions: - - epdfview, lpr and lpq (Raphaël Droz), mysql (Raphaël Droz) - * Improved completions: - - ant: handle "extension-point" the same as "target" tag (Petr Kozelka, - Alioth: #313105) - - apt: add 'download' to subcommands (Debian: #625234, Ubuntu: #720541) - - aptitude: add 'versions' command (Debian: #604393) - - dpkg-query: use the 'dpkg' completion (Debian: #642526) - - lintian: remove --unpack-level (Debian: #623680) - - {shadow,coreutils}: fix broken _allowed_groups usage - - rrdtool: complete filenames after commands (Debian: #577933) - - sitecopy: fixed a bug with grep and brackets: use sitecopy -v to fetch - sites (Raphaël Droz). - - [ Freddy Vulto ] - * Improve __reassemble_comp_words_by_ref() (Alioth #313057) - * Testsuite: - - add -unsorted option to _get_hosts() - - [ Guillaume Rousse ] - * Use $() for subshell, instead of backquotes - * Use simple quotes for constant strings - * Drop -o filenames, as suggested by Ville - * New completions: puppet - - [ Igor Murzov ] - * Abort completion file loading earlier if required commands are not - available. - * docs: Improve tester's manual - * Make completions that use _command also work with file names - * _command_offset: Restore compopts used by called command. - * New completions: - - pkgtool, makepkg, rmp2tgz, slapt-get, slapt-src, slackpkg, kcov, feh, - xgamma, fbi, fbgs - * Improved completions: - - file: ddd few missing --exclude arguments completions - - host, nslookup: Remove completions for bind utils from bash_completion. - - {install,upgrade,explode}pkg: use -o plusdirs instead of -o dirnames - - makepkg: should complete filenames - - removepkg, upgradepkg, installpkg: add option completion - - xrandr: Add more option completions. - - overall clean up of different slackware-specific completions - * Testsuite: - - add basic tests for pkgtools, rpm2tgz, slapt, sbopkg, slackpkg - - fix broken tests for finger and xhost - - remove unused -expect-cmd-full option from assert_complete* - - [ Sergey V ] - * New completions: sbopkg - - [ Ville Skyttä ] - * Load completions in separate files dynamically, get rid of have() - * Drop unnecessary $USERLAND checks - * Try /usr/sbin before /sbin in have() - * Try both full path and basename completions for sudo etc (Alioth: #313065) - * Add _init_completion() for common completion initialization and generic - redirection handling - * Replace actual sysconfdir in bash_completion on install (Alioth: #313081) - * Drop support for bash < 4.1 - * Drop no longer needed _compopt_o_filenames() - * Drop no longer needed "type compopt" checks - * docs: Update "simply sourcing" instructions to match new layout, check - $PS1. - * Get rid of bash_completion self-parsing from _filedir_xspec - (RedHat: #479936). - * Provide profile.d hook for per user disabling of bash_completion - (Debian: #593835) - * New completions: - - a2x, arping, asciidoc, base64, cal, chrpath, cppcheck, curl, dmesg, - dot, file, gnome-mplayer, gprof, hddtemp, host, htpasswd, idn, ionice, - jps, lbunzip2, lbzip2, lbzcat, prelink, protoc, pwdx, pwgen, reptyr, - sum (RedHat: #717341), watch - - phing: reuse ant completion (Elan Ruusamäe, Alioth: #312910) - - pinfo: reuse info completion - * Improved completions: - - bluez, e2fsprogs, grpck, java (Mattias Ulbrich), passwd, pwck, route, - rsync, smartctl - - ant: improve -lib, -find/-s, and -D argument completions; rewrite build - target parsing in plain bash, add build file test case - - aspell: add --add-filter|--rem-filter completions; get --mode completions - from 'aspell modes' output - - bzip2, gzip, python, sysbench: quote command argument to _parse_help() - - chsh: use _allowed_users instead of plain compgen -u - - cksfv: add -g argument completion - - cpan2dist: don't hang if no package list files exist - - crontab: use /sys/fs/selinux and /selinux instead of /etc/selinux to - find out if SELinux is around - - cvs: (diff) parse options from cvs diff instead of plain diff; drop -o - default to fix CVS root completions; (commit) complete on entries - instead of default if COMP_CVS_REMOTE is not set; improve CVS - controlled file completions; add CVS controlled file completions for - admin and update; list "primary" command names first in mode switch; - recognize some additional commands and synonyms; add editors/watchers - completion; sort mode completions alphabetically - - freeciv: complete freeciv-* in addition to civclient/civserver - - gdb: improve filename completion - - gendiff: do file completion after output redirection - - getent: add gshadow to known databases; allow multiple completions from - same db, add option completion - - info: add option completion support - - ipsec (Tobias Brunner): drop uname check, add strongSwan specific - completion with fallback, complete connection names for 'up', 'down' and - other commands - - jar: complete on *.sar (JBoss service archive) - - java, javac: add -X* completions - - javadoc: implement -linkoffline two argument completion - - killall: activate completion on Darwin (Alioth: #312350) - - (la)tex (Ted Pavlic): add *.dbj to filename completions (RedHat: #678122) - - man: add option parsing and completion - - modplug*: add more extensions for files supported by libmodplug - - mutt: support tildes when recursively sourcing muttrc files - (Debian: #615134); expand tilde in mutt query command (Alioth: #312759) - - ntpdate: add some option argument (non)completions - - oo{writer,impress,calc,draw} (Matej Cepl): complete on LibreOffice - FlatXML extensions (RedHat: #692548) - - perldoc (Scott Bronson): override MANPAGER when generating perldoc - completions (RedHat: #689180); don't parse man page when we know it'll - produce no completions; use perldoc itself instead of man - - pgrep: add option and option argument completions - - rpm: make rpm --queryformat use more consistent; drop rpm query support - for rpm < 4.1 - - rpmbuild: add --buildpolicy completion - - rpmcheck: drop reference to undefined $files variable (Alioth: #313270) - - screen: add _terms() and -T completion; add commands completion - (Alioth: #312164, RedHat: #547852) - - _services: avoid bogus completions when init or xinetd dirs exist but are - empty; include systemd services - - smartctl: fix short alternative for --tolerance - - ssh, scp, sftp, ssh-copy-id: add some option argument (non)completions - - strace: don't append space for -e *= completions; don't try to extract - syscall names if they're not going to be used; rewrite arch specific - syscall extraction in plain bash - - svn*: don't suggest short options - - tar: fix completion of files inside *.tar.bz2 archives when [Ijy] is not - given; added option completions; improve tar *[cr]*f completions - (Debian: #618734) - - unzip: complete on *.sar (JBoss service archive) - - xmllint, xmlwf: complete on *.tld (tag library descriptor) - - xmlwf: add -v non-completion - - xmms: add some option argument completions - - xz: apply xz completion to pxz too; non-complete - --memlimit{,-compress,-decompress} - * Testsuite: - - add basic tests for gendiff, mdadm, puppet, xzdec, mii-diag, mii-tool, - grpck, passwd, pwck, samba, rdesktop, fusermount, tcpdump, l2ping, - ssh-copy-id, postfix, qemu, ldap*, medusa, mdtool, monodevelop, - msynctool, cfagent, lpr, lpq, mysql, nslookup, compare, conjure, - import, stream - - fix tests for ri - - fix get_hosts option docs. - - add test case for Debian: #622383. - - add chown foo: and :foo test cases, should complete files - (RedHat: #710714) - - -- David Paleino Thu, 03 Nov 2011 09:53:55 +0000 - -bash-completion (1.3) - - [ Guillaume Rousse ] - * added pure-perl perldoc completion helper, using work from Aristotle - Pagaltzis (pagaltzis@gmx.de) - * added completions for xfreerdp and iscsiadm - * updated xm subcommands list - - [ David Paleino ] - * Fixed "service" completion, thanks to John Hedges (Debian: #586210) - * Complete on all files for mplayer's -dvd-device - * Fixed typo in openssl completion (Debian: #609552) - - [ Ville Skyttä ] - * Activate hping2 completion also for hping and hping3. - * Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, ether-wake, - filefrag, gendiff, growisofs, iftop, ip (Debian: #600617), javaws, kid3, - lrzip, lsof, mktemp, portecle, POSIX sh, sha{,224,256,384,512}sum, - sysbench, tune2fs, xmodmap, and xrdb completions. - * Add *.gif (Alioth: #312512), *.m2t (Alioth: #312770), *.3gpp, *.3gpp2, - *.awb, and *.iso (Alioth: #311420) to mplayer filename completions. - * Add "short" tarball extensions to unxz, unlzma etc completions. - * Improve /etc/init.d/*, ipmitool, jar, java, javadoc, man, mencoder, mkdir, - mplayer, pack200, povray, python, rpmbuild, sqlite3, tar, wodim, and - general help parsing completions. - * Fix p4 and povray completions (Alioth: #312625). - * Add *.xsd, *.xsl, *.rng, *.wsdl, and *.jnlp to xmllint and xmlwf filename - completions, and *.gz versions of all of the supported ones for xmllint. - * Recognize rpm query mode based on the --file, --group, --package, and - --all long options (RedHat: #630328). - * Improve rpm query option completions. - * Drop bad kompare filename completion (Alioth: #312708). - * Make _filedir and _filedir_xspec complete uppercase versions of their - filename extension arguments in addition to exact case matches. - * IPv6 known hosts completion fixes (Alioth: #312695, RedHat: #630658). - * Fixes to completions for filenames containing tabs (RedHat: #629518). - * Add *.iso (Alioth: #311420), *.m2t and *.m2ts (Alioth: #312770) to - xine-based player filename completions. - * Add /etc/ethers to MAC address completion sources. - * Add *.gem and *.spkg to tar filename completions. - * Complete known hosts from avahi-browse only if $COMP_KNOWN_HOSTS_WITH_AVAHI - is non-empty (Alioth: #312691, RedHat: #630326). - * Improve relevance of many user/group completions, depending on context. - * Remove most "-o filenames" options to "complete", turn "-o filenames" on - dynamically when needed instead. - * Add/improve various autotools completions. - * Add *.apk to unzip and jar filename completions. - * Do not load bash_completion in profile.d script if progcomp is not enabled. - * Ignore muttrc source entries that are not files (Alioth: #312881). - * Re-enable postgresql database and user completion (Alioth: #312914, - Ubuntu: #164772). - * Add *.fdf to various PDF viewer completions. - - [ Freddy Vulto ] - * Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095) - * Speed up `compopt' availability detection - * Fix _filedir `-o filenames' detection on bash-3 (Alioth: #312646) - * Fix __reassemble_comp_words_by_ref (Alioth #312740) - - [ Anton Khirnov ] - * Improve mplayer and mencoder completions. - - [ Paul Walmsley ] - * Add *.webm to mplayer file completions (Debian: #588079). - - [ Miklos Vajna ] - * Add *.amr to mplayer file completions (Alioth: #312634). - - [ Andrej Gelenberg ] - * Add *.part (partially downloaded) to mplayer and xine-based player - completions (Alioth: #312657). - - [ Stephen Gildea ] - * Fix false posives for non-option words in _parse_help (Alioth: #312750). - - [ Andrey G. Grozin ] - * Add *.fb2 to okular filename completions. - - -- David Paleino Sun, 06 Feb 2011 19:03:46 +0100 - -bash-completion (1.2) - - [ David Paleino ] - * Don't use pidof in _known_hosts_real() to detect whether Avahi is - available, since it's not available on MacOS X. Thanks to Rainer - Müller (bash-completion MacPorts maintainer) - * Fixed "freq" and "rate" completion for iwconfig - * contrib/munin-node fixed (Debian: #550943) - * contrib/dpkg fixed -W and --show completing on .?(u)deb's (Debian: #552109) - * contrib/aptitude: add @(add|remove)-user-tag - * Added munindoc completion to contrib/munin-node, thanks to Tom - Feiner (Debian: #553371) - * Added colordiff completion, same as diff - * contrib/cpio: added missing completions for -?, --help, --license, --usage, - --version and (-p) --to-stdout (Debian: #557436) - * Style policy: don't use fancy globbing in case labels - * Added .fdf completion to okular and evince - * Added .okular completion to okular (Debian: #545530) - * Added lintian completion - * Refreshed reportbug completion, added --from-buildd (Debian: #579471) - * Special-case "apt-get source" (Debian: #572000) - * Added lintian completion (Debian: #547361) - * contrib/dpkg: update completion to current API - * Styleguide: establish line wrapping and $() instead of `` - - [ Ville Skyttä ] - * Create bz2 dist tarball too. - * Include CHANGES in dist tarball. - * Include profile snippet in tarball, install it. - * Rename contrib/bluez-utils to contrib/bluez to follow bluez 4.x naming. - * Apply cardctl completion to pccardctl too. - * Apply pine completion to alpine too. - * Remove many unnecessary short option completions where long ones exist. - * Improve chsh, chgrp, chown, configure, curl, cvs, find, gkrellm, gzip, - iconv, lftp, look, lzma, make, man, mdadm, modprobe, mount, mplayer, - mysqladmin, perldoc, rsync, screen, service, scp, ssh, sshfs, unzip, - update-alternatives, vncviewer, wget, yp-tools, xine based players' and - general hostname completions. - * Add abook and wtf completion, based on work by Raphaël Droz. - * Add cvsps, dragon, fusermount, jarsigner, k3b, lftpget, modplug123, - pm-utils, rtcwake, pack200, unpack200, pbzip2, pbunzip2, pbzcat, pigz, - unpigz, and wol completions. - * Don't overwrite other host completions when completing from multiple - SSH known hosts files. - * Speed up installed rpm package completion on SUSE, based on work by - Marco Poletti (Alioth: #312021). - * Improve sourcing snippets from completion dirs. - * Drop support for bash < 3. The compatibility global variables $bashN, - $default, $dirnames, $filenames, $compopt, $nospace, $bashdefault, and - $plusdirs have been dropped too. 3rd party completions should switch - to using the complete/compgen features directly, and BASH_VERSINFO - for bash version checks. - * Protect various completions from unusual user input by not embedding the - input in external command arguments (Debian: #552631). - * Add /sbin to $PATH when invoking ifconfig and iwconfig. - * Combine dcop and qdbus completions into the latter. - * awk and sed usage portability fixes (Alioth: #311393, Debian: #501479). - * Fix leaking local variables from various completions. - * Turn on -o filenames in _filedir on bash >= 4. - * Deprecate modules completion, upstream modules >= 3.2.7 ships one. - * Protect grep invocations from user aliases (Alioth: #312143). - * Split sshfs completion from contrib/ssh into contrib/sshfs. - * Split mount and umount completion into contrib/mount. - * Split service completion into contrib/service. - * Split chown, chgrp, and id completions into contrib/coreutils. - * Split kill, look, and renice completions into contrib/util-linux. - * Split killall, pkill, pgrep and related completions into contrib/procps. - * Split ipsec completion into contrib/ipsec. - * Split ifup and ifdown completions into contrib/ifupdown. - * Do basic HTML file completion with Firefox and Chrome and friends, - and Epiphany. - * Do basic diff/patch completion with cdiff and kompare. - * Don't install mock completion by default, it's in upstream mock > 1.1.0. - * Do basic text editor completion with xemacs, sxemacs, kate, and kwrite. - * Do meta-command completion for aoss and padsp. - - [ Freddy Vulto ] - * Prevent root PATH expansion prolifering in _root_command (bash >= 4.1.4) - * Only complete xhost if (_)xhost is available. - * Added _get_comp_words_by_ref to replace both _get_cword & _get_pword. - Also additional variables `words' and `cword' can be returned. - * Added _upvar & _upvars helper functions to aid in passing variables - by reference. - * Make _filedir emulate `-o filenames' - * Fixed completion perl modules containing colons. - * Merged __get_cword3 & __get_cword4 to _get_cword. - * Added __expand_tilde_by_ref helper function. - * Added __ltrim_colon_completions to fix completions containing colons - * Improved mutt completion - * Added _get_pword helper function, thanks to Sung Pae (Alioth: #312030) - - [ Ted Stern ] - * Fix modules completion for "(default)" entries. - - [ Jeremie Lasalle Ratelle ] - * Fix rsync remote path completion (Alioth: #312173, Gentoo: #297818). - - [ Leonard Crestez ] - * Improve ssh -o suboption completion (Alioth: #312122). - * Fix NFS mounts completion (Alioth: #312285). - * Fix completion of usernames (Alioth: #311396, Debian: #511788). - * Fix chown test crashing on systems with no root group (Alioth: #312306). - * Fixed tests when BASH_COMPLETION or TESTDIR contain spaces. - * Fix mount handling of escapes (Alioth: #311410, Launchpad: #219971, - Debian: #511149). - * Cleanup scripts to run tests. Make runUnit and runCompletion use test/run. - Make it possible to run tests from any directory. - * Add a --debug-xtrace option to test/run using BASH_XTRACEFD from bash-4.1. - * Add a --timeout option to test/run to override the default expect timeout. - - [ Raphaël Droz ] - * Add xsltproc completion (Alioth: #311843). - - [ Adrian Friedli ] - * Add ipv6calc completion. - - [ Ildar Mulyukov ] - * Add showmount completion (Alioth: #312285). - - [ Neville Gao ] - * Fix mount completion error "bash: [: too many arguments" (Alioth #312381). - - [ Austin English ] - * Make lookup of wine file completions case insensitive. - - [ Igor Murzov ] - * Improve xz completion (Alioth: #312466). - - [ Mario Schwalbe ] - * Update find completion (Alioth: #312491, Launchpad: #570113). - - [ Mark van Rossum ] - * Add basic lyx completion. - - -- David Paleino Wed, 16 Jun 2010 17:44:59 +0200 - -bash-completion (1.1) - - [ David Paleino ] - * Permit .gz files concatenation (Debian: #514377) - * Fix svk completion using $filenames instead of $default (Debian: #524961) - * Really add build-dep to aptitude's completion (Debian: #495883) - * Fix checks for GNUish userland, thanks to Robert Millan (Debian: #529510) - * Fix typo in .ass subtitles completion for mplayer (Debian: #531337) - * Fix regression on man(1) completion: also complete on local .3pm files - (Debian: #531343) - * Split mutt completion to contrib/mutt - * Split iconv completion to contrib/iconv - * Split dict completion to contrib/dict - * Split {update,invoke}-rc.d completions to contrib/sysv-rc - * Don't install _subversion anymore, upstream completion is better than - ours. Added to EXTRA_DIST in Makefile.am - * Split autorpm completion to contrib/autorpm - * Split jar completion to contrib/jar - * Split chkconfig completion to contrib/chkconfig - * Split chsh completion to contrib/chsh - * Split apt_build completion to contrib/apt-build - * Split aptitude-related completions to contrib/aptitude - * Split apt-cache and apt-get completions to contrib/apt - * Split rpm-related completions to contrib/rpm - * Split cvs-related completions to contrib/cvs - * Split man completion to contrib/man - * Split bash builtins completions to contrib/bash-builtins - * Split dpkg-related completions to contrib/dpkg (and re-enable usage - of grep-status if available) - * Split gcc completion to contrib/gcc - * Split dselect completion to contrib/dselect - * Split cardctl completion to contrib/cardctl - * Split pineaddr completion to contrib/pine - * Added avahi-discovered hosts to _known_hosts_real() (Debian: #518561) - * Added m4v completion to mplayer (Debian: #504213) - * Improve qemu completion (Debian: #534901) - * Added sshfs completion (shares the same as scp) (Debian: #545978) - * Fixed obvious brokenness (typos) in contrib/mdadm - * Clean [1.2.3.4]:port format in known_hosts, thanks to - Xuefer (Gentoo: #284563) - * Added --no-generate to "apt-cache pkgnames" calls, make it faster - on certain configurations (Debian: #547550) - * Split okular from evince filename extension completion, needed to add - okular-specific completions: xps, epub, odt, fb, mobi, g3 and chm. - Also, okular can read any of its formats also in .gz/.bz2 compressed - format, so change the regular expression to match this. - * Remove --with-suggests and --without-suggests from aptitude completion - * Patches from PLD Linux (thanks to Elan Ruusamäe): - - avoid sed pipe as ps itself can omit the headers - - improve service(8) completion, also look for "msg_usage" - - [ Ville Skyttä ] - * Split yum completion to contrib/_yum (no longer installed by default, the - intent is to move it to yum upstream soon). - * Split yum-arch completion into contrib/yum-arch, load completion only if - yum-arch is installed. - * Update list of yum commands and options. - * Add yum repolist, --enable/disablerepo, --disableexcludes, -d, -e, --color, - and --enable/disableplugin completions. - * Add chkconfig --override and resetpriorities completions. - * Split mplayer and friends completions to contrib/mplayer. - * Parse top level mplayer and friends option completions from -list-options. - * Fix dir-only completion for make to include only dirs, not files. - * Remove unused variable RELEASE. - * Improve aspell dictionary completion: don't hardcode data-dir, get - canonical dicts from "aspell dicts". - * Always use /etc/shells for chsh -s completion, don't complete on comment - lines in it. - * Fix rpm --whatrequires/--whatprovides completions with spaces and other - unusual characters, add filename based --whatrequires completions. - * Add modplugplay filename completion. - * Add more mod-like audio file extensions for xine-based players and timidity. - * Complete on plain alternatives like update-alternatives. - * Rename installed_alternatives() to _installed_alternatives(). - * Add /etc/pki/tls/openssl.cnf to list of default openssl config files, - search for default ones only if -config is not given. - * Use POSIX compliant arguments to tail in mkisofs completion. - * Protect various completions from unusual user input by not embedding the - input in external command arguments. - * Add _split_longopt() helper for improved handling of long options that - take arguments in both "--foo bar" and "--foo=bar" formats. - * Use _split_longopt to improve and clean up aspell, bluez-utils, chgrp, - chown, chkconfig, cpio, dpkg, heimdal, iptables, mailman, make, mc, - mii-diag, mii-tool, mkinitrd, pkg-config, postgresql, quota, reportbug, - samba, smartctl, yum, and generic long option completion (Alioth: #311398). - * Add chown --from and --reference value completions. - * Add chgrp --reference value completion. - * Do not assume all --foo= options take filenames in generic long option - completion, assume only that --*file*= does, and that --*dir*= takes dirs. - * Add make --old/new-file, --assume-old/new, --what-if value completions. - * Add smartctl -n/--nocheck completion, add more other value completions. - * Fix leaking $prev from cpio, dsniff, freeciv, gkrellm, mkinitrd, service, - and tcpdump completions. - * Split ant completion to contrib/ant, improve the built in one. - * Improve postfix completion. - * Improve samba completion. - * Split lilo completion to contrib/lilo. - * Split reportbug and querybts completions to contrib/reportbug. - * Remove debug output noise from quotaon completion. - * Split Linux wireless tools completion to contrib/wireless-tools. - * Add mock completion. - * Split FreeBSD kld(un)load completion to contrib/kldload. - * Split FreeBSD pkg_* completion to contrib/pkg_install. - * Split FreeBSD portupgrade and friends completion to contrib/portupgrade. - * Split Slackware pkgtools completion to contrib/pkgtools. - * Improve rpm group completion (displayed completions are still wrong). - * Change many completions to load in memory only if the completed commands - are available. - * Invoke the actual mplayer/mencoder command being completed (with full path) - to get various completions instead of simply "mplayer" or "mencoder". - * Associate OOXML/MS Office 2007 extensions with OpenOffice applications. - * Associate .tsv with oocalc. - * Add xmlwf completion. - * Associate *.po with poedit, gtranslator, kbabel, and lokalize. - * Add xz, xzcat, xzdec, and unxz completion. - * Add lzcat, lz*grep, lzless, lzmore, and unlzma completion. - * Load "modules" completion if /etc/profile.d/modules.sh exists even if - the "module" alias has not been defined (yet). - * Add *.ogv to xine-based players (Debian: #540033). - * Add $compopt (":" i.e. no-op with bash < 4, "compopt" with >= 4). - * Complete bzcat and zcat only on compressed files. - * Do not require a dot in bzcmp, bzdiff, bz*grep, zcmp, zdiff, z*grep, zless, - and zmore filename completions. - * Add xz and compress support and more tarball filename extensions to - rpmbuild -t*/--tarbuild completion. - * Don't hardcode path to lsmod. - * Fix sbcl file/dirname completion (Debian: #545743). - * Add /sbin to $PATH when invoking lspci and lsusb. - * Support .xz suffix in info page completions. - * Prevent rpm --define/-D completions from falling through. - * Add more common options to rpm option completions. - - [ Todd Zullinger ] - * Make yum complete on filenames after install, deplist, update and upgrade - when the following argument contains a slash. - - [ Mike Kelly ] - * Fix _filedir on bash 4. - * Add support for xz to tar completion. - * Fix _quote_readline on bash 4 (Debian: #544024). - - [ Guillaume Rousse ] - * Split mkinitrd completion to contrib/mkinitrd, improve it. - * Split smartctl completion to contrib/smartctl. - * Better ssh and sftp completion - * Better xhost completion - * Split _known_hosts completion in two parts, to avoid parsing command line - twice - * Added strace completion - * Added xm completion - * Added rpcdebug completion - * Added msynctool completion - * Added openldap completion - * Added ldapvi completion - * Added heimdal completion - * Added vpnc completion - * Added rpmcheck completion - * Added munin-node completion - * Added bluez-utils completion - * Added samba completion - * Added cfengine completion - * Added xmllint completion, contributed by Ville - * Added shadow completion, contributed by Ville - * Added repomanage completion, contributed by Ville - * Splitted and enhanced openssl completion - * Added rfkill, mdadm and resolvconf completions - - [ Raphaël Droz ] - * Add mount -L and -U completion. - - [ Philipp Weis ] - * Add .dvi.{gz,bz2} completion for evince/okular (Debian: #522656) - - [ Freddy Vulto ] - * Patched _known_hosts() to support multiple {Global,User}KnownHosts in SSH - config files, thanks to Thomas Nilsson (Alioth: #311595) (Debian: #524190) - * Fix leaking $i from info, man and python completions. - * Added setting COMP_KNOWN_HOSTS_WITH_HOSTFILE. _known_hosts_real() will add - hosts from HOSTFILE, unless COMP_KNOWN_HOSTS_WITH_HOSTFILE is set to an - empty value (Alioth: #311821) - * Quoted $cur to prevent globbing - thanks to Eric Blake (Alioth #311614) - * Fix leaking $muttcmd from mutt completion - * Fix completing multiple hosts (Debian: #535585) - - [ Michele Ballabio ] - - * Add more extensions to pkgtools completion. - - -- David Paleino Sat, 03 Oct 2009 15:41:49 +0200 - -bash-completion (1.0) - - [ Guillaume Rousse ] - * Make bibtex complete on .aux files - * Add .xvid and .XVID to player completion - * Added cowsay/cowthink completion - * Added brctl completion - * Added cpan2dist completion - * Added qemu completion - * Added net-tools (mii-tool and mii-diag) completions - * Added minicom completion - * Added quota-tools completion - * Added rdesktop completion - * Added tightvncviewer completion - * Cleanup screen completion, and make it completes on options - - [ David Paleino ] - * Added .kar to Timidity completion. - * Fix killall completion, remove trailing ":" on certain process - names - * Fix man -l completing filenames (Debian: #497074) - * (Partly) fixed java classes completion (Debian: #496828). Look for - FIXME in source. - * Dump to /dev/null error message from look(1) with no arguments - (Debian: #495142) - * Set ssh as default for rsync (was rsh) (Debian: #492328) - * Added .oga, .ogv, .ogx to mplayer completion (Debian: #496162) - * Added .epub to unzip|zipinfo completion (Debian: #492476) - * Added ssh-copy-id completion (Debian: #491856) - * Moved ssh completion to separate file (Debian: #360628) - * Bogus completion when mounting subdirs fixed (Debian: #322238) - * Fix `apt-cache showsrc` completing only on source package names - (Debian: #361535) - * Fixed bugs with gdb completion: - - when an empty directory is in $PATH (thanks to Morita Sho) - (Debian: #497597) - - when a non-existing directory is in $PATH (Debian: #499780) - * Fix missing completion for "-n" and "-e" (we were using echo, now - using printf) (thanks to Morita Sho) (Debian: #498105) - * Fixed gpg completion: - - --@(export|@(?(l|nr|nrl)sign|edit)-key)) (Debian: #500316) - - -@(r|-recipient)) - * Fixed .cb[rz] completion for evince (Debian: #502885) - * Added gksudo, gksu, kdesudo completion - * Added apache2ctl completion - * Added gpg2 completion (Debian: #489927) - * Fixed mplayer -skin completion (Debian: #501473) - * Fixed errors with POSIX enabled (Debian: #502804) - * Fixed dpkg-source wrong exit() with return() (Debian: #) - * Added --schedule-only to aptitude's completion (Debian: #502664) - * Added build-dep to aptitude's completion (Debian: #495883) - * Added support for `-F configfile' to _known_hosts(), ssh, scp and - sftp, thanks to Freddy Vulto (Debian: #504141) - * Fixed sed quoting bug in _known_hosts(), thanks to Freddy Vulto - (Debian: #504650) - * Allow `Host(Name)' in ssh config file to be indented - * Allow `Host(Name)' in ssh config file to have trailing comment. - * Allow for comments in known_hosts files (Debian: #511789) - * Fixed perl -I/-x completion, thanks to Freddy Vulto - (Debian: #504547) - * README updated: explain how to use bash-completion correctly. - (Debian: #506560) - * TODO updated: the Alioth team is now upstream. - * Added qdbus completion, thanks to Terence Simpson (Ubuntu: #257903) - * Added monodevelop and mdtool completions. - * Split subversion-related completions to contrib/_subversion - (prefixed with _ to avoid file conflicts with upstream's one) - * Fixed completion of environment variables, thanks to Morita Sho - (Debian: #272660) - * Fix dpkg completion bug: it listed only non-Essential packages - (Debian: #511790) - * Fixed _dpkg_source completion (Debian: #503317) - * Added _parse_help() to try to parse options listed in $command - --help - * Fixed gzip completion to use _parse_help(), since the available - options vary with distributions - * Added to_review/ directory, where completions needing a review would - go. After it gets accepted, the completion would go into contrib/. - * Remove unused UNAME local variable in _info() (Debian: #501843) - * AUTHORS added - * Make _alias() use _get_cword - * Added .zip to jar completions (Debian: #521041) - * Merge from Gentoo: - - fix 'find' completion so that it properly completes on -?(i)whilename. - Patch by Ciaran McCreesh. - - use make -qp to parse the Makefile for us, so we get proper completion - on things like pattern rules. Patch by Mike Kelly . - - complete on gkrellm2 as well. Patch by Aaron Walker. - - fix CVS completion - * Merge from Ubuntu: - - consume error messages in configure completion (Ubuntu: #223882) - (Mika Fischer) - - quote $xspec in _filedir_xspec in case it is empty, which would - cause errors if there was no match under failglob. (Ubuntu: #194419) - (Mika Fischer) - * debian/links fixed (Debian: #494292) - * debian/control: - - fixed typo in the long description - - added Vcs-* fields - * debian/install: - - correctly install contrib/* under /etc/bash_completion.d/ - * debian/copyright updated - * extra/dh_bash-completion: - - updated to support a list of files in debian/.bash-completion - (Debian: #512917) - - [ Ville Skyttä ] - * Added JPEG 2000 files to display completion, thanks to Bastien Nocera - (RedHat: #304771) - * Improved rpm macro completion. - * Added -E to rpm completion. - * Improved rpm backup file avoidance. - * Improved /var/log/rpmpkgs based rpm installed package completion. - * Improved performance of rpm -qa based rpm installed package completion. - * Improved features and performance of yum completion. - * Added support for p (POSIX) and x (x.org) man sections. - * Improved filename based man page completion. - * Added minimal sqlite3 completion. - * Improved getent completion (Ville Skyttä, Guillaume Rousse). - * (Re)fix gzip and bzip2 options completion. - * Improved svn filename completion (RedHat: #430059). - * Add lzma completion (Per Øyvind Karlsen, Ville Skyttä). - * Add .mp2 and .vdr to mplayer completion (RedHat: #444467). - * Add .mkv, .mp2 and .vdr to *xine completion (RedHat: #444467). - * Added lzop completion. - * Fix scp metacharacter escaping. - * Remove duplicate cpio completion, thanks to Freddy Vulto (Debian: #512823) - * Fix awk error in "modprobe -r /" completion (Debian: #512556). - * Expand ~foo to dir name more eagerly to avoid quoting issues. - * Fix -sourcepath handling in javadoc packages completion. - * Extract process name completion from _killall to _pnames, make it work - for others than Linux and FreeBSD. - * Fix process name completion with relative paths (RedHat: #484578). - * Use improved process name completion in pgrep in addition to killall. - * Enable pgrep and pkill completion if the commands are available, not just - on Linux and FreeBSD. - * Drop hg completion, an improved version is shipped with Mercurial - (contrib/bash_completion in the tarball). - * Make okular complete on same files as evince, thanks to Mary Ellen Foster - (RedHat: #486998). - * Apply ps2pdf completion to ps2pdf{12,13,14,wr} too. - * Simplify bash_completion.sh, return earlier in non-applicable environments. - * Remove obsolete --buildarch and --buildos rpm(build) completions. - * Add rpmbuild --target completion. - * Use "-profile help" to get mplayer and friends -profile completions. - * Fix local array initialization under bash 3.0, prevents "()" occurring in - file and dir name completions. - - [ Freddy Vulto ] - * Restored `_display()' completion for `display' by removing - completion-by-extension for `display' (Alioth#311429) - * Removed duplicate completion option `-borderwidth' for `display' - * Prevent completion dir from being sourced twice if - BASH_COMPLETION_DIR and BASH_COMPLETION_COMPAT_DIR are equal (Alioth#311433) - * Make `_mii-tool()' and `_mii-diag()' POSIX-compliant - * Fix _isql completion waiting for grep input if $ODBCINI not set; handle - whitespace in $ODBCINI. - * Split vncviewer completion in _tightvncviewer() and _xvnc4viewer() - Added _realcommand() global function. - - [ Jakob Unterwurzacher ] - * ps2pdf can run on .pdf files as well. (Debian: #516614, Ubuntu: #316943) - - [ Santiago M. Mola ] - * Add .ape to mplayer supported extensions (Alioth#311510). - - -- David Paleino Wed, 25 Mar 2009 23:18:24 +0100 - -bash-completion (20080705) unstable; urgency=low - - [ David Paleino ] - * Added more completions to imagemagick (thanks to Nelson A. de - Oliveira) (Debian: #487786) - * Added xrandr completion (thanks to Anton Khirnov) (Debian: #487825) - * Improving _gdb completion: - - $filenames to $default (Debian: #463969) - - also show directory names (i.e. compgen -d) in COMPREPLY. - - added . to $PATH, to allow debugging "local" executables. - - do not complete Bash's builtins (thanks to Morita Sho) - - [ Luk Claes ] - * Remove use of ucf for /etc/bash-completion (Debian: #488171). - - -- Luk Claes Sat, 05 Jul 2008 16:14:15 +0200 - -bash-completion (20080617.5) unstable; urgency=medium - - * Revert way of setting environment variables (Debian: #487774). - * Add equals sign to _get_cword for mutt_aliases (Debian: #482635). - * Enhance mlayer completion (Debian: #487826, #487838). - - -- Luk Claes Tue, 24 Jun 2008 19:50:57 +0200 - -bash-completion (20080617.4) experimental; urgency=low - - [ David Paleino ] - * Merged Ubuntu changes: - - added quote(), quote_readline(), dequote() helper functions. - - added _remove_word() - - fixed _get_cword() - - refactored _filedir using quote_readline() - - refactored _filedir_xspec using quote_readline() - - fixed COMPREPLY's in _iwconfig - - fixed _cvs() - - _known_hosts(): use files from UserKnownHostsFile options in - addition to standard ones. - - fixed _command() to correctly prune the command line - - disabled completion of PostgreSQL users and databases (Ubuntu: #164772) - - fixed _java_packages() - - fixed _muttquery() - - added flv/FLV completion to mplayer - - added --installed to apt-cache - - only complete on filenames for aspell - - fixed code for exclusions compspecs - - added code to gracefully handle debug options (set +/-v) - - -- Luk Claes Mon, 23 Jun 2008 19:25:25 +0200 - -bash-completion (20080617.3) unstable; urgency=low - - [ David Paleino ] - * Fixed IFS for filedir_xspec - Thanks to Stefan Lippers-Hollmann - (Debian: #487571) - - [ Luk Claes ] - * Install dh-bash-completion to ease installation of completions. - - -- Luk Claes Mon, 23 Jun 2008 07:24:21 +0200 - -bash-completion (20080617.2) unstable; urgency=low - - [ David Paleino ] - * New upstream release - - provide a manpage for extra/dh_bash-completion - - fix semi-serious problem with _filedir() (Debian: #487449) - * debian/rules: - - added rule to generate dh_bash-completion's manpage - * debian/install, debian/dirs: - - installing dh_bash-completion into /usr/bin - * debian/control: - - new package dh-bash-completion - - [ Luk Claes ] - * Comment new package to make sure current fix gets in the archive first. - * Add compression completion for vi(m). - - -- Luk Claes Sun, 22 Jun 2008 19:47:23 +0200 - -bash-completion (20080617.1) unstable; urgency=medium - - [ David Paleino ] - * Urgency set to medium because the package is currently unusable. - * New upstream sub-release - - fixed some typos here and there which prevented bash completions - at all (Debian: #487441). - - really closing Debian bug #455510. - - -- Luk Claes Sun, 22 Jun 2008 00:22:53 +0200 - -bash-completion (20080617) unstable; urgency=low - - [ David Paleino ] - * New upstream release - - add more completions to aptitude (Debian: #432289) - - fixed UTF-8 problem with _get_cword(), thanks to - Andrei Paskevich (Debian: #472132) - - fixed autoremove completion, thanks to Flavio Visentin - (Debian: #474974) - - cmf and CMF added to playmidi completion (Debian: #365658) - - added rrdtool completion, thanks to Justin Pryzby (Debian: #428641) - - added OpenDocument completion for unzip/zipinfo (.od{f,g,p,s,t}) - (Debian: #472940) - - fixed escaping problems with job control (i.e. disown, jobs, bg, - fg): the argument is now surrounded by "" (Debian: #347316) - - make mkdir complete also on filenames (Debian: #376433) - - {bz,z}{cat,cmp,diff,egrep,fgrep,grep,less,more} now should complete - on all filenames, not just compressed archives (just commented out) - (Debian: #455510) - - fixes Perl completion (Debian: #470742) - - fixes get_cword -> _get_cword typo (Debian: #478596) - - fixes _get_cword() function to properly handle filenames with - whitespaces (Debian: #394636, #468254, #474094) - - added .pdf.bz2 completion to evince (Debian: #424736) - - added .svg completion to display (Debian: #441017) - - added .m2ts completion to mplayer (Debian: #480879) - - added extra/dh_bash-completion to ease future rewrite of bc. - * debian/copyright - now in a fancier machine-parsable format. - * debian/control: - - added myself to Uploaders - - debhelper Build-Depends updated to >= 6. - * debian/watch: - - improved current watch line regex - - added (commented out) probable future watch line - * debian/compat bumped to 6 - * debian/dirs, debian/install and debian/links added - * debian/rules: - - refactored to make use of debian/{dirs,install,links} - - [ Steve Kemp ] - * Applied patch to fix completion of umount command. - (Debian: #470539) - * Fixed the completion of Perl manpages. - (Debian: #404976) - * Added 'aif' to the filenames offed for completion for mplayer. - (Debian: #474517) - * Allow tsocks completion. - (Debian: #409423) - * Update mutt completion to handle local usernames. - (Debian: #416655) - * Update apt-get completion to include the flag "--no-install-recommends" - (Debian: #475242) - - -- Luk Claes Sat, 21 Jun 2008 21:59:43 +0200 - -bash-completion (20060301-4) unstable; urgency=low - - * Add some fixes from Ubuntu: - * Fix completion of filenames with spaces (Debian: #468254). - * Fix parsing of SSH config files (Debian: #435117). - * Change priority to standard (Debian: #471666). - * Add some more completions for xine (Debian: #452083, #471249). - * Fix completion of gzip (Debian: #351913). - * Also use $HOSTFILE in hostname completion (Debian: #400380). - - -- Luk Claes Sat, 22 Mar 2008 23:10:30 +0000 - -bash-completion (20060301-3) unstable; urgency=low - - * Fix kpdf completion (Debian: #468163, #413374). - * Fix completion of - or -- with _command (Debian: #415276). - * Add sux to the complete -u list (Debian: #466089). - * Add dvipdfm to the list of dvi programs (Debian: #396644). - * Add --purge-unused option completion for aptitude (Debian: #438471). - * Add divx extension completion for mplayer (Debian: #444294). - * Add pdf.gz completion for evince (Debian: #456887). - * Add --remove-all completion for update-alternatives (Debian: #269173). - - -- Luk Claes Wed, 05 Mar 2008 22:57:27 +0100 - -bash-completion (20060301-2) unstable; urgency=low - - * Take over the package. - - -- Luk Claes Wed, 27 Feb 2008 19:22:03 +0100 - -bash-completion (20060301-1) unstable; urgency=low - - * Upload to unstable. - - -- Matthias Klose Sat, 09 Feb 2008 23:18:20 +0100 - -bash-completion (20060301-0ubuntu2) hardy; urgency=low - - * Replace bash (<< 3.1dfsg-9), handle upgrade in preinst. - * Exclude hashed hostnames from ssh host completion results. Debian: #428085. - * Fix: ifup/down don't really complete. Debian: #463756. - * Allow perl completion to complete filenames, complete -I and -x arguments. - Debian: #443394. - * Add find -wholename completion. Debian: #431220. - * Handle whitespaces in $HOME for _known_hosts() completion. Debian: #414821. - * dpkg -L: complete for removed-but-not-purged packages. Debian: #372156. - * Complete for apt-get autoremove. Debian: #433542, #443816, #445332. - * Update completion for mplayer (mka/flac). Debian: #340452. - * Add ping6/fping6 completion. Debian: #413170. - * Handle whitespace in paths for mount/umount completion. Debian: #367957. - * apt-get: Support --auto-remove. Ubuntu: #60666. - - -- Matthias Klose Sat, 09 Feb 2008 23:11:32 +0100 - -bash-completion (20060301-0ubuntu1) hardy; urgency=low - - * Initial release, split out from the bash package. - The software currently is unsupported upstream. - * Don't try to set a readonly variable. Ubuntu: #149527. - * Support purge in apt-get auto completion (Mathias Gug). Ubuntu: #151677. - * evince: Autocomplete on cbr/cbz/djvu files. Ubuntu: #156200, #175220. - Debian: #400678. - * kdvi: complete .*\.dvi\.(gz|bz2). Ubuntu: #128234. - * kpdf: Complete postscript files. Ubuntu: #162319. - * Make completion working in the middle of a word (Adam Simpkins). - Ubuntu: #139666. - - -- Matthias Klose Fri, 08 Feb 2008 16:46:34 +0100 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index da865894abe..1520952e28e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,8 +4,43 @@ Contributions to the bash completion project are more than welcome. Fixes, clean-ups and improvements of existing code are much appreciated, as are completion functions for new commands. -If you wish to contribute code, please bare the following coding -guidelines in mind: +However, before submitting a completion to us, first consider submitting it to +the project that ships the commands your completion is for. Having the +completion shipped along with the command opens up some liberties we don't have +if the completion is included with bash-completion. For example, we generally +do not want to hardcode lists of available command options and their +completions, because they quite probably vary between versions of the completed +command, and therefore resort to scraping --help output and the like. While we +do fairly well there, depending on the command, this can be fragile or +expensive, or just not possible. If the completion is shipped alongside the +command, they can be kept in sync and use more hardcoding etc. They are also +more likely to be maintained and/or watched by people intimately familiar with +the completed commands. See instructions in README.md how to install completion +files from other projects so they are automatically enabled and dynamically +loaded by bash-completion. + +On the other hand, we do have a pretty nice test suite and a bunch of helper +functions that you may find useful. And a whole slew of completions in one +package. Our functions can be used from "external" completions as well, just +make sure you test for their existence and/or fail gracefully if you intend +your completion to be usable without having bash-completion installed. + +It's nowhere near clear cut always what is the best place for the completion, +upstream project or us. Even if it would seem to be upstream, not all upstreams +are interested in shipping completions, or their install systems might not +easily support installing completion files properly. Or the projects might be +stagnant. But give it some thought, and ask if unsure. + +If you wish to contribute code to us, volunteering for long term maintainership +of your code within bash-completion is welcome, and stating willingness for +that goes a long way in getting your contribution accepted. There are a lot of +completions in bash-completion already, and chances are that existing +maintainers might not want to add completions they don't actively use +themselves into their maintenance workload. When exactly you will be asked to +join the project depends on the case; there are no real, consistent "rules" for +that. Don't be disappointed if it does or doesn't happen instantly. + +Also, please bear the following coding guidelines in mind: - Do not use Perl, Ruby, Python etc. to do text processing unless the command for which you are writing the completion code implies the @@ -19,10 +54,10 @@ guidelines in mind: start interpreters. Use lightweight programs such as grep(1), awk(1) and sed(1). -- Use the full power of bash >= 4.1. We no longer support earlier bash +- Use the full power of bash >= 4.2. We no longer support earlier bash versions, so you may as well use all the features of that version of bash to optimise your code. However, be careful when using features - added since bash 4.1, since not everyone will be able to use them. + added since bash 4.2, since not everyone will be able to use them. For example, extended globs often enable you to avoid the use of external programs, which are expensive to fork and execute, so do @@ -55,7 +90,7 @@ guidelines in mind: As another example, ```shell - bar=$( echo $foo | sed -e 's/bar/baz/g' ) + bar=$(echo $foo | command sed -e 's/bar/baz/g') ``` can be replaced by: @@ -67,6 +102,16 @@ guidelines in mind: These forms of parameter substitutions can also be used on arrays, which makes them very powerful (if a little slow). +- We want our completions to work in `posix` and `nounset` modes. + + Unfortunately due to a bash < 5.1 bug, toggling POSIX mode interferes + with keybindings and should not be done. This rules out use of + process substitution which causes syntax errors in POSIX mode. + + Instead of toggling `nounset` mode, make sure to test whether + variables are set (e.g. with `[[ -v varname ]]`) or use default + expansion (e.g. `${varname-}`). + - Prefer `compgen -W '...' -- $cur` over embedding `$cur` in external command arguments (often e.g. sed, grep etc) unless there's a good reason to embed it. Embedding user input in command lines can result @@ -90,7 +135,7 @@ guidelines in mind: `--something` do the same thing and require an argument, offer only `--something` as a completion when completing option names starting with a dash, but do implement required argument processing for all - `-s`, `-S`, and `--something`. Note that GNU versions of various + `-s`, `-S`, and `--something`. Note that GNU versions of various standard commands tend to have long options while other userland implementations of the same commands may not have them, and it would be good to have the completions work for as many userlands as @@ -108,6 +153,17 @@ guidelines in mind: - Make small, incremental commits that do one thing. Don't cram unrelated changes into a single commit. +- We use [Conventional Commits](https://www.conventionalcommits.org/) + to format commit messages, with types and most other details from + [commitlint's config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional). + `gitlint` in our pre-commit config checks commit messages for + conformance with these rules. + + It is important to do this correctly; commit types `fix` and `feat` + as well as any change marked as breaking affects what ends up in the + release notes, and what will the next bash-completion release's + (semantic) version be. + - If your code was written for a particular platform, try to make it portable to other platforms, so that everyone may enjoy it. If your code works only with the version of a binary on a particular @@ -119,9 +175,9 @@ guidelines in mind: use them, do so if there's no other sane way to do what you're doing. The "Shell and Utilities" volume of the POSIX specification is a good starting reference for portable use of various utilities, see - http://pubs.opengroup.org/onlinepubs/9699919799/ + . -- Use an editor that supports EditorConfig, see http://editorconfig.org/, +- Use an editor that supports EditorConfig, see , and format source code according to our settings. - Read the existing source code for examples of how to solve @@ -137,10 +193,21 @@ guidelines in mind: test suite (in the test/ dir) that verify that the code does what it is intended to do, fixes issues it intends to fix, etc. +- In addition to running the test suite, there are a few scripts in the test/ + dir that catch some common issues, see and use for example runLint. + +- Install pre-commit and set it up, see . + That'll run a bunch of linters and the like, the same as the + bash-completion CI does. Running it locally and fixing found issues before + commit/push/PR reduces some roundtrips with the review. + After installing it, enable it for stages we use it with like: + + ```shell + pre-commit install --hook-type pre-commit --hook-type commit-msg + ``` + - File bugs, enhancement, and pull requests at GitHub, - https://github.com/scop/bash-completion or send them to the email - gateway address bash-completion@fire.fundersclub.com which will pipe - them to GitHub issues (with your email address visible). + . Sending them to the developers might work too, but is really strongly discouraged as bits are more likely to fall through the cracks that way compared to the tracker. Just use GitHub. If that's not an diff --git a/COPYING b/COPYING index d511905c164..d159169d105 100644 --- a/COPYING +++ b/COPYING @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it diff --git a/Makefile.am b/Makefile.am index 78b6effc06e..55000feb73b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = completions doc helpers test pkgdata_DATA = bash_completion # Empty, but here just to get the compat dir created with install +compatdir = $(sysconfdir)/bash_completion.d compat_DATA = profiledir = $(sysconfdir)/profile.d @@ -18,20 +19,23 @@ cmakeconfig_DATA = bash-completion-config.cmake \ %: %.in Makefile $(SED) \ -e 's|@prefix[@]|$(prefix)|' \ - -e 's|@compatdir[@]|$(compatdir)|' \ - -e 's|@pkgdatadir[@]|$(pkgdatadir)|' \ + -e 's|@datadir[@]|$(datadir)|' \ + -e 's|@sysconfdir[@]|$(sysconfdir)|' \ + -e 's|@PACKAGE[@]|$(PACKAGE)|' \ -e 's|@VERSION[@]|$(VERSION)|' \ <$(srcdir)/$@.in >$@ CLEANFILES = bash_completion.sh bash-completion.pc \ bash-completion-config.cmake bash-completion-config-version.cmake -EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ - .editorconfig README.md CONTRIBUTING.md +EXTRA_DIST = CHANGELOG.md $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ + .editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc \ + .shellcheckrc bash-completion.pc.in bash-completion-config.cmake.in \ + bash-completion-config-version.cmake.in setup-symlinks.sh install-data-hook: tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \ $(SED) -e 's|-/etc/bash_completion\.d|-$(compatdir)|' \ - $(DESTDIR)$(pkgdatadir)/bash_completion > $$tmpfile && \ - cat $$tmpfile > $(DESTDIR)$(pkgdatadir)/bash_completion && \ + $(DESTDIR)$(datadir)/$(PACKAGE)/bash_completion >$$tmpfile && \ + cat $$tmpfile >$(DESTDIR)$(datadir)/$(PACKAGE)/bash_completion && \ rm $$tmpfile diff --git a/README.md b/README.md index 9a4da251250..21b6b1495e3 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,19 @@ # bash-completion -[![Build Status](https://travis-ci.org/scop/bash-completion.svg?branch=master)](https://travis-ci.org/scop/bash-completion) +[![CI](https://github.com/scop/bash-completion/actions/workflows/ci.yaml/badge.svg)](https://github.com/scop/bash-completion/actions/workflows/ci.yaml) + +## Introduction + +bash-completion is a collection of command line command completions for the +[Bash shell](https://www.gnu.org/software/bash/), collection of helper +functions to assist in creating new completions, and set of facilities for +loading completions automatically on demand, as well as installing them. ## Installation -The easiest way to install this software is to use a package; it is -available in many operating system distributions, some examples are listed -below. The package's name is usually bash-completion. - -[![Alpine](https://img.shields.io/badge/Alpine-%28see%20website%29-brightgreen.svg)](https://pkgs.alpinelinux.org/packages?name=bash-completion) -[![Arch](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fwww.archlinux.org%2Fpackages%2Fextra%2Fany%2Fbash-completion%2Fjson%2F&query=%24.pkgver&label=Arch)](https://www.archlinux.org/packages/extra/any/bash-completion/) -[![Debian](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapi.ftp-master.debian.org%2Fmadison%3Fpackage%3Dbash-completion%26f%3Djson%26s%3Dunstable&query=%24..source_version&label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1) -[![Fedora](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapps.fedoraproject.org%2Fmdapi%2Frawhide%2Fpkg%2Fbash-completion&query=%24.version&label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion) -[![FreshPorts](https://img.shields.io/badge/FreshPorts-%28see%20website%29-brightgreen.svg)](https://www.freshports.org/shells/bash-completion) -[![Gentoo](https://img.shields.io/badge/Gentoo-%28see%20website%29-brightgreen.svg)](https://packages.gentoo.org/packages/app-shells/bash-completion) -[![Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg)](http://formulae.brew.sh/formula/bash-completion%402) -[![OpenCSW](https://img.shields.io/badge/OpenCSW-%28see%20website%29-brightgreen.svg)](https://www.opencsw.org/package/bash_completion/) -[![openSUSE](https://img.shields.io/badge/openSUSE-%28see%20website%29-brightgreen.svg)](https://software.opensuse.org/package/bash-completion?baseproject=openSUSE%3AFactory) -[![Slackware](https://img.shields.io/badge/Slackware-%28see%20website%29-brightgreen.svg)](https://packages.slackware.com/?search=bash-completion) -[![Ubuntu](https://img.shields.io/badge/Ubuntu-%28see%20website%29-brightgreen.svg)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1) +The easiest way to install this software is to use a package; refer to +[Repology](https://repology.org/project/bash-completion) for a comprehensive +list of operating system distributions, package names, and available versions. Depending on the package, you may still need to source it from either `/etc/bashrc` or `~/.bashrc` (or any @@ -30,7 +25,7 @@ other file sourcing those). You can do this by simply using: . /usr/share/bash-completion/bash_completion ``` -(if you happen to have *only* bash >= 4.1 installed, see further if not) +(if you happen to have *only* bash >= 4.2 installed, see further if not) If you don't have the package readily available for your distribution, or you simply don't want to use one, you can install bash completion using the @@ -39,9 +34,9 @@ standard commands for GNU autotools packages: ```shell autoreconf -i # if not installing from prepared release tarball ./configure -make -make check # optional, requires python3 with pytest >= 3.6 and pexpect, dejagnu, and tcllib -make install # as root +make # GNU make required +make check # optional, requires python3 with pytest >= 3.6, pexpect +make install # as root ``` These commands install the completions and helpers, as well as a @@ -74,49 +69,31 @@ if [ -f /sw/etc/bash_completion ]; then fi ``` - ## Troubleshooting If you find that a given function is producing errors or does not work as it should under certain circumstances when you attempt completion, -try running `set -v` or `set -x` prior to attempting the completion +try running `set -x` or `set -v` prior to attempting the completion again. This will produce useful debugging output that will aid us in fixing the problem if you are unable to do so yourself. Turn off the -trace output by running either `set +v` or `set +x`. +trace output by running either `set +x` or `set +v`. + +If you are filing an issue, please attach the generated debugging output +in `set -x` mode copy-pasted to a separate, attached file in the report. +Before doing so, be sure to review the output for anything you may not want +to share in public, and redact as appropriate. To debug dynamic loading of a completion, tracing needs to be turned on before the debugged completion is attempted the first time. The easiest way to do this is to start a new shell session, and to turn tracing on in it before doing anything else there. - ## Known problems -1. There seems to be some issue with using the bash built-in `cd` within - Makefiles. When invoked as `/bin/sh` within `Makefile`s, bash seems - to have a problem changing directory via the `cd` command. A - work-around for this is to define `SHELL=/bin/bash` within your - `Makefile`. This is believed to be a bug in bash. - -2. Many of the completion functions assume GNU versions of the various +1. Many of the completion functions assume GNU versions of the various text utilities that they call (e.g. `grep`, `sed`, and `awk`). Your mileage may vary. -3. If you are seeing 'unbound variable' warnings from bash when - hitting <Tab>, this is because you have either `set -u` - or `set -o nounset` somewhere in your start-up files. This causes bash - to flag the use of any uninitialised shell variables as an error. - - Whilst we try to avoid references to uninitialised variables in the - code, there seem to be at least some cases where bash issues this - warning even though the variable in question has been initialised. - - One place this appears to occur is within the `_muttconffiles()` - helper function used by `mutt` completion, where the function calls - itself recursively. This seems to confuse bash and it issues - spurious warnings if `nounset` is set. - - ## FAQ **Q. The bash completion code inhibits some commands from completing on @@ -148,7 +125,8 @@ A. Install a local completion of your own appropriately for the desired A. Put them in the `completions` subdir of `$BASH_COMPLETION_USER_DIR` (defaults to `$XDG_DATA_HOME/bash-completion` or `~/.local/share/bash-completion` - if `$XDG_DATA_HOME` is not set) to have them loaded on demand. + if `$XDG_DATA_HOME` is not set) to have them loaded automatically + on demand when the respective command is being completed. See also the next question's answer for considerations for these files' names, they apply here as well. Alternatively, you can write them directly in `~/.bash_completion` which is loaded eagerly by @@ -163,20 +141,23 @@ A. Install it in one of the directories pointed to by alternatives: - The recommended directory is `completionsdir`, which you can get with - `pkg-config --variable=completionsdir bash-completion`. From this - directory, completions are loaded on-demand based on invoked commands' names, - so be sure to name your completion file accordingly, and to include - (for example) symbolic links in case the file provides completions - for more than one command. - - The other directory (which only present for backwards compatibility) - is `compatdir` (get it with - `pkg-config --variable=compatdir bash-completion`) from which files - are loaded when `bash_completion` is loaded. + `pkg-config --variable=completionsdir bash-completion`. From this + directory, completions are automatically loaded on demand based on invoked + commands' names, so be sure to name your completion file accordingly, and + to include (for example) symbolic links in case the file provides + completions for more than one command. The completion filename for + command `foo` in this directory should be either `foo`, or `foo.bash`. + (Underscore prefixed `_foo` works too, but is reserved for + bash-completion internal use as a deprecation/fallback marker.) + - The other directory which is only present for backwards compatibility, + its usage is no longer recommended, is `compatdir` (get it with + `pkg-config --variable=compatdir bash-completion`). From this + directory, files are loaded eagerly when `bash_completion` is loaded. For packages using GNU autotools the installation can be handled for example like this in `configure.ac`: - ``` + ```m4 PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , bashcompdir="${sysconfdir}/bash_completion.d") AC_SUBST(bashcompdir) @@ -192,7 +173,7 @@ A. Install it in one of the directories pointed to by For cmake we ship the `bash-completion-config.cmake` and `bash-completion-config-version.cmake` files. Example usage: - ``` + ```cmake find_package(bash-completion) if(BASH_COMPLETION_FOUND) message(STATUS @@ -207,58 +188,6 @@ A. Install it in one of the directories pointed to by ${BASH_COMPLETION_COMPLETIONSDIR}) ``` -**Q. I use CVS in combination with passwordless SSH access to my remote - repository. How can I have the `cvs` command complete on remotely - checked-out files where relevant?** - -A. Define `$COMP_CVS_REMOTE`. Setting this to anything will result in - the behaviour you would like. - -**Q. When I'm running a `./configure` script and completion returns a list - of long options to me, some of these take a parameter, - e.g. `--this-option=DESCRIPTION`.** - - **Running `./configure --help` lists these descriptions, but - everything after the `=` is stripped when returning completions, so - I don't know what kind of data is expected as a given option's - parameter.** - - **Is there a way of getting `./configure` completion to return the - entire option string, so that I can see what kind of data is - required and then simply delete the descriptive text and add my own - data?** - -A. Define `$COMP_CONFIGURE_HINTS`. Setting this to anything will - result in the behaviour you would like. - -**Q. When doing tar completion on a file within a tar file like this:** - - ``` - tar tzvf foo.tar.gz - ``` - - **the pathnames contained in the tar file are not displayed - correctly. The slashes are removed, and everything looks like it's - in a single directory. Why is this?** - -A. It's a choice we had to make. bash's programmable completion is - limited in how it handles the list of possible completions it - returns. - - Because the paths returned from within the tar file are likely not - existing paths on the file system, `-o dirnames` must be passed to - the `complete` built-in to make it treat them as such. However, - then bash will append a space when completing on directories during - pathname completion to the tar files themselves. - - It's more important to have proper completion of paths to tar files - than it is to have completion for their contents, so this sacrifice - was made and `-o filenames` is used with complete instead. - - If you would rather have correct path completion for tar file - contents, define `$COMP_TAR_INTERNAL_PATHS` *before* sourcing - `bash_completion`. - **Q. When completing on a symlink to a directory, bash does not append the trailing `/` and I have to hit <Tab> again. I don't like this.** @@ -307,7 +236,7 @@ A. Probably because the database is being queried every time and this uses a You can make this faster by pregenerating the list of installed packages on the system. Make sure you have a readable file called - `/var/log/rpmpkgs`. It's generated by `/etc/cron.daily/rpm` on + `/var/log/rpmpkgs`. It's generated by `/etc/cron.daily/rpm` on some Red Hat and Mandrake and derivative Linux systems. If you don't have such a cron job, make one: @@ -316,7 +245,7 @@ A. Probably because the database is being queried every time and this uses a #!/bin/sh rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \ - | sort > /var/log/rpmpkgs + | sort >/var/log/rpmpkgs ``` rpm completion will use this flat text file instead of the RPM database, @@ -339,21 +268,21 @@ A. The `readline(3)` library offers a few settings that can make tab For example, try putting the following in either `/etc/inputrc` or `~/.inputrc`: - ``` + ```inputrc set show-all-if-ambiguous on ``` This will allow single tab completion as opposed to requiring a double tab. This makes things much more pleasant, in our opinion. - ``` + ```inputrc set visible-stats on ``` This will suffix each returned file completion with a character denoting its type, in a similar way to `ls(1)` with `-F` or `--classify`. - ``` + ```inputrc set page-completions off ``` @@ -365,4 +294,4 @@ A. The `readline(3)` library offers a few settings that can make tab A. Absolutely not. zsh has an extremely sophisticated completion system that offers many features absent from the bash implementation. Its users often cannot resist pointing this out. More information can - be found at: http://www.zsh.org/ + be found at . diff --git a/bash-completion-config.cmake.in b/bash-completion-config.cmake.in index d907b76cebe..2b7de6c9759 100644 --- a/bash-completion-config.cmake.in +++ b/bash-completion-config.cmake.in @@ -4,8 +4,9 @@ set (BASH_COMPLETION_VERSION "@VERSION@") set (BASH_COMPLETION_PREFIX "@prefix@") -set (BASH_COMPLETION_COMPATDIR "@compatdir@") -set (BASH_COMPLETION_COMPLETIONSDIR "@pkgdatadir@/completions") -set (BASH_COMPLETION_HELPERSDIR "@pkgdatadir@/helpers") + +set (BASH_COMPLETION_COMPATDIR "@sysconfdir@/bash_completion.d") +set (BASH_COMPLETION_COMPLETIONSDIR "@datadir@/@PACKAGE@/completions") +set (BASH_COMPLETION_HELPERSDIR "@datadir@/@PACKAGE@/helpers") set (BASH_COMPLETION_FOUND "TRUE") diff --git a/bash-completion.pc.in b/bash-completion.pc.in index ea03fd75453..f0a3572c261 100644 --- a/bash-completion.pc.in +++ b/bash-completion.pc.in @@ -1,9 +1,12 @@ prefix=@prefix@ -compatdir=@compatdir@ -completionsdir=@pkgdatadir@/completions -helpersdir=@pkgdatadir@/helpers +datadir=@datadir@ +sysconfdir=@sysconfdir@ -Name: bash-completion +compatdir=${sysconfdir}/bash_completion.d +completionsdir=${datadir}/@PACKAGE@/completions +helpersdir=${datadir}/@PACKAGE@/helpers + +Name: @PACKAGE@ Description: programmable completion for the bash shell URL: https://github.com/scop/bash-completion Version: @VERSION@ diff --git a/bash_completion.sh.in b/bash_completion.sh.in index a28e1a62e21..a3bba6f13b5 100644 --- a/bash_completion.sh.in +++ b/bash_completion.sh.in @@ -1,14 +1,15 @@ +# shellcheck shell=sh disable=SC1091,SC2166,SC2268,SC3028,SC3044,SC3054 # Check for interactive bash and that we haven't already been sourced. if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then # Check for recent enough version of bash. - if [ ${BASH_VERSINFO[0]} -gt 4 ] || \ - [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then - [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \ + if [ "${BASH_VERSINFO[0]}" -gt 4 ] || + [ "${BASH_VERSINFO[0]}" -eq 4 -a "${BASH_VERSINFO[1]}" -ge 2 ]; then + [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" - if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then + if shopt -q progcomp && [ -r @datadir@/@PACKAGE@/bash_completion ]; then # Source completion code. - . @pkgdatadir@/bash_completion + . @datadir@/@PACKAGE@/bash_completion fi fi diff --git a/completions/.gitignore b/completions/.gitignore index 45c0a22e62c..576f3917a0c 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -1,228 +1,256 @@ -7za -aclocal-1.1[0123456] -alpine -alternatives -animate -apropos -aptitude-curses -arm-koji -asciidoc.py -autoheader -automake-1.1[0123456] -autossh -autoupdate -bsdtar -btdownloadcurses.py -btdownloadgui.py -c++ -cc -cdrecord -chrome -chromium -ci -ciptool -civclient -civserver -clzip -co -colormake -compare -compgen -composite -conjure -cowthink -createdb -createuser -dcop -declare -dfutool -display -dpkg-deb -dpkg-query -dpkg-reconfigure -dropdb -dropuser -edquota -etherwake -f77 -f95 -filebucket -freeciv-gtk2 -freeciv-gtk3 -freeciv-sdl -freeciv-xaw -g++ -g++-[5678] -g4 -g77 -g95 -gcc-[5678] -gccgo -gccgo-[5678] -gcj -geoiplookup6 -gfortran -gfortran-[5678] -gkrellm2 -gmake -gmplayer -gnumake -google-chrome -google-chrome-stable -gpc -gpgv2 -hciattach -hciconfig -hd -host -hping -hping3 -iceweasel -identify -ifdown -ifquery -ifstatus -import -insmod.static -iperf3 -javac -javadoc -kplayer -l2ping -lbzip2 -ldapadd -ldapcompare -ldapdelete -ldapmodify -ldapmodrdn -ldappasswd -ldapwhoami -links2 -lintian-info -lusermod -lvchange -lvcreate -lvdisplay -lvextend -lvmdiskscan -lvreduce -lvremove -lvrename -lvresize -lvs -lvscan -lz4c -mailsnarf -mdecrypt -mencoder -micropython -mkisofs -mogrify -montage -mozilla-firefox -mplayer2 -msgsnarf -muttng -ncal -pbzip2 -pccardctl -pdlzip -perldoc -phing -pigz -pinfo -ping6 -pkg_deinstall -pkg_info -pkill -plzip -pm-suspend -pm-suspend-hybrid -pmake -postalias -ppc-koji -puppetca -puppetd -puppetdoc -puppetmasterd -puppetqd -puppetrun -pvchange -pvcreate -pvdisplay -pvmove -pvremove -pvs -pvscan -pxz -py.test -py.test-[23] -pydoc3 -pylint-[23] -pytest-[23] -python2 -python3 -pypy -pypy3 -pyvenv-3.[45678] -qemu-kvm -qemu-system-i386 -qemu-system-x86_64 -quotacheck -quotaoff -quotaon -ralsh -rcsdiff -rdict -repquota -rfcomm -rlog -rpm2targz -rpm2txz -rpmbuild -rpmbuild-md5 -s390-koji -sbcl-mt -scp -sdptool -setquota -sftp -sidedoor -slogin -smbcacls -smbcquotas -smbget -smbpasswd -smbtar -smbtree -sparc-koji -spovray -star -stream -sudoedit -tightvncviewer -tracepath6 -typeset -vgcfgbackup -vgcfgrestore -vgchange -vgck -vgconvert -vgcreate -vgdisplay -vgexport -vgextend -vgimport -vgmerge -vgmknodes -vgreduce -vgremove -vgrename -vgs -vgscan -vgsplit -vigr -whatis -xpovray -xvnc4viewer -ypcat +/7za +/aclocal-1.1[0123456] +/alpine +/alternatives +/animate +/apropos +/aptitude-curses +/arm-koji +/asciidoc.py +/autoheader +/automake-1.1[0123456] +/autossh +/autoupdate +/avahi-browse-domains +/bmake +/bsdtar +/btdownloadcurses.py +/btdownloadgui.py +/c++ +/cc +/cdrecord +/chrome +/chromium +/ci +/ciptool +/civclient +/civserver +/clzip +/co +/colormake +/compare +/compgen +/composite +/conjure +/cowthink +/createdb +/createuser +/dcop +/dfutool +/display +/dpkg-deb +/dpkg-query +/dpkg-reconfigure +/dropdb +/dropuser +/edquota +/etherwake +/f77 +/f95 +/filebucket +/firefox-esr +/freeciv-gtk2 +/freeciv-gtk3 +/freeciv-sdl +/freeciv-xaw +/g++ +/g++-[5678] +/g4 +/g77 +/g95 +/gcc-[5678] +/gccgo +/gccgo-[5678] +/gcj +/geoiplookup6 +/gfortran +/gfortran-[5678] +/gkrellm2 +/gmake +/gmplayer +/gnumake +/google-chrome +/google-chrome-stable +/gpc +/gpgv2 +/gssdp-device-sniffer +/gtar +/hciattach +/hciconfig +/hd +/host +/hping +/hping3 +/iceweasel +/identify +/ifdown +/ifquery +/ifstatus +/import +/inotifywatch +/insmod.static +/iperf3 +/javac +/javadoc +/kplayer +/l2ping +/lbzip2 +/ldapadd +/ldapcompare +/ldapdelete +/ldapmodify +/ldapmodrdn +/ldappasswd +/ldapwhoami +/links2 +/lintian-info +/lua5[0-4] +/lua5.[0-4] +/luac5[0-4] +/luac5.[0-4] +/lusermod +/lvchange +/lvcreate +/lvdisplay +/lvextend +/lvmdiskscan +/lvreduce +/lvremove +/lvrename +/lvresize +/lvs +/lvscan +/lz4c +/mailsnarf +/md5sum +/mdecrypt +/mencoder +/micropython +/mkisofs +/mogrify +/montage +/mozilla-firefox +/mplayer2 +/msgsnarf +/muttng +/ncal +/neomutt +/pbzip2 +/pccardctl +/pdlzip +/perldoc +/phing +/pigz +/pinfo +/ping6 +/pkg_deinstall +/pkg_info +/pkgconf +/pkill +/plzip +/pm-suspend +/pm-suspend-hybrid +/pmake +/postalias +/ppc-koji +/puppetca +/puppetd +/puppetdoc +/puppetmasterd +/puppetqd +/puppetrun +/pvchange +/pvcreate +/pvdisplay +/pvmove +/pvremove +/pvs +/pvscan +/pxz +/py.test +/py.test-[23] +/pydoc3 +/pylint-[23] +/pytest-[23] +/python2 +/python2.7 +/python3 +/python3.[3456789] +/python3.1[01] +/pypy +/pypy3 +/pyston +/pyston3 +/pyvenv-3.[456789] +/pyvenv-3.1[01] +/qemu-kvm +/qemu-system-i386 +/qemu-system-x86_64 +/quotacheck +/quotaoff +/quotaon +/ralsh +/rcsdiff +/rdict +/repquota +/rfcomm +/rlog +/rpm2targz +/rpm2txz +/rpmbuild +/rpmbuild-md5 +/s390-koji +/sbcl-mt +/scp +/sdptool +/setquota +/sftp +/shasum +/sha1sum +/sha224sum +/sha384sum +/sha512sum +/sidedoor +/slogin +/smbcacls +/smbcquotas +/smbget +/smbpasswd +/smbtar +/smbtree +/sparc-koji +/spovray +/star +/stream +/sudoedit +/tightvncviewer +/tracepath6 +/typeset +/vgcfgbackup +/vgcfgrestore +/vgchange +/vgck +/vgconvert +/vgcreate +/vgdisplay +/vgexport +/vgextend +/vgimport +/vgmerge +/vgmknodes +/vgreduce +/vgremove +/vgrename +/vgs +/vgscan +/vgsplit +/vigr +/whatis +/wine-development +/wine-stable +/wine64 +/wine64-development +/wine64-stable +/xpovray +/xvnc4viewer +/ypcat diff --git a/completions/2to3 b/completions/2to3 index 4dd29bf4810..7c5b3303a2a 100644 --- a/completions/2to3 +++ b/completions/2to3 @@ -6,19 +6,19 @@ _2to3() _init_completion -s || return case $prev in - -h|--help|--add-suffix) + -h | --help | --add-suffix) return ;; - -f|--fix|-x|--nofix) - COMPREPLY=( $( compgen -W \ - "$( $1 --list-fixes 2>/dev/null | command sed -e 1d )" -- "$cur" ) ) + -f | --fix | -x | --nofix) + COMPREPLY=($(compgen -W \ + "$($1 --list-fixes 2>/dev/null | command sed -e 1d)" -- "$cur")) return ;; - -j|--processes) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + -j | --processes) + COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) return ;; - -o|--output-dir) + -o | --output-dir) _filedir -d return ;; @@ -27,13 +27,13 @@ _2to3() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir py } && -complete -F _2to3 2to3 + complete -F _2to3 2to3 # ex: filetype=sh diff --git a/completions/7z b/completions/7z index 7bef5254e64..f2a6ef639d4 100644 --- a/completions/7z +++ b/completions/7z @@ -5,8 +5,8 @@ _7z() local cur prev words cword _init_completion -n = || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'a b d e l t u x' -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -W 'a b d e l t u x' -- "$cur")) return fi @@ -15,7 +15,7 @@ _7z() case $cur in -ao*) - COMPREPLY=( $( compgen -P${cur:0:3} -W 'a s t u' -- "${cur:3}" ) ) + COMPREPLY=($(compgen -P${cur:0:3} -W 'a s t u' -- "${cur:3}")) return ;; -?(a)[ix]*) @@ -26,94 +26,103 @@ _7z() opt=${cur:0:2} cur=${cur:2} fi if [[ $cur != *[@\!]* ]]; then - COMPREPLY=( $( compgen -P$opt -W '@ ! r@ r-@ r0@ r! r-! r0!' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -P$opt -W '@ ! r@ r-@ r0@ r! r-! r0!' \ + -- "$cur")) elif [[ $cur == ?(r@(-|0|))@* ]]; then - local x tmp - x=$( compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}" ) && - while read -r tmp; do - COMPREPLY+=( "$tmp" ) - done <<< "$x" + local IFS=$' \t\n' reset=$(shopt -po noglob) + set -o noglob + COMPREPLY=($(compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}")) + $reset compopt -o filenames fi return ;; - -mhe=*|-mhc=*|-ms=*|-mt=*) - COMPREPLY=( $( compgen -W 'on off' -- "${cur#*=}" ) ) + -mhe=* | -mhc=* | -ms=* | -mt=*) + COMPREPLY=($(compgen -W 'on off' -- "${cur#*=}")) return ;; -mx=*) - COMPREPLY=( $( compgen -W '0 1 3 5 7 9' -- "${cur#*=}" ) ) + COMPREPLY=($(compgen -W '0 1 3 5 7 9' -- "${cur#*=}")) return ;; - -o*|-w?*) - local x tmp - x=$( compgen -P${cur:0:2} -S/ -d -- "${cur:2}" ) && - while read -r tmp; do - COMPREPLY+=( "$tmp" ) - done <<< "$x" - compopt -o nospace -o filenames + -o* | -w?*) + local reset=$(shopt -po noglob) + set -o noglob + compopt -o filenames + local IFS=$'\n' + COMPREPLY=($(compgen -d -P${cur:0:2} -S/ -- "${cur:2}")) + _comp_unlocal IFS + $reset + compopt -o nospace return ;; -r?*) - COMPREPLY=( $( compgen -P${cur:0:2} -W '- 0' -- "${cur:2}" ) ) + COMPREPLY=($(compgen -P${cur:0:2} -W '- 0' -- "${cur:2}")) return ;; -scs*) - COMPREPLY=( $( compgen -P${cur:0:4} -W 'UTF-8 WIN DOS' \ - -- "${cur:4}" ) ) + COMPREPLY=($(compgen -P${cur:0:4} -W 'UTF-8 WIN DOS' \ + -- "${cur:4}")) return ;; -ssc?*) - COMPREPLY=( $( compgen -P${cur:0:4} -W '-' -- "${cur:4}" ) ) + COMPREPLY=($(compgen -P${cur:0:4} -W '-' -- "${cur:4}")) return ;; -t*) if [[ $mode == w ]]; then - COMPREPLY=( $( compgen -P${cur:0:2} -W '7z bzip2 gzip swfc - tar wim xz zip' -- "${cur:2}" ) ) + COMPREPLY=($(compgen -P${cur:0:2} -W '7z bzip2 gzip swfc + tar wim xz zip' -- "${cur:2}")) else - COMPREPLY=( $( compgen -P${cur:0:2} -W '7z apm arj bzip2 cab + COMPREPLY=($(compgen -P${cur:0:2} -W '7z apm arj bzip2 cab chm cpio cramfs deb dmg elf fat flv gzip hfs iso lzh lzma lzma86 macho mbr mslz mub nsis ntfs pe ppmd rar rpm squashfs swf swfc tar udf vhd wim xar xz z zip' \ - -- "${cur:2}" ) ) + -- "${cur:2}")) fi return ;; - -m*=*|-p*|-u*|-v*) + -m*=* | -p* | -u* | -v*) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-ai -an -ao -ax -bd -i -m{x,s,f,he,hc,mt}= + COMPREPLY=($(compgen -W '-ai -an -ao -ax -bd -i -m{x,s,f,he,hc,mt}= -o -p -r -scs -sfx -si -slp -slt -so -ssc -t -u -v -w -x -y' \ - -- "$cur" ) ) - [[ $COMPREPLY == -@(an|bd|sfx|si|slt|so|ssc|[rwy]) ]] || + -- "$cur")) + [[ ${COMPREPLY-} == -@(an|bd|sfx|si|slt|so|ssc|[rwy]) ]] || compopt -o nospace return fi local args - _count_args = - if [[ $args -eq 2 ]]; then + _count_args "=" + if ((args == 2)); then _filedir_xspec unzip + # TODO: parsing 7z i output? + # - how to figure out if the format is input or output? + # - find string Formats:, read until next empty line + # - extensions start from column 26 + # - ignore everything in parens + # - terminate on two spaces + # - terminate on token containing anything [^a-z0-9] + # (assumption: extensions are all lowercase) [[ $mode == w ]] && _filedir '@(7z|bz2|swf|?(g)tar|?(t)[bglx]z|tb?(z)2|wim)' || - _filedir '@(7z|arj|bz2|cab|chm|cpio|deb|dmg|flv|gem|img|iso|lz[ah]|lzma?(86)|msi|pmd|[rx]ar|rpm|sw[fm]|?(g)tar|taz|?(t)[bglx]z|tb?(z)2|vhd|wim|Z)' + _filedir '@(7z?(.001)|arj|bz2|cab|cb7|chm|cpio|deb|dmg|flv|gem|img|iso|lz[ah]|lzma?(86)|msi|pmd|[rx]ar|rpm|sw[fm]|?(g)tar|taz|?(t)[bglx]z|tb?(z)2|vhd|wim|Z)' else if [[ ${words[1]} == d ]]; then local IFS=$'\n' - COMPREPLY=( $( compgen -W "$( printf '%s\n' $( $1 l ${words[2]} \ + COMPREPLY=($(compgen -W "$(printf '%s\n' "$($1 l ${words[2]} \ -slt 2>/dev/null | command sed -n '/^Path =/s/^Path = \(.*\)$/\1/p' \ - 2>/dev/null | tail -n+2 ) )" -- "$cur" ) ) + 2>/dev/null | tail -n+2)")" -- "$cur")) compopt -o filenames else _filedir fi fi } && -complete -F _7z 7z 7za + complete -F _7z 7z 7za # ex: filetype=sh diff --git a/completions/Makefile.am b/completions/Makefile.am index bccccefb64e..2a7a5b3adf2 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -1,11 +1,11 @@ -bashcompdir = $(pkgdatadir)/completions +bashcompdir = $(datadir)/$(PACKAGE)/completions bashcomp_DATA = 2to3 \ 7z \ a2x \ abook \ aclocal \ acpi \ - adb \ + _adb \ add_members \ alias \ ant \ @@ -14,6 +14,7 @@ bashcomp_DATA = 2to3 \ apt-build \ apt-cache \ apt-get \ + apt-mark \ aptitude \ arch \ arp \ @@ -26,6 +27,7 @@ bashcomp_DATA = 2to3 \ autoreconf \ autorpm \ autoscan \ + avahi-browse \ avctrl \ badblocks \ bind \ @@ -37,6 +39,7 @@ bashcomp_DATA = 2to3 \ _cal \ cancel \ cardctl \ + carton \ ccache \ ccze \ cfagent \ @@ -74,11 +77,14 @@ bashcomp_DATA = 2to3 \ cvs \ cvsps \ dd \ + declare \ deja-dup \ desktop-file-validate \ dhclient \ dict \ _dmesg \ + dmypy \ + dnssec-keygen \ dnsspoof \ dot \ dpkg \ @@ -142,6 +148,7 @@ bashcomp_DATA = 2to3 \ groupmod \ growisofs \ grpck \ + gssdp-discover \ gzip \ hcitool \ hddtemp \ @@ -156,16 +163,20 @@ bashcomp_DATA = 2to3 \ iconv \ id \ idn \ + ifstat \ iftop \ ifup \ + influx \ info \ inject \ + inotifywait \ insmod \ installpkg \ interdiff \ invoke-rc.d \ _ionice \ ip \ + ipcalc \ iperf \ ipmitool \ ipsec \ @@ -187,6 +198,7 @@ bashcomp_DATA = 2to3 \ jps \ jshint \ json_xs \ + jsonschema \ k3b \ kcov \ kill \ @@ -273,9 +285,10 @@ bashcomp_DATA = 2to3 \ _nmcli \ nproc \ nslookup \ + nsupdate \ ntpdate \ oggdec \ - op \ + _op \ openssl \ opera \ optipng \ @@ -283,6 +296,7 @@ bashcomp_DATA = 2to3 \ pack200 \ passwd \ patch \ + pdftoppm \ pdftotext \ perl \ perlcritic \ @@ -313,7 +327,9 @@ bashcomp_DATA = 2to3 \ postsuper \ povray \ prelink \ + printenv \ protoc \ + ps \ psql \ puppet \ pv \ @@ -361,9 +377,12 @@ bashcomp_DATA = 2to3 \ sbopkg \ screen \ scrub \ + secret-tool \ sh \ + sha256sum \ + shellcheck \ sitecopy \ - slackpkg \ + _slackpkg \ slapt-get \ slapt-src \ smartctl \ @@ -375,6 +394,7 @@ bashcomp_DATA = 2to3 \ ssh-add \ ssh-copy-id \ ssh-keygen \ + ssh-keyscan \ sshfs \ sshmitm \ sshow \ @@ -399,9 +419,13 @@ bashcomp_DATA = 2to3 \ tipc \ tox \ tracepath \ + tree \ + truncate \ tshark \ + tsig-keygen \ tune2fs \ _udevadm \ + ulimit \ _umount \ _umount.linux \ unace \ @@ -433,10 +457,11 @@ bashcomp_DATA = 2to3 \ wvdial \ xdg-mime \ xdg-settings \ + xev \ xfreerdp \ xgamma \ xhost \ - xm \ + _xm \ xmllint \ xmlwf \ xmms \ @@ -444,6 +469,7 @@ bashcomp_DATA = 2to3 \ xrandr \ xrdb \ xsltproc \ + xvfb-run \ xxd \ xz \ xzdec \ @@ -481,6 +507,8 @@ CLEANFILES = \ automake-1.16 \ autossh \ autoupdate \ + avahi-browse-domains \ + bmake \ bsdtar \ btdownloadcurses.py \ btdownloadgui.py \ @@ -504,7 +532,6 @@ CLEANFILES = \ createdb \ createuser \ dcop \ - declare \ dfutool \ display \ dpkg-deb \ @@ -517,6 +544,7 @@ CLEANFILES = \ f77 \ f95 \ filebucket \ + firefox-esr \ freeciv-gtk2 \ freeciv-gtk3 \ freeciv-sdl \ @@ -553,6 +581,8 @@ CLEANFILES = \ google-chrome-stable \ gpc \ gpgv2 \ + gssdp-device-sniffer \ + gtar \ hciattach \ hciconfig \ hd \ @@ -565,6 +595,7 @@ CLEANFILES = \ ifquery \ ifstatus \ import \ + inotifywatch \ insmod.static \ iperf3 \ javac \ @@ -581,6 +612,26 @@ CLEANFILES = \ ldapwhoami \ links2 \ lintian-info \ + lua50 \ + lua5.0 \ + lua51 \ + lua5.1 \ + lua52 \ + lua5.2 \ + lua53 \ + lua5.3 \ + lua54 \ + lua5.4 \ + luac50 \ + luac5.0 \ + luac51 \ + luac5.1 \ + luac52 \ + luac5.2 \ + luac53 \ + luac5.3 \ + luac54 \ + luac5.4 \ lusermod \ lvchange \ lvcreate \ @@ -595,6 +646,7 @@ CLEANFILES = \ lvscan \ lz4c \ mailsnarf \ + md5sum \ mdecrypt \ mencoder \ micropython \ @@ -606,6 +658,7 @@ CLEANFILES = \ msgsnarf \ muttng \ ncal \ + neomutt \ pbzip2 \ pccardctl \ pdlzip \ @@ -616,6 +669,7 @@ CLEANFILES = \ ping6 \ pkg_deinstall \ pkg_info \ + pkgconf \ pkill \ plzip \ pm-suspend \ @@ -645,15 +699,30 @@ CLEANFILES = \ pylint-3 \ pypy \ pypy3 \ + pyston \ + pyston3 \ pytest-2 \ pytest-3 \ python2 \ + python2.7 \ python3 \ + python3.3 \ + python3.4 \ + python3.5 \ + python3.6 \ + python3.7 \ + python3.8 \ + python3.9 \ + python3.10 \ + python3.11 \ pyvenv-3.4 \ pyvenv-3.5 \ pyvenv-3.6 \ pyvenv-3.7 \ pyvenv-3.8 \ + pyvenv-3.9 \ + pyvenv-3.10 \ + pyvenv-3.11 \ qemu-kvm \ qemu-system-i386 \ qemu-system-x86_64 \ @@ -676,6 +745,11 @@ CLEANFILES = \ sdptool \ setquota \ sftp \ + shasum \ + sha1sum \ + sha224sum \ + sha384sum \ + sha512sum \ sidedoor \ slogin \ smbcacls \ @@ -712,379 +786,236 @@ CLEANFILES = \ vgsplit \ vigr \ whatis \ + wine-development \ + wine-stable \ + wine64 \ + wine64-development \ + wine64-stable \ xpovray \ xvnc4viewer \ ypcat -symlinks: $(targetdir) $(DATA) - for file in 7za ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) 7z $(targetdir)/$$file ; \ - done - for file in aclocal-1.10 aclocal-1.11 aclocal-1.12 aclocal-1.13 \ - aclocal-1.14 aclocal-1.15 aclocal-1.16 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) aclocal $(targetdir)/$$file ; \ - done - for file in phing ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ant $(targetdir)/$$file ; \ - done - for file in aptitude-curses ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) aptitude $(targetdir)/$$file ; \ - done - for file in asciidoc.py ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) asciidoc $(targetdir)/$$file ; \ - done - for file in automake-1.10 automake-1.11 automake-1.12 automake-1.13 \ - automake-1.14 automake-1.15 automake-1.16 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) automake $(targetdir)/$$file ; \ - done - for file in autoheader ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) autoreconf $(targetdir)/$$file ; \ - done - for file in autoupdate ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) autoscan $(targetdir)/$$file ; \ - done - for file in btdownloadcurses.py btdownloadgui.py ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) btdownloadheadless.py $(targetdir)/$$file ; \ - done - for file in lbzip2 pbzip2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) bzip2 $(targetdir)/$$file ; \ - done - for file in ncal ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) _cal $(targetdir)/$$file ; \ - done - for file in pccardctl ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) cardctl $(targetdir)/$$file ; \ - done - for file in google-chrome google-chrome-stable chromium chrome; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) chromium-browser $(targetdir)/$$file ; \ - done - for file in compgen ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) complete $(targetdir)/$$file ; \ - done - for file in mogrify display animate identify montage composite \ - compare conjure import stream ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) convert $(targetdir)/$$file ; \ - done - for file in cowthink ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) cowsay $(targetdir)/$$file ; \ - done - for file in rdict ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) dict $(targetdir)/$$file ; \ - done - for file in dpkg-deb dpkg-query dpkg-reconfigure ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) dpkg $(targetdir)/$$file ; \ - done - for file in etherwake ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ether-wake $(targetdir)/$$file ; \ - done - for file in mailsnarf msgsnarf ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) filesnarf $(targetdir)/$$file ; \ - done - for file in iceweasel mozilla-firefox ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) firefox $(targetdir)/$$file ; \ - done - for file in civclient freeciv-gtk2 freeciv-gtk3 freeciv-sdl \ - freeciv-xaw ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) freeciv $(targetdir)/$$file ; \ - done - for file in civserver ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) freeciv-server $(targetdir)/$$file ; \ - done - for file in declare typeset ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) function $(targetdir)/$$file ; \ - done - for file in cc c++ g++ g++-5 g++-6 g++-7 g++-8 gfortran gfortran-5 \ - gfortran-6 gfortran-7 gfortran-8 f77 g77 f95 g95 gcj gpc \ - gccgo gccgo-5 gccgo-6 gccgo-7 gccgo-8 gcc-5 gcc-6 gcc-7 \ - gcc-8 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gcc $(targetdir)/$$file ; \ - done - for file in mkisofs ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) genisoimage $(targetdir)/$$file ; \ - done - for file in geoiplookup6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) geoiplookup $(targetdir)/$$file ; \ - done - for file in gkrellm2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gkrellm $(targetdir)/$$file ; \ - done - for file in gpgv2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gpgv $(targetdir)/$$file ; \ - done - for file in pigz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gzip $(targetdir)/$$file ; \ - done - for file in sdptool l2ping rfcomm ciptool dfutool hciconfig \ - hciattach ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) hcitool $(targetdir)/$$file ; \ - done - for file in hd ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) _hexdump $(targetdir)/$$file ; \ - done - for file in hping hping3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) hping2 $(targetdir)/$$file ; \ - done - for file in ifdown ifquery ifstatus ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ifup $(targetdir)/$$file ; \ - done - for file in pinfo ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) info $(targetdir)/$$file ; \ - done - for file in insmod.static ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) insmod $(targetdir)/$$file ; \ - done - for file in iperf3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) iperf $(targetdir)/$$file ; \ - done - for file in javac javadoc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) java $(targetdir)/$$file ; \ - done - for file in arm-koji ppc-koji s390-koji sparc-koji ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) koji $(targetdir)/$$file ; \ - done - for file in ldapadd ldapmodify ldapdelete ldapcompare ldapmodrdn \ - ldapwhoami ldappasswd ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ldapsearch $(targetdir)/$$file ; \ - done - for file in links2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) links $(targetdir)/$$file ; \ - done - for file in lintian-info ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) lintian $(targetdir)/$$file ; \ - done - for file in lusermod ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) luseradd $(targetdir)/$$file ; \ - done - for file in lvmdiskscan pvscan pvs pvdisplay pvchange pvcreate pvmove \ - pvremove vgscan vgs vgdisplay vgchange vgremove vgrename \ - vgreduce vgextend vgimport vgexport vgck vgconvert vgcreate \ - vgcfgbackup vgcfgrestore vgmerge vgsplit vgmknodes lvscan lvs \ - lvdisplay lvchange lvcreate lvremove lvrename lvreduce \ - lvresize lvextend ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) lvm $(targetdir)/$$file ; \ - done - for file in lz4c ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) lz4 $(targetdir)/$$file ; \ - done - for file in clzip pdlzip plzip ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) lzip $(targetdir)/$$file ; \ - done - for file in colormake gmake gnumake pmake ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) make $(targetdir)/$$file ; \ - done - for file in apropos whatis ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) man $(targetdir)/$$file ; \ - done - for file in mdecrypt ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mcrypt $(targetdir)/$$file ; \ - done - for file in mplayer2 mencoder gmplayer kplayer ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mplayer $(targetdir)/$$file ; \ - done - for file in muttng ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mutt $(targetdir)/$$file ; \ - done - for file in host ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) nslookup $(targetdir)/$$file ; \ - done - for file in g4 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) p4 $(targetdir)/$$file ; \ - done - for file in perldoc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) perl $(targetdir)/$$file ; \ - done - for file in alpine ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pine $(targetdir)/$$file ; \ - done - for file in ping6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ping $(targetdir)/$$file ; \ - done - for file in pkg_info pkg_deinstall ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pkg_delete $(targetdir)/$$file ; \ - done - for file in pkill ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pgrep $(targetdir)/$$file ; \ - done - for file in pm-suspend pm-suspend-hybrid ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pm-hibernate $(targetdir)/$$file ; \ - done - for file in createdb createuser dropdb dropuser ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) psql $(targetdir)/$$file ; \ - done - for file in postalias ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) postmap $(targetdir)/$$file ; \ - done - for file in xpovray spovray ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) povray $(targetdir)/$$file ; \ - done - for file in puppetmasterd puppetd puppetca ralsh puppetrun puppetqd \ - filebucket puppetdoc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) puppet $(targetdir)/$$file ; \ - done - for file in pytest-2 pytest-3 py.test py.test-2 py.test-3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pytest $(targetdir)/$$file ; \ - done - for file in pydoc3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pydoc $(targetdir)/$$file ; \ - done - for file in pylint-2 pylint-3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pylint $(targetdir)/$$file ; \ - done - for file in pypy pypy3 python2 python3 micropython ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) python $(targetdir)/$$file ; \ - done - for file in pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 \ - pyvenv-3.8 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pyvenv $(targetdir)/$$file ; \ - done - for file in dcop ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) qdbus $(targetdir)/$$file ; \ - done - for file in qemu-kvm qemu-system-i386 qemu-system-x86_64 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) qemu $(targetdir)/$$file ; \ - done - for file in setquota edquota quotacheck repquota quotaon quotaoff ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) quota $(targetdir)/$$file ; \ - done - for file in ci co rlog rcsdiff ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rcs $(targetdir)/$$file ; \ - done - for file in rpmbuild rpmbuild-md5 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rpm $(targetdir)/$$file ; \ - done - for file in rpm2txz rpm2targz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rpm2tgz $(targetdir)/$$file ; \ - done - for file in smbget smbcacls smbcquotas smbpasswd smbtar smbtree ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) smbclient $(targetdir)/$$file ; \ - done - for file in sbcl-mt ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) sbcl $(targetdir)/$$file ; \ - done - for file in slogin autossh sftp scp sidedoor ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ssh $(targetdir)/$$file ; \ - done - for file in sudoedit ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) sudo $(targetdir)/$$file ; \ - done - for file in tracepath6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) tracepath $(targetdir)/$$file ; \ - done - for file in alternatives ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) update-alternatives $(targetdir)/$$file ; \ - done - for file in vigr ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) vipw $(targetdir)/$$file ; \ - done - for file in tightvncviewer xvnc4viewer ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) vncviewer $(targetdir)/$$file ; \ - done - for file in cdrecord ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) wodim $(targetdir)/$$file ; \ - done - for file in pxz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) xz $(targetdir)/$$file ; \ - done - for file in ypcat ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ypmatch $(targetdir)/$$file ; \ - done +symlinks: $(DATA) + $(ss) 7z \ + 7za + $(ss) aclocal \ + aclocal-1.10 aclocal-1.11 aclocal-1.12 aclocal-1.13 \ + aclocal-1.14 aclocal-1.15 aclocal-1.16 + $(ss) ant \ + phing + $(ss) aptitude \ + aptitude-curses + $(ss) asciidoc \ + asciidoc.py + $(ss) automake \ + automake-1.10 automake-1.11 automake-1.12 automake-1.13 \ + automake-1.14 automake-1.15 automake-1.16 + $(ss) autoreconf \ + autoheader + $(ss) autoscan \ + autoupdate + $(ss) avahi-browse \ + avahi-browse-domains + $(ss) btdownloadheadless.py \ + btdownloadcurses.py btdownloadgui.py + $(ss) bzip2 \ + lbzip2 pbzip2 + $(ss) _cal \ + ncal + $(ss) cardctl \ + pccardctl + $(ss) chromium-browser \ + chrome chromium google-chrome google-chrome-stable + $(ss) complete \ + compgen + $(ss) convert \ + animate compare composite conjure display identify import \ + mogrify montage stream + $(ss) cowsay \ + cowthink + $(ss) declare \ + typeset + $(ss) dict \ + rdict + $(ss) dpkg \ + dpkg-deb dpkg-query dpkg-reconfigure + $(ss) ether-wake \ + etherwake + $(ss) filesnarf \ + mailsnarf msgsnarf + $(ss) firefox \ + firefox-esr iceweasel mozilla-firefox + $(ss) freeciv \ + civclient freeciv-gtk2 freeciv-gtk3 freeciv-sdl freeciv-xaw + $(ss) freeciv-server \ + civserver + $(ss) gcc \ + c++ cc f77 f95 g++ g++-5 g++-6 g++-7 g++-8 g77 g95 gcc-5 \ + gcc-6 gcc-7 gcc-8 gccgo gccgo-5 gccgo-6 gccgo-7 gccgo-8 gcj \ + gfortran gfortran-5 gfortran-6 gfortran-7 gfortran-8 gpc + $(ss) genisoimage \ + mkisofs + $(ss) geoiplookup \ + geoiplookup6 + $(ss) gkrellm \ + gkrellm2 + $(ss) gpgv \ + gpgv2 + $(ss) gssdp-discover \ + gssdp-device-sniffer + $(ss) gzip \ + pigz + $(ss) hcitool \ + ciptool dfutool hciattach hciconfig l2ping rfcomm sdptool + $(ss) _hexdump \ + hd + $(ss) hping2 \ + hping hping3 + $(ss) ifup \ + ifdown ifquery ifstatus + $(ss) info \ + pinfo + $(ss) inotifywait \ + inotifywatch + $(ss) insmod \ + insmod.static + $(ss) iperf \ + iperf3 + $(ss) java \ + javac javadoc + $(ss) koji \ + arm-koji ppc-koji s390-koji sparc-koji + $(ss) ldapsearch \ + ldapadd ldapcompare ldapdelete ldapmodify ldapmodrdn \ + ldappasswd ldapwhoami + $(ss) links \ + links2 + $(ss) lintian \ + lintian-info + $(ss) lua \ + lua50 lua5.0 lua51 lua5.1 lua52 lua5.2 lua53 lua5.3 lua54 \ + lua5.4 + $(ss) luac \ + luac50 luac5.0 luac51 luac5.1 luac52 luac5.2 luac53 luac5.3 \ + luac54 luac5.4 + $(ss) luseradd \ + lusermod + $(ss) lvm \ + lvchange lvcreate lvdisplay lvextend lvmdiskscan lvreduce \ + lvremove lvrename lvresize lvs lvscan pvchange pvcreate \ + pvdisplay pvmove pvremove pvs pvscan vgcfgbackup vgcfgrestore \ + vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend \ + vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs \ + vgscan vgsplit + $(ss) lz4 \ + lz4c + $(ss) lzip \ + clzip pdlzip plzip + $(ss) make \ + bmake colormake gmake gnumake pmake + $(ss) man \ + apropos whatis + $(ss) mcrypt \ + mdecrypt + $(ss) mplayer \ + gmplayer kplayer mencoder mplayer2 + $(ss) mutt \ + muttng neomutt + $(ss) nslookup \ + host + $(ss) p4 \ + g4 + $(ss) perl \ + perldoc + $(ss) pine \ + alpine + $(ss) ping \ + ping6 + $(ss) pkg-config \ + pkgconf + $(ss) pkg_delete \ + pkg_deinstall pkg_info + $(ss) pgrep \ + pkill + $(ss) pm-hibernate \ + pm-suspend pm-suspend-hybrid + $(ss) psql \ + createdb createuser dropdb dropuser + $(ss) postmap \ + postalias + $(ss) povray \ + spovray xpovray + $(ss) puppet \ + filebucket puppetca puppetd puppetdoc puppetmasterd puppetqd \ + puppetrun ralsh + $(ss) pytest \ + py.test py.test-2 py.test-3 pytest-2 pytest-3 + $(ss) pydoc \ + pydoc3 + $(ss) pylint \ + pylint-2 pylint-3 + $(ss) python \ + micropython pypy pypy3 pyston pyston3 python2 python2.7 \ + python3 python3.3 python3.4 python3.5 python3.6 python3.7 \ + python3.8 python3.9 python3.10 python3.11 + $(ss) pyvenv \ + pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 pyvenv-3.8 \ + pyvenv-3.9 pyvenv-3.10 pyvenv-3.11 + $(ss) qdbus \ + dcop + $(ss) qemu \ + qemu-kvm qemu-system-i386 qemu-system-x86_64 + $(ss) quota \ + edquota quotacheck quotaoff quotaon repquota setquota + $(ss) rcs \ + ci co rcsdiff rlog + $(ss) rpm \ + rpmbuild rpmbuild-md5 + $(ss) rpm2tgz \ + rpm2targz rpm2txz + $(ss) smbclient \ + smbcacls smbcquotas smbget smbpasswd smbtar smbtree + $(ss) sbcl \ + sbcl-mt + $(ss) sha256sum \ + md5sum shasum sha1sum sha224sum sha384sum sha512sum + $(ss) ssh \ + autossh scp sftp sidedoor slogin + $(ss) sudo \ + sudoedit + $(ss) tar \ + bsdtar gtar star + $(ss) tracepath \ + tracepath6 + $(ss) update-alternatives \ + alternatives + $(ss) vipw \ + vigr + $(ss) vncviewer \ + tightvncviewer xvnc4viewer + $(ss) wine \ + wine-development wine-stable \ + wine64 wine64-development wine64-stable + $(ss) wodim \ + cdrecord + $(ss) xz \ + pxz + $(ss) ypmatch \ + ypcat .PHONY: symlinks -all-local: targetdir = . +SETUP_SYMLINKS = $(srcdir)/../setup-symlinks.sh + +all-local: ss = $(SETUP_SYMLINKS) . all-local: symlinks -install-data-hook: targetdir = $(DESTDIR)$(bashcompdir) +install-data-hook: ss = $(SETUP_SYMLINKS) $(DESTDIR)$(bashcompdir) install-data-hook: symlinks check-local: - ret=0 - for file in $(bashcomp_DATA) ; do \ + ret=0; \ + for file in $(bashcomp_DATA); do \ $${bashcomp_bash:-$${BASH:-bash}} \ - -O extglob -n $(srcdir)/$$file || ret=$$? ; \ - done ; \ + -O extglob -n $(srcdir)/$$file || ret=$$?; \ + done; \ exit $$ret diff --git a/completions/_adb b/completions/_adb new file mode 100644 index 00000000000..e1e19924465 --- /dev/null +++ b/completions/_adb @@ -0,0 +1,70 @@ +# adb completion -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# the Android SDK, use that instead. + +_adb_command_usage() +{ + COMPREPLY=($(compgen -W \ + '$("$1" help 2>&1 | command grep "^ *\(adb \)\? *$2 " \ + | command sed -e "s/[]|[]/\n/g" | _parse_help -)' -- "$cur")) +} + +_adb() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -s | -p | --algo | --key | --iv) + return + ;; + -f) + _filedir + return + ;; + esac + + local cmd i + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} != -* && ${words[i - 1]} != -[sp] ]]; then + cmd="${words[i]}" + break + fi + done + + if [[ ! -v cmd ]]; then + local tmp=() + if [[ ! $cur || $cur == -* ]]; then + tmp+=($(compgen -W '$(_parse_help "$1" help)' -- "$cur")) + fi + if [[ ! $cur || $cur != -* ]]; then + tmp+=($($1 help 2>&1 | awk '$1 == "adb" { print $2 }')) + tmp+=(devices connect disconnect sideload) + fi + ((${#tmp[@]})) && + COMPREPLY=($(compgen -W '"${tmp[@]}"' -- "$cur")) + return + fi + + # TODO: more and better command completions + + _adb_command_usage "$1" $cmd + + case $cmd in + push | restore | sideload) + _filedir + ;; + forward) + COMPREPLY=($(compgen -W \ + '$("$1" help 2>&1 | command sed -ne "s/^ *adb *forward *-/-/p" | \ + _parse_help -)' -- "$cur")) + ;; + reboot) + COMPREPLY=($(compgen -W 'bootloader recovery' -- "$cur")) + ;; + esac +} && + complete -F _adb adb + +# ex: filetype=sh diff --git a/completions/_cal b/completions/_cal index dfe49903cf1..cf80b2b7803 100644 --- a/completions/_cal +++ b/completions/_cal @@ -11,27 +11,29 @@ _cal() case $prev in -m) if [[ $OSTYPE == *bsd* ]]; then - COMPREPLY=( $( compgen -W '{1..12}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..12}' -- "$cur")) return fi ;; -s) [[ $OSTYPE == *bsd* ]] && return ;; - -A|-B|-d|-H) + -A | -B | -d | -H) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) return fi local args _count_args - [[ $args -eq 1 ]] && COMPREPLY=( $( compgen -W '{1..12}' -- "$cur" ) ) + ((args == 1)) && COMPREPLY=($(compgen -W '{1..12}' -- "$cur")) } && -complete -F _cal cal ncal + complete -F _cal cal ncal # ex: filetype=sh diff --git a/completions/_chsh b/completions/_chsh index 88e8522ed65..a6c8db3e8cb 100644 --- a/completions/_chsh +++ b/completions/_chsh @@ -1,30 +1,45 @@ # chsh(1) completion -*- shell-script -*- -# Use of this file is deprecated on Linux. Upstream completion is -# available in util-linux >= 2.23, use that instead. +# Use of this file is deprecated on Linux systems whose chsh is from +# util-linux. Upstream completion is in util-linux >= 2.23, use that instead. _chsh() { local cur prev words cword _init_completion || return + local word chroot + for word in "${words[@]}"; do + if [[ -v chroot ]]; then + chroot=$word + break + fi + [[ $word != -@(R|-root) ]] || chroot= + done + case $prev in - --list-shells|--help|-v|--version) + --list-shells | --help | -v | --version) + return + ;; + -R | --root) + _filedir -d return ;; - -s|--shell) - _shells + -s | --shell) + _shells "${chroot-}" return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) else _allowed_users fi } && -complete -F _chsh chsh + complete -F _chsh chsh # ex: filetype=sh diff --git a/completions/_dmesg b/completions/_dmesg index 2ca7fdf17bd..2d5530c4b1f 100644 --- a/completions/_dmesg +++ b/completions/_dmesg @@ -11,24 +11,24 @@ _dmesg() _init_completion || return case $prev in - -h|--help|-V|--version|-s|--buffer-size|-M|-N) + -h | --help | -V | --version | -s | --buffer-size | -M | -N) return ;; - -f|--facility) - COMPREPLY=( $( compgen -W 'kern user mail daemon auth syslog lpr - news' -- "$cur" ) ) + -f | --facility) + COMPREPLY=($(compgen -W 'kern user mail daemon auth syslog lpr + news' -- "$cur")) return ;; - -l|--level|-n|--console-level) - COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) + -l | --level | -n | --console-level) + COMPREPLY=($(compgen -W '{1..8}' -- "$cur")) return ;; esac - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) } && -complete -F _dmesg dmesg + complete -F _dmesg dmesg # ex: filetype=sh diff --git a/completions/_eject b/completions/_eject index 8f800f15591..52168f741b3 100644 --- a/completions/_eject +++ b/completions/_eject @@ -9,17 +9,17 @@ _eject() _init_completion || return case $prev in - -h|--help|-V|--version|-c|--changerslot|-x|--cdspeed) + -h | --help | -V | --version | -c | --changerslot | -x | --cdspeed) return ;; - -a|--auto|-i|--manualeject) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + -a | --auto | -i | --manualeject) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return elif [[ $prev == @(-d|--default) ]]; then return @@ -28,6 +28,6 @@ _eject() _cd_devices _dvd_devices } && -complete -F _eject eject + complete -F _eject eject # ex: filetype=sh diff --git a/completions/_hexdump b/completions/_hexdump index ed5cb08b6c6..a8226e15f70 100644 --- a/completions/_hexdump +++ b/completions/_hexdump @@ -9,7 +9,7 @@ _hexdump() _init_completion || return case $prev in - -V|-e|-n|-s) + -V | -e | -n | -s) return ;; -f) @@ -19,14 +19,14 @@ _hexdump() esac if [[ $cur == -* ]]; then - local opts="$( _parse_help "$1" )" - [[ $opts ]] || opts="$( _parse_usage "$1" )" - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) return fi _filedir } && -complete -F _hexdump hexdump hd + complete -F _hexdump hexdump hd # ex: filetype=sh diff --git a/completions/_hwclock b/completions/_hwclock index 2d190283dc9..ef437a26e7a 100644 --- a/completions/_hwclock +++ b/completions/_hwclock @@ -9,18 +9,18 @@ _hwclock() _init_completion || return case $prev in - -h|--help|-V|--version|--date|--epoch) + -h | --help | -V | --version | --date | --epoch) return ;; - -f|--rtc|--adjfile) + -f | --rtc | --adjfile) _filedir return ;; esac COMPREPLY=( - $( PATH="$PATH:/sbin" compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + $(PATH="$PATH:/sbin" compgen -W '$(_parse_help "$1")' -- "$cur")) } && -complete -F _hwclock hwclock + complete -F _hwclock hwclock # ex: filetype=sh diff --git a/completions/_ionice b/completions/_ionice index 9b378ee8a5c..b0d96a13a77 100644 --- a/completions/_ionice +++ b/completions/_ionice @@ -9,7 +9,7 @@ _ionice() _init_completion || return local offset=0 i - for (( i=1; i <= cword; i++ )); do + for ((i = 1; i <= cword; i++)); do case ${words[i]} in -h) return @@ -18,8 +18,8 @@ _ionice() offset=0 break ;; - -c|-n) - (( i++ )) + -c | -n) + ((i++)) continue ;; -*) @@ -30,18 +30,18 @@ _ionice() break done - if [[ $offset -gt 0 ]]; then + if ((offset > 0)); then _command_offset $offset return fi case $prev in -c) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) return ;; -n) - COMPREPLY=( $( compgen -W '{0..7}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..7}' -- "$cur")) return ;; -p) @@ -51,10 +51,10 @@ _ionice() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) return fi } && -complete -F _ionice ionice + complete -F _ionice ionice # ex: filetype=sh diff --git a/completions/_look b/completions/_look index 6ea41cce0e9..9788dec5a06 100644 --- a/completions/_look +++ b/completions/_look @@ -8,10 +8,10 @@ _look() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur")) fi } && -complete -F _look -o default look + complete -F _look -o default look # ex: filetype=sh diff --git a/completions/_mock b/completions/_mock index 9649d306e1e..b468148d16b 100644 --- a/completions/_mock +++ b/completions/_mock @@ -11,27 +11,27 @@ _mock() local plugins='tmpfs root_cache yum_cache bind_mount ccache' local cfgdir=/etc/mock count=0 i - for i in "${words[@]}" ; do - [[ $count -eq $cword ]] && break - if [[ "$i" == --configdir ]] ; then - cfgdir="${words[((count+1))]}" - elif [[ "$i" == --configdir=* ]] ; then + for i in "${words[@]}"; do + ((count == cword)) && break + if [[ $i == --configdir ]]; then + cfgdir="${words[count + 1]}" + elif [[ $i == --configdir=* ]]; then cfgdir=${i/*=/} fi - count=$((++count)) + ((count++)) done case $prev in - -h|--help|--copyin|--copyout|--arch|-D|--define|--with|--without|\ - --uniqueext|--rpmbuild_timeout|--sources|--cwd) + -h | --help | --copyin | --copyout | --arch | -D | --define | --with | --without | \ + --uniqueext | --rpmbuild_timeout | --sources | --cwd) return ;; - -r|--root) - COMPREPLY=( $( compgen -W "$( command ls $cfgdir )" -- "$cur" ) ) - COMPREPLY=( ${COMPREPLY[@]/%.cfg/} ) + -r | --root) + COMPREPLY=($(compgen -W "$(command ls $cfgdir)" -- "$cur")) + COMPREPLY=(${COMPREPLY[@]/%.cfg/}) return ;; - --configdir|--resultdir) + --configdir | --resultdir) _filedir -d return ;; @@ -44,26 +44,26 @@ _mock() # (e.g. ix86 chroot builds in x86_64 mock host) # This would actually depend on what the target root # can be used to build for... - COMPREPLY=( $( compgen -W "$( command rpm --showrc | \ - command sed -ne 's/^\s*compatible\s\s*archs\s*:\s*\(.*\)/\1/i p' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(command rpm --showrc | + command sed -ne 's/^\s*compatible\s\s*archs\s*:\s*\(.*\)/\1/i p')" \ + -- "$cur")) return ;; - --enable-plugin|--disable-plugin) - COMPREPLY=( $( compgen -W "$plugins" -- "$cur" ) ) + --enable-plugin | --disable-plugin) + COMPREPLY=($(compgen -W "$plugins" -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _filedir '@(?(no)src.r|s)pm' fi } && -complete -F _mock mock + complete -F _mock mock # ex: filetype=sh diff --git a/completions/_modules b/completions/_modules index 9e48589b640..0f79c23398d 100644 --- a/completions/_modules +++ b/completions/_modules @@ -5,8 +5,8 @@ # # Completion for Environment Modules `module' alias. # -# See http://sourceforge.net/projects/modules/ -# http://modules.sourceforge.net/ +# See https://sourceforge.net/projects/modules/ +# https://modules.sourceforge.net/ # # There are several versions of modules that are commonly used. Older # Cray UNICOS systems and many other sites use 2.2.2b. The latest GPL'd @@ -19,66 +19,67 @@ # Test for existence of /etc/profile.d/modules.sh too because we may end up # being sourced before it and thus before the `module' alias has been defined. -[ -f /etc/profile.d/modules.sh ] || return 1 +[[ -f /etc/profile.d/modules.sh ]] || return 1 -_module_list () +_module_list() { - local modules="$( command sed 's/:/ /g' <<<$LOADEDMODULES | sort )" + local modules="$(command sed 's/:/ /g' <<<$LOADEDMODULES | sort)" compgen -W "$modules" -- $1 } -_module_path () +_module_path() { - local modules="$( command sed 's/:/ /g' <<<$MODULEPATH | sort )" + local modules="$(command sed 's/:/ /g' <<<$MODULEPATH | sort)" compgen -W "$modules" -- $1 } -_module_avail () +_module_avail() { - local modules="$( \ - module avail 2>&1 | \ - command grep -E -v '^(-|$)' | \ - xargs printf '%s\n' | command sed -e 's/(default)//g' | sort )" + local modules="$( + module avail 2>&1 | + command grep -E -v '^(-|$)' | + xargs printf '%s\n' | command sed -e 's/(default)//g' | sort + )" compgen -W "$modules" -- $1 } # A completion function for the module alias -_module () +_module() { local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then + if ((cword == 1)); then # First parameter on line -- we expect it to be a mode selection local options - options="$( module help 2>&1 | command grep -E '^[[:space:]]*\+' | \ - awk '{print $2}' | command sed -e 's/|/ /g' | sort )" + options="$(module help 2>&1 | command grep -E '^[[:space:]]*\+' | + awk '{print $2}' | command sed -e 's/|/ /g' | sort)" - COMPREPLY=( $(compgen -W "$options" -- "$cur") ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) - elif [[ $cword -eq 2 ]]; then + elif ((cword == 2)); then case $prev in - add|display|help|load|show|whatis) - COMPREPLY=( $(_module_avail "$cur") ) + add | display | help | load | show | whatis) + COMPREPLY=($(_module_avail "$cur")) ;; - rm|switch|swap|unload|update) - COMPREPLY=( $(_module_list "$cur") ) + rm | switch | swap | unload | update) + COMPREPLY=($(_module_list "$cur")) ;; unuse) - COMPREPLY=( $(_module_path "$cur") ) + COMPREPLY=($(_module_path "$cur")) ;; esac - elif [[ $cword -eq 3 ]]; then + elif ((cword == 3)); then case ${words[1]} in - swap|switch) - COMPREPLY=( $(_module_avail "$cur") ) + swap | switch) + COMPREPLY=($(_module_avail "$cur")) ;; esac fi } && -complete -F _module -o default module + complete -F _module -o default module # ex: filetype=sh diff --git a/completions/_mount b/completions/_mount index ecd619f5a75..ca5df25b3d4 100644 --- a/completions/_mount +++ b/completions/_mount @@ -22,44 +22,44 @@ _mount() local sm host case $prev in - -t|--types) + -t | --types) _fstypes return ;; esac - [[ "$cur" == \\ ]] && cur="/" + [[ $cur == \\ ]] && cur="/" - if [[ "$cur" == *:* ]]; then + if [[ $cur == *:* ]]; then for sm in "$(type -P showmount)" {,/usr}/{,s}bin/showmount; do [[ -x $sm ]] || continue - COMPREPLY=( $( compgen -W "$( "$sm" -e ${cur%%:*} | \ - awk 'NR>1 {print $1}' )" -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W "$("$sm" -e ${cur%%:*} | + awk 'NR>1 {print $1}')" -- "${cur#*:}")) return done fi - if [[ "$cur" == //* ]]; then + if [[ $cur == //* ]]; then host=${cur#//} host=${host%%/*} if [[ -n $host ]]; then - COMPREPLY=( $( compgen -P "//$host" -W \ - "$( smbclient -d 0 -NL $host 2>/dev/null | - command sed -ne '/^[[:blank:]]*Sharename/,/^$/p' | - command sed -ne '3,$s|^[^A-Za-z]*\([^[:blank:]]*\).*$|/\1|p' )" \ - -- "${cur#//$host}" ) ) + COMPREPLY=($(compgen -P "//$host" -W \ + "$(smbclient -d 0 -NL $host 2>/dev/null | + command sed -ne '/^[[:blank:]]*Sharename/,/^$/p' | + command sed -ne '3,$s|^[^A-Za-z]*\([^[:blank:]]*\).*$|/\1|p')" \ + -- "${cur#//"$host"}")) fi elif [[ -r /etc/vfstab ]]; then # Solaris - COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab)" -- "$cur")) elif [[ ! -e /etc/fstab ]]; then # probably Cygwin - COMPREPLY=( $( compgen -W "$( $1 | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}')" -- "$cur")) else # probably BSD - COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /etc/fstab )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /etc/fstab)" -- "$cur")) fi } && -complete -F _mount -o default -o dirnames mount + complete -F _mount -o default -o dirnames mount # ex: filetype=sh diff --git a/completions/_mount.linux b/completions/_mount.linux index a8f0bf0e4cb..39100bb55e2 100644 --- a/completions/_mount.linux +++ b/completions/_mount.linux @@ -10,239 +10,243 @@ _mount() local split=false case "$prev" in - -t|--types) + -t | --types) # find /lib/modules/$(uname -r)/ -type f -path '*/fs/*.ko' -printf '%f\n' | cut -d. -f1 # FIXME: no - if [[ "$cur" == ?*,* ]]; then + if [[ $cur == ?*,* ]]; then prev="${cur%,*}" cur="${cur##*,}" split=true fi - COMPREPLY=( $( compgen -W 'auto adfs affs autofs btrfs cifs coda + COMPREPLY=($(compgen -W 'auto adfs affs autofs btrfs cifs coda cramfs davfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus hpfs iso9660 jffs2 jfs minix msdos ncpfs nfs nfs4 ntfs ntfs-3g proc qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs - udf ufs umsdos usbfs vfat xfs' -- "$cur" ) ) + udf ufs umsdos usbfs vfat xfs' -- "$cur")) _fstypes - $split && COMPREPLY=( ${COMPREPLY[@]/#/$prev,} ) + $split && COMPREPLY=(${COMPREPLY[@]/#/$prev,}) return ;; - --bind|-B|--rbind|-R) + --bind | -B | --rbind | -R) _filedir -d return ;; - -p|--pass-fd) - COMPREPLY=( $(compgen -W '{0..9}') ) + -p | --pass-fd) + COMPREPLY=($(compgen -W '{0..9}')) compopt -o nospace return ;; -L) - COMPREPLY=( $( cd "/dev/disk/by-label/" 2>/dev/null || return; \ - compgen -f -- "$cur" ) ) + COMPREPLY=($( + command cd "/dev/disk/by-label/" 2>/dev/null || return + compgen -f -- "$cur" + )) return ;; -U) - COMPREPLY=( $( cd "/dev/disk/by-uuid/" 2>/dev/null || return; \ - compgen -f -- "$cur" ) ) + COMPREPLY=($( + command cd "/dev/disk/by-uuid/" 2>/dev/null || return + compgen -f -- "$cur" + )) return ;; - -O|--test-opts) + -O | --test-opts) # argument required but no completions available return ;; - -o|--options) + -o | --options) local fstype=auto # default fstype - for (( i=${#words[@]}-1; i>0; i-- )); do - if [[ "${words[i]}" == -@(t|-types)* ]]; then - if [[ "${words[i]}" == *=* ]]; then - [[ "${words[i]}" == ?*,* ]] && break + for ((i = ${#words[@]} - 1; i > 0; i--)); do + if [[ ${words[i]} == -@(t|-types)* ]]; then + if [[ ${words[i]} == *=* ]]; then + [[ ${words[i]} == ?*,* ]] && break fstype="${words[i]#-*=}" else - [[ "${words[i+1]}" == ?*,* ]] && break - fstype="${words[i+1]}" + [[ ${words[i + 1]} == ?*,* ]] && break + fstype="${words[i + 1]}" fi break fi done # no is not a real fstype, reset to "auto" - [[ "$fstype" == no?* ]] && fstype=auto + [[ $fstype == no?* ]] && fstype=auto # split options list - if [[ "$cur" == ?*,* ]]; then + if [[ $cur == ?*,* ]]; then prev="${cur%,*}" cur="${cur##*,}" split=true fi # no completion if $cur is opt=smth - [[ "$cur" == *=* ]] && return + [[ $cur == *=* ]] && return # mount options - COMPREPLY=( $(compgen -W 'loop {,a}sync {,no}atime {,no}auto + COMPREPLY=($(compgen -W 'loop {,a}sync {,no}atime {,no}auto {,fs,def,root}context= defaults {,no}dev {,no}diratime dirsync {,no}exec group {,no}iversion {,no}mand _netdev nofail {,no}relatime {,no}strictatime {,no}suid owner remount ro rw - {,no}user users' -- "$cur") ) + {,no}user users' -- "$cur")) case "$fstype" in - adfs|auto) - COMPREPLY+=( $(compgen -W '{u,g}id= {own,oth}mask=' -- "$cur") ) - ;;& - affs|auto) - COMPREPLY+=( $(compgen -W '{u,g}id= set{u,g}id= mode= protect + adfs | auto) + COMPREPLY+=($(compgen -W '{u,g}id= {own,oth}mask=' -- "$cur")) + ;;& + affs | auto) + COMPREPLY+=($(compgen -W '{u,g}id= set{u,g}id= mode= protect usemp verbose prefix= volume= reserved= root= bs= - {,no,usr,grp}quota' -- "$cur") ) - ;;& - btrfs|auto) - COMPREPLY+=( $(compgen -W 'degraded subvol= subvolid= device= + {,no,usr,grp}quota' -- "$cur")) + ;;& + btrfs | auto) + COMPREPLY+=($(compgen -W 'degraded subvol= subvolid= device= nodatasum nodatacow nobarrier max_inline= alloc_start= thread_pool= compress= compress-force= ssd noacl notreelog flushoncommit metadata_ratio= {,no}space_cache clear_cache - user_subvol_rm_allowed autodefrag inode_cache' -- "$cur") ) - ;;& - cifs|auto) - COMPREPLY+=( $(compgen -W 'user= password= credentials= {u,g}id= + user_subvol_rm_allowed autodefrag inode_cache' -- "$cur")) + ;;& + cifs | auto) + COMPREPLY+=($(compgen -W 'user= password= credentials= {u,g}id= force{u,g}id port= servern= netbiosname= {file,dir}_mode= ip= domain= guest iocharset {,no}setuids {,no,dyn}perm directio {,no}mapchars {,no}intr hard soft noacl nocase sec= nobrl sfu {,no}serverino nounix nouser_xattr {r,w}size= - rwpidforward backup{u,g}id cache=' -- "$cur") ) - ;;& - davfs|auto) - COMPREPLY+=( $(compgen -W 'conf= {file,dir}_mode= {u,g}id= - username=' -- "$cur") ) - ;;& - ext[2-4]|auto) - COMPREPLY+=( $(compgen -W '{,no}acl bsddf minixdf check= debug + rwpidforward backup{u,g}id cache=' -- "$cur")) + ;;& + davfs | auto) + COMPREPLY+=($(compgen -W 'conf= {file,dir}_mode= {u,g}id= + username=' -- "$cur")) + ;;& + ext[2-4] | auto) + COMPREPLY+=($(compgen -W '{,no}acl bsddf minixdf check= debug errors= {,no}grpid {bsd,sysv}groups {,no,usr,grp}quota nobh nouid32 oldalloc orlov res{u,g}id= sb= - {,no}user_xattr' -- "$cur") ) - ;;& - ext[34]|auto) - COMPREPLY+=( $(compgen -W 'journal= journal_dev= norecovery - noload data= barrier= commit=' -- "$cur") ) - ;;& - ext4|auto) - COMPREPLY+=( $(compgen -W 'journal_checksum journal_async_commit + {,no}user_xattr' -- "$cur")) + ;;& + ext[34] | auto) + COMPREPLY+=($(compgen -W 'journal= journal_dev= norecovery + noload data= barrier= commit=' -- "$cur")) + ;;& + ext4 | auto) + COMPREPLY+=($(compgen -W 'journal_checksum journal_async_commit nobarrier inode_readahead= stripe= {,no}delalloc abort {max,min}_batch_time= journal_ioprio= {,no}auto_da_alloc {,no}discard nouid32 resize {,no}block_validity - dioread_{,no}lock max_dir_size_kb= i_version' -- "$cur") ) - ;;& - msdos|umsdos|vfat|auto) - COMPREPLY+=( $(compgen -W 'blocksize= {u,g}id= {u,d,f}mask= + dioread_{,no}lock max_dir_size_kb= i_version' -- "$cur")) + ;;& + msdos | umsdos | vfat | auto) + COMPREPLY+=($(compgen -W 'blocksize= {u,g}id= {u,d,f}mask= allow_utime= check= codepage= conv= cvf_format= cvf_option= debug fat= iocharset= tz= quiet showexec sys_immutable flush - usefree {,no}dots dotsOK=' -- "$cur") ) - ;;& - vfat|auto) - COMPREPLY+=( $(compgen -W 'uni_xlate posix nonumtail utf8 - shortname=' -- "$cur") ) - ;;& - iso9660|auto) - COMPREPLY+=( $(compgen -W 'norock nojoliet check= {u,g}id= map= + usefree {,no}dots dotsOK=' -- "$cur")) + ;;& + vfat | auto) + COMPREPLY+=($(compgen -W 'uni_xlate posix nonumtail utf8 + shortname=' -- "$cur")) + ;;& + iso9660 | auto) + COMPREPLY+=($(compgen -W 'norock nojoliet check= {u,g}id= map= mode= unhide block= conv= cruft session= sbsector= - iocharset= utf8' -- "$cur") ) - ;;& - jffs2|auto) - COMPREPLY+=( $(compgen -W 'compr= rp_size=' -- "$cur") ) - ;;& - jfs|auto) - COMPREPLY+=( $(compgen -W 'iocharset= resize= {,no}integrity - errors= {,no,usr,grp}quota' -- "$cur") ) - ;;& - nfs|nfs4|auto) - COMPREPLY+=( $(compgen -W 'soft hard timeo= retrans= {r,w}size= + iocharset= utf8' -- "$cur")) + ;;& + jffs2 | auto) + COMPREPLY+=($(compgen -W 'compr= rp_size=' -- "$cur")) + ;;& + jfs | auto) + COMPREPLY+=($(compgen -W 'iocharset= resize= {,no}integrity + errors= {,no,usr,grp}quota' -- "$cur")) + ;;& + nfs | nfs4 | auto) + COMPREPLY+=($(compgen -W 'soft hard timeo= retrans= {r,w}size= {,no}ac acreg{min,max}= acdir{min,max}= actimeo= bg fg retry= sec= {,no}sharecache {,no}resvport lookupcache= - proto= port= {,no}intr {,no}cto {,nfs}vers= ' -- "$cur") ) - ;;& - nfs|auto) - COMPREPLY+=( $(compgen -W 'udp tcp rdma mount{port,proto,host}= + proto= port= {,no}intr {,no}cto {,nfs}vers= ' -- "$cur")) + ;;& + nfs | auto) + COMPREPLY+=($(compgen -W 'udp tcp rdma mount{port,proto,host}= mountvers= namlen={,no}lock {,no}acl {,no}rdirplus - {,no}fsc' -- "$cur") ) - ;;& - nfs4|auto) - COMPREPLY+=( $(compgen -W 'clientaddr= {,no}migration' \ - -- "$cur") ) - ;;& - ntfs-3g) - COMPREPLY+=( $(compgen -W '{u,g}id= {u,f,d}mask= usermapping= + {,no}fsc' -- "$cur")) + ;;& + nfs4 | auto) + COMPREPLY+=($(compgen -W 'clientaddr= {,no}migration' \ + -- "$cur")) + ;;& + ntfs-3g) + COMPREPLY+=($(compgen -W '{u,g}id= {u,f,d}mask= usermapping= permissions inherit locale= force {,no}recover ignore_case remove_hiberfile show_sys_files hide_{hid,dot}_files windows_names allow_other max_read= silent no_def_opts streams_interface= user_xattr efs_raw - {,no}compression debug no_detach' -- "$cur") ) - ;;& - proc|auto) - COMPREPLY+=( $(compgen -W '{u,g}id=' -- "$cur") ) - ;;& - reiserfs|auto) - COMPREPLY+=( $(compgen -W 'conv hash= {,no_un}hashed_relocation + {,no}compression debug no_detach' -- "$cur")) + ;;& + proc | auto) + COMPREPLY+=($(compgen -W '{u,g}id=' -- "$cur")) + ;;& + reiserfs | auto) + COMPREPLY+=($(compgen -W 'conv hash= {,no_un}hashed_relocation noborder nolog notail replayonly resize= user_xattr acl - barrier=' -- "$cur") ) - ;;& - tmpfs|auto) - COMPREPLY+=( $(compgen -W 'size= nr_blocks= nr_inodes= mode= - {u,g}id= mpol=' -- "$cur") ) - ;;& - udf|auto) - COMPREPLY+=( $(compgen -W '{u,g}id= umask= unhide undelete + barrier=' -- "$cur")) + ;;& + tmpfs | auto) + COMPREPLY+=($(compgen -W 'size= nr_blocks= nr_inodes= mode= + {u,g}id= mpol=' -- "$cur")) + ;;& + udf | auto) + COMPREPLY+=($(compgen -W '{u,g}id= umask= unhide undelete nostrict iocharset bs= novrs session= anchor= volume= - partition= lastblock= fileset= rootdir=' -- "$cur") ) - ;;& - usbfs|auto) - COMPREPLY+=( $(compgen -W 'dev{u,g}id= devmode= bus{u,g}id= - busmode= list{u,g}id= listmode=' -- "$cur") ) - ;;& - xfs|auto) - COMPREPLY+=( $(compgen -W 'allocsize= {,no}attr2 barrier dmapi + partition= lastblock= fileset= rootdir=' -- "$cur")) + ;;& + usbfs | auto) + COMPREPLY+=($(compgen -W 'dev{u,g}id= devmode= bus{u,g}id= + busmode= list{u,g}id= listmode=' -- "$cur")) + ;;& + xfs | auto) + COMPREPLY+=($(compgen -W 'allocsize= {,no}attr2 barrier dmapi {,no}grpid {bsd,sysv}groups ihashsize= {,no}ikeep inode{32,64} {,no}largeio logbufs= logbsize= logdev= rtdev= mtpt= noalign norecovery nouuid osyncisosync {u,g,p}qnoenforce {,u,usr,g,grp,p,prj}quota sunit= swidth= - swalloc' -- "$cur") ) - ;;& + swalloc' -- "$cur")) + ;;& esac # COMP_WORDBREAKS is a real pain in the ass - prev="${prev##*[$COMP_WORDBREAKS]}" - $split && COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + prev="${prev##*["$COMP_WORDBREAKS"]}" + $split && COMPREPLY=(${COMPREPLY[@]/#/"$prev,"}) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version --help --verbose --all --fork + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--version --help --verbose --all --fork --fake --internal-only -l --no-mtab --no-canonicalize --pass-fd -s --read-only --rw -L -U --types --test-opts --options --bind --rbind - --move' -- "$cur" ) ) - [[ $COMPREPLY ]] && return + --move' -- "$cur")) + [[ ${COMPREPLY-} ]] && return fi - [[ "$cur" == \\ ]] && cur="/" + [[ $cur == \\ ]] && cur="/" local sm host - if [[ "$cur" == *:* ]]; then + if [[ $cur == *:* ]]; then for sm in "$(type -P showmount)" {,/usr}/{,s}bin/showmount; do [[ -x $sm ]] || continue - COMPREPLY=( $( compgen -W "$( "$sm" -e ${cur%%:*} | \ - awk 'NR>1 {print $1}' )" -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W "$("$sm" -e ${cur%%:*} | + awk 'NR>1 {print $1}')" -- "${cur#*:}")) return done fi - if [[ "$cur" == //* ]]; then + if [[ $cur == //* ]]; then host=${cur#//} host=${host%%/*} if [[ -n $host ]]; then - COMPREPLY=( $( compgen -P "//$host" -W \ - "$( smbclient -d 0 -NL $host 2>/dev/null | - command sed -ne '/^[[:blank:]]*Sharename/,/^$/p' | - command sed -ne '3,$s|^[^A-Za-z]*\([^[:blank:]]*\).*$|/\1|p' )" \ - -- "${cur#//$host}" ) ) + COMPREPLY=($(compgen -P "//$host" -W \ + "$(smbclient -d 0 -NL $host 2>/dev/null | + command sed -ne '/^[[:blank:]]*Sharename/,/^$/p' | + command sed -ne '3,$s|^[^A-Za-z]*\([^[:blank:]]*\).*$|/\1|p')" \ + -- "${cur#//"$host"}")) fi fi _filedir } && -complete -F _mount mount + complete -F _mount mount # ex: filetype=sh diff --git a/completions/_newgrp b/completions/_newgrp index 0f0d3f937fe..a2dc3edaed6 100644 --- a/completions/_newgrp +++ b/completions/_newgrp @@ -8,12 +8,12 @@ _newgrp() local cur prev words cword _init_completion || return - if [[ "$cur" == "-" ]]; then - COMPREPLY=( - ) + if [[ $cur == "-" ]]; then + COMPREPLY=(-) else _allowed_groups "$cur" fi } && -complete -F _newgrp newgrp + complete -F _newgrp newgrp # ex: filetype=sh diff --git a/completions/_nmcli b/completions/_nmcli index f77f050583f..eac285b08b2 100644 --- a/completions/_nmcli +++ b/completions/_nmcli @@ -5,33 +5,33 @@ _nmcli_list() { - COMPREPLY=( $( compgen -W '$1' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$1' -- "$cur")) } _nmcli_con_id() { local IFS=$'\n' - COMPREPLY=( $( compgen -W "$(nmcli con list 2>/dev/null | \ - tail -n +2 | awk -F ' {2,}' '{print $1 }')" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(nmcli con list 2>/dev/null | + tail -n +2 | awk -F ' {2,}' '{print $1 }')" -- "$cur")) } _nmcli_con_uuid() { - COMPREPLY=( $( compgen -W "$(nmcli con list 2>/dev/null | \ - tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(nmcli con list 2>/dev/null | + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur")) } _nmcli_ap_ssid() { local IFS=$'\n' - COMPREPLY=( $( compgen -W "$(nmcli dev wifi list 2>/dev/null | \ - tail -n +2 | awk -F ' {2,}' '{print $1}')" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(nmcli dev wifi list 2>/dev/null | + tail -n +2 | awk -F ' {2,}' '{print $1}')" -- "$cur")) } _nmcli_ab_bssid() { - COMPREPLY=( $( compgen -W "$(nmcli dev wifi list 2>/dev/null | \ - tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(nmcli dev wifi list 2>/dev/null | + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur")) } _nmcli() @@ -40,15 +40,15 @@ _nmcli() _init_completion || return case $prev in - -m|--mode) - COMPREPLY=( $( compgen -W 'tabular multiline' -- "$cur" ) ) + -m | --mode) + COMPREPLY=($(compgen -W 'tabular multiline' -- "$cur")) return ;; - -f|--fields) - COMPREPLY=( $( compgen -W 'all common' -- "$cur" ) ) + -f | --fields) + COMPREPLY=($(compgen -W 'all common' -- "$cur")) return ;; - -e|--escape) + -e | --escape) _nmcli_list "yes no" return ;; @@ -74,12 +74,12 @@ _nmcli() ;; esac - if [[ $cword -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--terse --pretty --mode --fields - --escape --version --help' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--terse --pretty --mode --fields + --escape --version --help' -- "$cur")) else - COMPREPLY=( $( compgen -W "nm con dev" -- "$cur" ) ) + COMPREPLY=($(compgen -W "nm con dev" -- "$cur")) fi else local object=${words[1]} @@ -110,50 +110,50 @@ _nmcli() ;; esac - COMPREPLY=( $( compgen -W 'status permissions enable sleep - wifi wwan wimax' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'status permissions enable sleep + wifi wwan wimax' -- "$cur")) ;; con) case $command in list) - COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'id uuid' -- "$cur")) return ;; up) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--nowait --timeout' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--nowait --timeout' \ + -- "$cur")) else - COMPREPLY=( $( compgen -W 'id uuid iface ap nsp' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'id uuid iface ap nsp' \ + -- "$cur")) fi return ;; down) - COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'id uuid' -- "$cur")) return ;; delete) - COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'id uuid' -- "$cur")) return ;; esac - COMPREPLY=( $( compgen -W 'list status up down delete' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'list status up down delete' \ + -- "$cur")) ;; dev) case $command in list) - COMPREPLY=( $( compgen -W 'iface' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'iface' -- "$cur")) return ;; disconnect) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--nowait --timeout' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--nowait --timeout' \ + -- "$cur")) else - COMPREPLY=( $( compgen -W 'iface' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'iface' -- "$cur")) fi return ;; @@ -162,40 +162,40 @@ _nmcli() case $subcommand in list) - COMPREPLY=( $( compgen -W 'iface bssid' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'iface bssid' \ + -- "$cur")) return ;; connect) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--private - --nowait --timeout' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--private + --nowait --timeout' -- "$cur")) else - if [[ "$prev" == "connect" ]]; then + if [[ $prev == "connect" ]]; then _nmcli_ap_ssid else - COMPREPLY=( $( compgen -W 'password + COMPREPLY=($(compgen -W 'password wep-key-type iface bssid name' \ - -- "$cur" ) ) + -- "$cur")) fi fi return ;; esac - COMPREPLY=( $( compgen -W 'list connect' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'list connect' -- "$cur")) return ;; esac - COMPREPLY=( $( compgen -W 'status list disconnect wifi' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'status list disconnect wifi' \ + -- "$cur")) ;; esac fi } && -complete -F _nmcli nmcli + complete -F _nmcli nmcli # ex: filetype=sh diff --git a/completions/_op b/completions/_op new file mode 100644 index 00000000000..0565cfd0402 --- /dev/null +++ b/completions/_op @@ -0,0 +1,62 @@ +# op (1Password CLI) completion -*- shell-script -*- + +# Use of this file is deprecated. Upstream op >= 1.2.0 can output a completion +# for itself using "op completion", use that instead. + +_op_commands() +{ + "$@" --help 2>/dev/null | + awk '/^(Available |Sub)commands/{flag=1;next}/^ /&&flag{print $1}' +} + +_op_command_options() +{ + case $cur in + -*) + for i in "${!words[@]}"; do + [[ ${words[i]} == -* || $i -eq 0 ]] && unset -v 'words[i]' + done + COMPREPLY=($(compgen -W \ + '$(_parse_usage "$1" "${words[*]} --help") --help' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + return 0 + ;; + esac + return 1 +} + +_op() +{ + local cur prev words cword split + _init_completion -s || return + + local command i + for ((i = 1; i < cword; i++)); do + case ${words[i]} in + --help | --version) return ;; + -*) ;; + *) + command=${words[i]} + break + ;; + esac + done + + if [[ ! -v command && $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + return + fi + + [[ -v command ]] && _op_command_options "$1" && return + + if [[ ! -v command || $command == "$prev" ]]; then + COMPREPLY=($(compgen -W '$(_op_commands "$1" ${command-})' -- "$cur")) + [[ ${COMPREPLY-} ]] && return + fi + + # TODO specific command and subcommand completions +} && + complete -F _op op + +# ex: filetype=sh diff --git a/completions/_renice b/completions/_renice index 1f1a610211c..a4167440e12 100644 --- a/completions/_renice +++ b/completions/_renice @@ -11,8 +11,8 @@ _renice() local command=$1 curopt i=0 # walk back through command line and find last option - while [[ $i -le $cword && ${#COMPREPLY[@]} -eq 0 ]]; do - curopt=${words[cword-$i]} + while ((i <= cword && ${#COMPREPLY[@]} == 0)); do + curopt=${words[cword - i]} case "$curopt" in -u) _allowed_users @@ -20,13 +20,13 @@ _renice() -g) _pgids ;; - -p|$command) + -p | "$command") _pids ;; esac - i=$(( ++i )) + ((i++)) done } && -complete -F _renice renice + complete -F _renice renice # ex: filetype=sh diff --git a/completions/_repomanage b/completions/_repomanage index c1072e795f7..ba0787e7006 100644 --- a/completions/_repomanage +++ b/completions/_repomanage @@ -8,17 +8,17 @@ _repomanage() local cur prev words cword split _init_completion -s || return - [[ "$prev" == -@([hk]|-help|-keep) ]] && return + [[ $prev == -@([hk]|-help|-keep) ]] && return $split && return - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _filedir -d fi } && -complete -F _repomanage repomanage + complete -F _repomanage repomanage # ex: filetype=sh diff --git a/completions/_reptyr b/completions/_reptyr index 4a087b49cb6..01d61b2ae72 100644 --- a/completions/_reptyr +++ b/completions/_reptyr @@ -15,12 +15,12 @@ _reptyr() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi [[ $prev != +([0-9]) ]] && _pids } && -complete -F _reptyr reptyr + complete -F _reptyr reptyr # ex: filetype=sh diff --git a/completions/_rfkill b/completions/_rfkill index e807d976dec..96a6c09838f 100644 --- a/completions/_rfkill +++ b/completions/_rfkill @@ -8,24 +8,24 @@ _rfkill() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--version' -- "$cur")) else case $cword in 1) - COMPREPLY=( $( compgen -W "help event list block unblock" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "help event list block unblock" \ + -- "$cur")) ;; 2) if [[ $prev == block || $prev == unblock ]]; then - COMPREPLY=( $( compgen -W "$($1 list | awk -F: \ + COMPREPLY=($(compgen -W "$($1 list | awk -F: \ '/^[0-9]/ {print $1}') all wifi bluetooth uwb wimax \ - wwan gps" -- "$cur" ) ) + wwan gps" -- "$cur")) fi ;; esac fi } && -complete -F _rfkill rfkill + complete -F _rfkill rfkill # ex: filetype=sh diff --git a/completions/_rtcwake b/completions/_rtcwake index b03c1244b41..6a0bb6cd983 100644 --- a/completions/_rtcwake +++ b/completions/_rtcwake @@ -9,24 +9,25 @@ _rtcwake() _init_completion -s || return case "$prev" in - --help|-h|--version|-V|--seconds|-s|--time|-t) + --help | -h | --version | -V | --seconds | -s | --time | -t) return ;; - --mode|-m) - COMPREPLY=( $( compgen -W 'standby mem disk on no off' -- "$cur" ) ) + --mode | -m) + COMPREPLY=($(compgen -W 'standby mem disk on no off' -- "$cur")) return ;; - --device|-d) - COMPREPLY=( $( command ls -d /dev/rtc?* 2>/dev/null ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]#/dev/}' -- "$cur" ) ) + --device | -d) + COMPREPLY=($(command ls -d /dev/rtc?* 2>/dev/null)) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]#/dev/}"' -- "$cur")) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) } && -complete -F _rtcwake rtcwake + complete -F _rtcwake rtcwake # ex: filetype=sh diff --git a/completions/_slackpkg b/completions/_slackpkg new file mode 100644 index 00000000000..10ddf3ba5ab --- /dev/null +++ b/completions/_slackpkg @@ -0,0 +1,116 @@ +# bash completion for slackpkg(8) -*- shell-script -*- +# options list is based on `grep '\-.*\=.*)' /usr/sbin/slackpkg | cut -f1 -d\)` + +# Use of this file is deprecated. +# Upstream completion is available in slackpkg >= 15.0.4, use that instead. + +_slackpkg() +{ + local cur prev words cword + _init_completion -n = || return + + local split=false + if [[ $cur == -?*=* ]]; then + prev="${cur%%?(\\)=*}" + cur="${cur#*=}" + split=true + fi + + case "$prev" in + -delall | -checkmd5 | -checkgpg | -checksize | -postinst | -onoff | \ + -download_all | -dialog | -batch | -only_new_dotnew | \ + -use_includes | -spinning) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) + return + ;; + -default_answer) + COMPREPLY=($(compgen -W 'yes no' -- "$cur")) + return + ;; + -dialog_maxargs | -mirror) + # argument required but no completions available + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + compopt -o nospace + COMPREPLY=($(compgen -W '-delall= -checkmd5= -checkgpg= + -checksize= -postinst= -onoff= -download_all= -dialog= + -dialog_maxargs= -batch= -only_new_dotnew= -use_includes= + -spinning= -default_answer= -mirror=' -- "$cur")) + return + fi + + local confdir="/etc/slackpkg" + local config="$confdir/slackpkg.conf" + + [[ -r $config ]] || return + . "$config" + + local i action + for ((i = 1; i < ${#words[@]}; i++)); do + if [[ ${words[i]} != -* ]]; then + action="${words[i]}" + break + fi + done + + case "$action" in + generate-template | search | file-search) + # argument required but no completions available + return + ;; + install-template | remove-template) + if [[ -e $confdir/templates ]]; then + COMPREPLY=($( + command cd -- "$confdir/templates" + compgen -f -X "!*.template" -- "$cur" + )) + COMPREPLY=(${COMPREPLY[@]%.template}) + fi + return + ;; + remove) + _filedir + COMPREPLY+=($(compgen -W 'a ap d e f k kde kdei l n t tcl x + xap xfce y' -- "$cur")) + COMPREPLY+=($( + command cd /var/log/packages + compgen -f -- "$cur" + )) + return + ;; + install | reinstall | upgrade | blacklist | download) + _filedir + COMPREPLY+=($(compgen -W 'a ap d e f k kde kdei l n t tcl x + xap xfce y' -- "$cur")) + COMPREPLY+=($(cut -f 6 -d\ "${WORKDIR}/pkglist" 2>/dev/null | + command grep "^$cur")) + return + ;; + info) + COMPREPLY=($(cut -f 6 -d\ "${WORKDIR}/pkglist" 2>/dev/null | + command grep "^$cur")) + return + ;; + update) + # we should complete the same as the next `list` + "gpg" + COMPREPLY=($(compgen -W 'gpg' -- "$cur")) + ;& + *) + COMPREPLY+=($(compgen -W 'install reinstall upgrade remove + blacklist download update install-new upgrade-all + clean-system new-config check-updates help generate-template + install-template remove-template search file-search info' -- \ + "$cur")) + return + ;; + esac + +} && + complete -F _slackpkg slackpkg + +# ex: filetype=sh diff --git a/completions/_su b/completions/_su index 2b069498dea..34925817f4e 100644 --- a/completions/_su +++ b/completions/_su @@ -8,34 +8,34 @@ if [[ $OSTYPE != *linux* ]]; then return fi -_su() # linux-specific completion -{ +_su() +{ # linux-specific completion local cur prev words cword split _init_completion -s || return case "$prev" in - -s|--shell) + -s | --shell) _shells return ;; - -c|--command|--session-command) + -c | --command | --session-command) local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -d -c -- "$cur" ) ) + COMPREPLY=($(compgen -d -c -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) } && -complete -F _su su + complete -F _su su # ex: filetype=sh diff --git a/completions/_svn b/completions/_svn index 37b6b2b4035..5d85c2b4b07 100644 --- a/completions/_svn +++ b/completions/_svn @@ -16,11 +16,11 @@ _svn() proplist plist pl propset pset ps resolved revert \ status stat st switch sw unlock update up' - if [[ $cword -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--version' -- "$cur")) else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$commands" -- "$cur")) fi else @@ -29,26 +29,24 @@ _svn() _filedir -d return ;; - -F|--file|--targets) + -F | --file | --targets) _filedir return ;; --encoding) - COMPREPLY=( $( compgen -W '$( iconv --list | \ - command sed -e "s@//@@;" )' -- "$cur" ) ) + _xfunc iconv _iconv_charsets return ;; - --editor-cmd|--diff-cmd|--diff3-cmd) - words=(words[0] $cur) - cword=1 - _command + --editor-cmd | --diff-cmd | --diff3-cmd) + compopt -o filenames + COMPREPLY=($(compgen -c -- "$cur")) return ;; esac local command=${words[1]} - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # possible options for the command local options case $command in @@ -56,7 +54,7 @@ _svn() options='--auto-props --no-auto-props --force --targets --no-ignore --non-recursive --quiet' ;; - blame|annotate|ann|praise) + blame | annotate | ann | praise) options='--revision --username --password --no-auth-cache --non-interactive --verbose --incremental --xml' ;; @@ -64,7 +62,7 @@ _svn() options='--revision --username --password --no-auth-cache --non-interactive' ;; - checkout|co) + checkout | co) options='--revision --quiet --non-recursive --username --password --no-auth-cache --non-interactive --ignore-externals' @@ -72,23 +70,23 @@ _svn() cleanup) options='--diff3-cmd' ;; - commit|ci) + commit | ci) options='--message --file --encoding --force-log --quiet --non-recursive --targets --editor-cmd --username --password --no-auth-cache --non-interactive --no-unlock' ;; - copy|cp) + copy | cp) options='--message --file --encoding --force-log --revision --quiet --editor-cmd -username --password --no-auth-cache --non-interactive' ;; - delete|del|remove|rm) + delete | del | remove | rm) options='--force --message --file --encoding --force-log --quiet --targets --editor-cmd --username --password --no-auth-cache --non-interactive' ;; - diff|di) + diff | di) options='--revision --extensions --diff-cmd --no-diff-deleted --non-recursive --username --password --no-auth-cache --non-interactive @@ -110,7 +108,7 @@ _svn() --non-interactive --revision --xml --targets --recursive --incremental' ;; - list|ls) + list | ls) options='--revision --verbose --recursive --username --password --no-auth-cache --non-interactive --incremental --xml' @@ -137,32 +135,32 @@ _svn() --editor-cmd --username --password --no-auth-cache --non-interactive' ;; - move|mv|rename|ren) + move | mv | rename | ren) options='--message --file --encoding --force-log --revision --quiet --force --editor-cmd --username --password --no-auth-cache --non-interactive' ;; - propdel|pdel|pd) + propdel | pdel | pd) options='--quiet --recursive --revision --revprop --username --password --no-auth-cache --non-interactive' ;; - propedit|pedit|pe) + propedit | pedit | pe) options='--revision --revprop --encoding --editor-cmd --username --password --no-auth-cache --non-interactive --force' ;; - propget|pget|pg) + propget | pget | pg) options='--recursive --revision --revprop --strict --username --password --no-auth-cache --non-interactive' ;; - proplist|plist|pl) + proplist | plist | pl) options='--verbose --recursive --revision --revprop --quiet --username --password --no-auth-cache --non-interactive' ;; - propset|pset|ps) + propset | pset | ps) options='--file --quiet --targets --recursive --revprop --encoding --username --password --no-auth-cache --non-interactive --revision --force' @@ -173,13 +171,13 @@ _svn() revert) options='--targets --recursive --quiet' ;; - status|stat|st) + status | stat | st) options='--show-updates --verbose --non-recursive --quiet --username --password --no-auth-cache --non-interactive --no-ignore --ignore-externals --incremental --xml' ;; - switch|sw) + switch | sw) options='--relocate --revision --non-recursive --quiet --username --password --no-auth-cache --non-interactive --diff3-cmd' @@ -188,7 +186,7 @@ _svn() options='--targets --force --username --password --no-auth-cache --non-interactive' ;; - update|up) + update | up) options='--revision --non-recursive --quiet --username --password --no-auth-cache --non-interactive --diff3-cmd --ignore-externals' @@ -196,10 +194,10 @@ _svn() esac options+=" --help --config-dir" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) else - if [[ "$command" == @(help|[h?]) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + if [[ $command == @(help|[h?]) ]]; then + COMPREPLY=($(compgen -W "$commands" -- "$cur")) else _filedir fi @@ -207,6 +205,6 @@ _svn() fi } && -complete -F _svn svn + complete -F _svn svn # ex: filetype=sh diff --git a/completions/_svnadmin b/completions/_svnadmin index 395ae119550..654fd3ecd78 100644 --- a/completions/_svnadmin +++ b/completions/_svnadmin @@ -12,11 +12,11 @@ _svnadmin() commands='create deltify dump help ? hotcopy list-dblogs list-unused-dblogs load lslocks lstxns recover rmlocks rmtxns setlog verify' - if [[ $cword -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--version' -- "$cur")) else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$commands" -- "$cur")) fi else case $prev in @@ -25,14 +25,14 @@ _svnadmin() return ;; --fs-type) - COMPREPLY=( $( compgen -W 'fsfs bdb' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'fsfs bdb' -- "$cur")) return ;; esac local command=${words[1]} - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # possible options for the command local options case $command in @@ -62,10 +62,10 @@ _svnadmin() esac options+=" --help" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) else - if [[ "$command" == @(help|[h?]) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + if [[ $command == @(help|[h?]) ]]; then + COMPREPLY=($(compgen -W "$commands" -- "$cur")) else _filedir fi @@ -73,6 +73,6 @@ _svnadmin() fi } && -complete -F _svnadmin -o default svnadmin + complete -F _svnadmin -o default svnadmin # ex: filetype=sh diff --git a/completions/_svnlook b/completions/_svnlook index a4f3424339d..36188a576a9 100644 --- a/completions/_svnlook +++ b/completions/_svnlook @@ -12,20 +12,20 @@ _svnlook() commands='author cat changed date diff dirs-changed help ? h history info lock log propget pget pg proplist plist pl tree uuid youngest' - if [[ $cword -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--version' -- "$cur")) else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$commands" -- "$cur")) fi else local command=${words[1]} - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # possible options for the command local options case $command in - author|cat|date|dirs-changed|info|log) + author | cat | date | dirs-changed | info | log) options='--revision --transaction' ;; changed) @@ -38,7 +38,7 @@ _svnlook() history) options='--revision --show-ids' ;; - propget|proplist) + propget | proplist) options='--revision --transaction --revprop' ;; tree) @@ -47,10 +47,10 @@ _svnlook() esac options+=" --help" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) else - if [[ "$command" == @(help|[h?]) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + if [[ $command == @(help|[h?]) ]]; then + COMPREPLY=($(compgen -W "$commands" -- "$cur")) else _filedir fi @@ -58,6 +58,6 @@ _svnlook() fi } && -complete -F _svnlook -o default svnlook + complete -F _svnlook -o default svnlook # ex: filetype=sh diff --git a/completions/_udevadm b/completions/_udevadm index 80424dca606..1afa8f881f3 100644 --- a/completions/_udevadm +++ b/completions/_udevadm @@ -9,7 +9,7 @@ _udevadm() _init_completion -s || return local i udevcmd - for (( i=1; i < cword; i++ )); do + for ((i = 1; i < cword; i++)); do if [[ ${words[i]} != -* ]]; then udevcmd=${words[i]} break @@ -17,19 +17,19 @@ _udevadm() done case $prev in - --help|--version|--property|--children-max|--timeout|--seq-start|\ - --seq-end|--attr-match|--attr-nomatch|--parent-match|--property-match|\ - --tag-match|--subsystem-match|--subsystem-nomatch|--sysname-match|\ - --path) + --help | --version | --property | --children-max | --timeout | \ + --seq-start | --seq-end | --attr-match | --attr-nomatch | \ + --parent-match | --property-match | --tag-match | \ + --subsystem-match | --subsystem-nomatch | --sysname-match | --path) return ;; --log-priority) - COMPREPLY=( $( compgen -W 'err info debug' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'err info debug' -- "$cur")) return ;; --query) - COMPREPLY=( $( compgen -W 'name symlink path property all' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'name symlink path property all' \ + -- "$cur")) return ;; --name) @@ -37,43 +37,41 @@ _udevadm() _filedir return ;; - --device-id-of-file|--exit-if-exists) + --device-id-of-file | --exit-if-exists) _filedir return ;; --action) - COMPREPLY=( $( compgen -W 'add change remove' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'add change remove' -- "$cur")) return ;; --type) - COMPREPLY=( $( compgen -W 'devices subsystems failed' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'devices subsystems failed' -- "$cur")) return ;; esac $split && return - if [[ -z $udevcmd ]]; then + if [[ ! -v udevcmd ]]; then case $cur in -*) - COMPREPLY=( $( compgen -W '--help --version --debug' -- \ - "$cur" ) ) + COMPREPLY=($(compgen -W '--help --version --debug' -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W "$( "$1" --help 2>/dev/null | - awk '/^[ \t]/ { print $1 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$("$1" --help 2>/dev/null | + awk '/^[ \t]/ { print $1 }')" -- "$cur")) ;; esac return fi if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( "$1" $udevcmd --help 2>/dev/null | _parse_help - )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W \ + '$("$1" ${udevcmd-} --help 2>/dev/null | _parse_help -)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _udevadm udevadm + complete -F _udevadm udevadm # ex: filetype=sh diff --git a/completions/_umount b/completions/_umount index 2c035244505..36d5703f6d2 100644 --- a/completions/_umount +++ b/completions/_umount @@ -17,8 +17,8 @@ _umount() _init_completion || return local IFS=$'\n' - COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(mount | cut -d" " -f 3)' -- "$cur")) } && -complete -F _umount -o dirnames umount + complete -F _umount -o dirnames umount # ex: filetype=sh diff --git a/completions/_umount.linux b/completions/_umount.linux index a7c5de5543f..dfedab11053 100644 --- a/completions/_umount.linux +++ b/completions/_umount.linux @@ -15,7 +15,7 @@ _reply_compgen_array() # argument. local i wlist for i in ${!COMPREPLY[*]}; do - local q=$(quote "$(printf %q "${COMPREPLY[$i]}")") + local q=$(quote "$(printf %q "${COMPREPLY[i]}")") wlist+=$q$'\n' done @@ -25,13 +25,14 @@ _reply_compgen_array() ecur=${ecur//\'/\\\'} # Actually generate completions. - local oldifs=$IFS - IFS=$'\n' eval 'COMPREPLY=(`compgen -W "$wlist" -- "${ecur}"`)' - IFS=$oldifs + local IFS=$'\n' + COMPREPLY=($(compgen -W "$wlist" -- "${ecur}")) + _comp_unlocal IFS } # Unescape strings in the linux fstab(5) format (with octal escapes). -__linux_fstab_unescape() { +__linux_fstab_unescape() +{ eval $1="'${!1//\'/\\047}'" eval $1="'${!1/%\\/\\\\}'" eval "$1=$'${!1}'" @@ -40,31 +41,27 @@ __linux_fstab_unescape() { # Complete linux fstab entries. # # Reads a file from stdin in the linux fstab(5) format; as used by /etc/fstab -# and /proc/mounts. +# and /proc/mounts. With 1st arg -L, look for entries by label. +# shellcheck disable=SC2120 _linux_fstab() { COMPREPLY=() # Read and unescape values into COMPREPLY local fs_spec fs_file fs_other - local oldifs="$IFS" while read -r fs_spec fs_file fs_other; do if [[ $fs_spec == [#]* ]]; then continue; fi - if [[ $1 == -L ]]; then - local fs_label=${fs_spec/#LABEL=} + if [[ ${1-} == -L ]]; then + local fs_label=${fs_spec/#LABEL=/} if [[ $fs_label != "$fs_spec" ]]; then __linux_fstab_unescape fs_label - IFS=$'\0' COMPREPLY+=("$fs_label") - IFS=$oldifs fi else __linux_fstab_unescape fs_spec __linux_fstab_unescape fs_file - IFS=$'\0' [[ $fs_spec == */* ]] && COMPREPLY+=("$fs_spec") [[ $fs_file == */* ]] && COMPREPLY+=("$fs_file") - IFS=$oldifs fi done @@ -72,21 +69,21 @@ _linux_fstab() if [[ $cur && $cur != /* ]]; then local realcur [[ $cur == */ ]] && # don't let readlink drop last / from path - realcur="$( readlink -f "$cur." 2> /dev/null )/" || - realcur=$( readlink -f "$cur" 2> /dev/null ) + realcur="$(readlink -f "$cur." 2>/dev/null)/" || + realcur=$(readlink -f "$cur" 2>/dev/null) if [[ $realcur ]]; then - local dirrealcur= dircur= basecur + local dirrealcur="" dircur="" basecur if [[ $cur == */* ]]; then dirrealcur="${realcur%/*}/" dircur="${cur%/*}/" fi basecur=${cur#"$dircur"} - local i n=${#COMPREPLY[@]} - for (( i=0; i < $n; i++ )); do - [[ "${COMPREPLY[i]}" == "$realcur"* ]] && - COMPREPLY+=( $( cd "$dircur" 2> /dev/null && + local i + for i in ${!COMPREPLY[*]}; do + [[ ${COMPREPLY[i]} == "$realcur"* ]] && + COMPREPLY+=($(command cd -- "$dircur" 2>/dev/null && compgen -f -d -P "$dircur" \ - -X "!${COMPREPLY[i]##"$dirrealcur"}" -- "$basecur" ) ) + -X "!${COMPREPLY[i]##"$dirrealcur"}" -- "$basecur")) done fi fi @@ -103,18 +100,18 @@ _umount() -t) # FIXME: no local split=false - if [[ "$cur" == ?*,* ]]; then + if [[ $cur == ?*,* ]]; then prev="${cur%,*}" cur="${cur##*,}" split=true fi - COMPREPLY=( $( compgen -W 'adfs affs autofs btrfs cifs coda + COMPREPLY=($(compgen -W 'adfs affs autofs btrfs cifs coda cramfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus hpfs iso9660 jfs minix msdos ncpfs nfs nfs4 ntfs ntfs-3g proc qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs udf ufs - umsdos usbfs vfat xfs' -- "$cur" ) ) + umsdos usbfs vfat xfs' -- "$cur")) _fstypes - $split && COMPREPLY=( ${COMPREPLY[@]/#/$prev,} ) + $split && COMPREPLY=(${COMPREPLY[@]/#/$prev,}) return ;; -O) @@ -123,21 +120,21 @@ _umount() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-V -h -v -n -r -d -i -a -t -O -f -l - --no-canonicalize --fake' -- "$cur" ) ) - [[ $COMPREPLY ]] && return + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-V -h -v -n -r -d -i -a -t -O -f -l + --no-canonicalize --fake' -- "$cur")) + [[ ${COMPREPLY-} ]] && return fi if [[ -r /proc/mounts ]]; then # Linux /proc/mounts is properly quoted. This is important when # unmounting usb devices with pretty names. - _linux_fstab < /proc/mounts + _linux_fstab /dev/null | \ - awk '!/Name|Domain-0/ { print $1 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(xm list 2>/dev/null | + awk '!/Name|Domain-0/ { print $1 }')" -- "$cur")) } _xen_domain_ids() { - COMPREPLY=( $( compgen -W "$( xm list 2>/dev/null | \ - awk '!/Name|Domain-0/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(xm list 2>/dev/null | + awk '!/Name|Domain-0/ { print $2 }')" -- "$cur")) } _xm() @@ -32,16 +36,16 @@ _xm() labels addlabel rmlabel getlabel dry-run resources dumppolicy setpolicy resetpolicy getpolicy shell help' - if [[ $cword -eq 1 ]] ; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -W "$commands" -- "$cur")) else - if [[ "$cur" == *=* ]]; then + if [[ $cur == *=* ]]; then prev=${cur/=*/} cur=${cur/*=/} fi command=${words[1]} - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # possible options for the command case $command in create) @@ -62,7 +66,7 @@ _xm() sched-credit) options='-d -w -c' ;; - block-list|network-list|vtpm-list|vnet-list) + block-list | network-list | vtpm-list | vnet-list) options='-l --long' ;; getpolicy) @@ -74,12 +78,13 @@ _xm() -s --skipdtd -p --paused -c --console_autoconnect' ;; esac - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) else case $command in - console|destroy|domname|domid|list|mem-set|mem-max| \ - pause|reboot|rename|shutdown|unpause|vcpu-list|vcpu-pin| \ - vcpu-set|block-list|network-list|vtpm-list) + console | destroy | domname | domid | list | mem-set | \ + mem-max | pause | reboot | rename | shutdown | unpause | \ + vcpu-list | vcpu-pin | vcpu-set | block-list | \ + network-list | vtpm-list) _count_args case $args in 2) @@ -89,7 +94,7 @@ _xm() ;; migrate) _count_args - case $args in + case $args in 2) _xen_domain_names ;; @@ -98,7 +103,7 @@ _xm() ;; esac ;; - restore|dry-run|vnet-create) + restore | dry-run | vnet-create) _filedir ;; save) @@ -119,8 +124,7 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $( compgen -W "r s e i u b" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "r s e i u b" -- "$cur")) ;; esac ;; @@ -131,11 +135,10 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $( compgen -W "phy: file:" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "phy: file:" -- "$cur")) ;; 5) - COMPREPLY=( $( compgen -W "w r" -- "$cur" ) ) + COMPREPLY=($(compgen -W "w r" -- "$cur")) ;; 6) _xen_domain_names @@ -149,9 +152,9 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $( compgen -W "$( xm block-list $prev \ - 2>/dev/null | awk '!/Vdev/ { print $1 }' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(xm block-list $prev \ + 2>/dev/null | awk '!/Vdev/ { print $1 }')" \ + -- "$cur")) ;; esac ;; @@ -162,8 +165,8 @@ _xm() _xen_domain_names ;; *) - COMPREPLY=( $( compgen -W "script= ip= mac= bridge= - backend=" -- "$cur" ) ) + COMPREPLY=($(compgen -W "script= ip= mac= bridge= + backend=" -- "$cur")) ;; esac ;; @@ -174,9 +177,9 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $(compgen -W "$( xm network-list $prev \ - 2>/dev/null | awk '!/Idx/ { print $1 }' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(xm network-list $prev \ + 2>/dev/null | awk '!/Idx/ { print $1 }')" \ + -- "$cur")) ;; esac ;; @@ -190,13 +193,13 @@ _xm() ;; create) _filedir - COMPREPLY+=( \ - $( compgen -W '$( command ls /etc/xen 2>/dev/null )' \ - -- "$cur" ) ) + COMPREPLY+=( + $(compgen -W '$(command ls /etc/xen 2>/dev/null)' \ + -- "$cur")) ;; new) case $prev in - -f|-F|--defconfig|--config) + -f | -F | --defconfig | --config) _filedir return ;; @@ -207,7 +210,7 @@ _xm() esac _count_args - case $args in + case $args in 2) _xen_domain_names ;; @@ -217,6 +220,6 @@ _xm() fi fi } && -complete -F _xm xm + complete -F _xm xm # ex: filetype=sh diff --git a/completions/_yum b/completions/_yum index f3a104bdbab..3a1a67851c8 100644 --- a/completions/_yum +++ b/completions/_yum @@ -5,16 +5,16 @@ _yum_list() { - if [[ "$1" == all ]] ; then + if [[ $1 == all ]]; then # Try to strip in between headings like "Available Packages" # This will obviously only work for English :P - COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ - command sed -ne '/^Available /d' -e '/^Installed /d' -e '/^Updated /d' \ - -e 's/[[:space:]].*//p' ) ) + COMPREPLY=($(yum -d 0 -C list $1 "$cur*" 2>/dev/null | + command sed -ne '/^Available /d' -e '/^Installed /d' \ + -e '/^Updated /d' -e 's/[[:space:]].*//p')) else # Drop first line (e.g. "Updated Packages") - COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ - command sed -ne 1d -e 's/[[:space:]].*//p' ) ) + COMPREPLY=($(yum -d 0 -C list $1 "$cur*" 2>/dev/null | + command sed -ne 1d -e 's/[[:space:]].*//p')) fi } @@ -23,14 +23,15 @@ _yum_repolist() # -d 0 causes repolist to output nothing as of yum 3.2.22: # http://yum.baseurl.org/ticket/83 # Drop first ("repo id repo name") and last ("repolist: ...") rows - yum --noplugins -C repolist $1 2>/dev/null | \ - command sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' -e 's/[[:space:]].*//p' + yum --noplugins -C repolist $1 2>/dev/null | + command sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' \ + -e 's/[[:space:]].*//p' } _yum_plugins() { - command ls /usr/lib/yum-plugins/*.py{,c,o} 2>/dev/null \ - | command sed -ne 's|.*/\([^./]*\)\.py[co]\{0,1\}$|\1|p' | sort -u + command ls /usr/lib/yum-plugins/*.py{,c,o} 2>/dev/null | + command sed -ne 's|.*/\([^./]*\)\.py[co]\{0,1\}$|\1|p' | sort -u } _yum() @@ -39,16 +40,17 @@ _yum() _init_completion -s || return local special i - for (( i=0; i < ${#words[@]}-1; i++ )); do + for ((i = 1; i < ${#words[@]} - 1; i++)); do if [[ ${words[i]} == @(install|update|upgrade|remove|erase|deplist|info) ]]; then special=${words[i]} + break fi done - if [[ -n $special ]]; then + if [[ -v special ]]; then # TODO: install|update|upgrade should not match *src.rpm - if [[ "$cur" == @(*/|[.~])* && \ - "$special" == @(deplist|install|update|upgrade) ]]; then + if [[ $cur == @(*/|[.~])* && + $special == @(deplist|install|update|upgrade) ]]; then _filedir rpm return fi @@ -57,15 +59,15 @@ _yum() _yum_list available return ;; - deplist|info) + deplist | info) _yum_list all return ;; - upgrade|update) + upgrade | update) _yum_list updates return ;; - remove|erase) + remove | erase) # _rpm_installed_packages is not arch-qualified _yum_list installed return @@ -75,22 +77,22 @@ _yum() case $prev in list) - COMPREPLY=( $( compgen -W 'all available updates installed extras - obsoletes recent' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'all available updates installed extras + obsoletes recent' -- "$cur")) ;; clean) - COMPREPLY=( $( compgen -W 'packages headers metadata cache dbcache - all' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'packages headers metadata cache dbcache + all' -- "$cur")) ;; repolist) - COMPREPLY=( $( compgen -W 'all enabled disabled' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'all enabled disabled' -- "$cur")) ;; - localinstall|localupdate) + localinstall | localupdate) # TODO: should not match *src.rpm _filedir rpm ;; - -d|-e) - COMPREPLY=( $( compgen -W '{0..10}' -- "$cur" ) ) + -d | -e) + COMPREPLY=($(compgen -W '{0..10}' -- "$cur")) ;; -c) _filedir @@ -99,46 +101,45 @@ _yum() _filedir -d ;; --enablerepo) - COMPREPLY=( $( compgen -W '$( _yum_repolist disabled )' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_yum_repolist disabled)' -- "$cur")) ;; --disablerepo) - COMPREPLY=( $( compgen -W '$( _yum_repolist enabled )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_yum_repolist enabled)' -- "$cur")) ;; --disableexcludes) - COMPREPLY=( $( compgen -W '$( _yum_repolist all ) all main' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_yum_repolist all) all main' \ + -- "$cur")) ;; - --enableplugin|--disableplugin) - COMPREPLY=( $( compgen -W '$( _yum_plugins )' -- "$cur" ) ) + --enableplugin | --disableplugin) + COMPREPLY=($(compgen -W '$(_yum_plugins)' -- "$cur")) ;; --color) - COMPREPLY=( $( compgen -W 'always auto never' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'always auto never' -- "$cur")) ;; - -R|-x|--exclude) + -R | -x | --exclude) # argument required but no completions available return ;; - -h|--help|--version) + -h | --help | --version) # no other options useful with these return ;; *) - COMPREPLY=( $( compgen -W 'install update check-update upgrade + COMPREPLY=($(compgen -W 'install update check-update upgrade remove erase list info provides whatprovides clean makecache groupinstall groupupdate grouplist groupremove groupinfo search shell resolvedep localinstall localupdate deplist - repolist help' -- "$cur" ) ) + repolist help' -- "$cur")) ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _yum yum + complete -F _yum yum # ex: filetype=sh diff --git a/completions/a2x b/completions/a2x index 501a40028e1..b59c7861bfd 100644 --- a/completions/a2x +++ b/completions/a2x @@ -6,15 +6,15 @@ _a2x() _init_completion -s || return case $prev in - --attribute|--asciidoc-opts|--dblatex-opts|--fop-opts|--help|\ - --version|--xsltproc-opts|-!(-*)[ah]) + --attribute | --asciidoc-opts | --dblatex-opts | --fop-opts | --help | \ + --version | --xsltproc-opts | -!(-*)[ah]) return ;; - --destination-dir|--icons-dir|-!(-*)D) + --destination-dir | --icons-dir | -!(-*)D) _filedir -d return ;; - --doctype|-!(-*)d) + --doctype | -!(-*)d) _xfunc asciidoc _asciidoc_doctype return ;; @@ -27,14 +27,13 @@ _a2x() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _a2x a2x + complete -F _a2x a2x # ex: filetype=sh diff --git a/completions/abook b/completions/abook index 4bb0e8e368c..42197d10d8f 100644 --- a/completions/abook +++ b/completions/abook @@ -6,12 +6,12 @@ _abook() _init_completion || return # abook only takes options, tabbing after command name adds a single dash - [[ $cword -eq 1 && -z "$cur" ]] && - { - compopt -o nospace - COMPREPLY=( "-" ) - return - } + [[ $cword -eq 1 && -z $cur ]] && + { + compopt -o nospace + COMPREPLY=("-") + return + } case $cur in -*) @@ -22,28 +22,28 @@ _abook() case $prev in --informat) - COMPREPLY=( $( compgen -W "$($1 --formats | \ + COMPREPLY=($(compgen -W "$($1 --formats | command sed -n -e 's/^'$'\t''\([a-z]*\).*/\1/p' -e '/^$/q')" \ - -- "$cur" ) ) + -- "$cur")) ;; --outformat) - COMPREPLY=( $( compgen -W "$($1 --formats | \ + COMPREPLY=($(compgen -W "$($1 --formats | command sed -n -e '/^$/,$s/^'$'\t''\([a-z]*\).*/\1/p')" \ - -- "$cur" ) ) + -- "$cur")) ;; --infile) - COMPREPLY=( $( compgen -W stdin -- "$cur" ) ) + COMPREPLY=($(compgen -W stdin -- "$cur")) _filedir ;; --outfile) - COMPREPLY=( $( compgen -W stdout -- "$cur" ) ) + COMPREPLY=($(compgen -W stdout -- "$cur")) _filedir ;; - --config|--datafile) + --config | --datafile) _filedir ;; esac } && -complete -F _abook abook + complete -F _abook abook # ex: filetype=sh diff --git a/completions/aclocal b/completions/aclocal index aca62867bf8..010862fb881 100644 --- a/completions/aclocal +++ b/completions/aclocal @@ -6,10 +6,10 @@ _aclocal() _init_completion -s || return case "$prev" in - --help|--print-ac-dir|--version) + --help | --print-ac-dir | --version) return ;; - --acdir|-I) + --acdir | -I) _filedir -d return ;; @@ -17,19 +17,19 @@ _aclocal() _filedir return ;; - --warnings|-W) - local cats=( syntax unsupported ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) + --warnings | -W) + local cats=(syntax unsupported) + COMPREPLY=($(compgen -W \ + '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur")) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _aclocal aclocal aclocal-1.1{0..6} + complete -F _aclocal aclocal aclocal-1.1{0..6} # ex: filetype=sh diff --git a/completions/acpi b/completions/acpi index 871bca80675..f2c38b210d1 100644 --- a/completions/acpi +++ b/completions/acpi @@ -6,17 +6,17 @@ _acpi() _init_completion || return case $prev in - --help|--version|-!(-*)[hv]) + --help | --version | -!(-*)[hv]) return ;; - --directory|-!(-*)d) + --directory | -!(-*)d) _filedir -d return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) } && -complete -F _acpi acpi + complete -F _acpi acpi # ex: filetype=sh diff --git a/completions/adb b/completions/adb deleted file mode 100644 index d069b425c00..00000000000 --- a/completions/adb +++ /dev/null @@ -1,66 +0,0 @@ -# adb completion -*- shell-script -*- - -_adb_command_usage() -{ - COMPREPLY=( $( compgen -W \ - '$( "$1" help 2>&1 | command grep "^ *\(adb \)\? *$2 " \ - | command sed -e "s/[]|[]/\n/g" | _parse_help - )' -- "$cur" ) ) -} - -_adb() -{ - local cur prev words cword - _init_completion || return - - case $prev in - -s|-p|--algo|--key|--iv) - return - ;; - -f) - _filedir - return - ;; - esac - - local cmd i - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" != -* && "${words[i-1]}" != -[sp] ]]; then - cmd="${words[i]}" - break - fi - done - - if [[ ! "$cmd" ]]; then - local tmp=() - if [[ ! $cur || $cur == -* ]]; then - tmp+=( $( compgen -W '$( _parse_help "$1" help )' -- "$cur" ) ) - fi - if [[ ! $cur || $cur != -* ]]; then - tmp+=( $( $1 help 2>&1 | awk '$1 == "adb" { print $2 }' ) ) - tmp+=( devices connect disconnect sideload ) - fi - COMPREPLY=( $( compgen -W '${tmp[@]}' -- "$cur" ) ) - return - fi - - # TODO: more and better command completions - - _adb_command_usage "$1" $cmd - - case $cmd in - push|restore|sideload) - _filedir - ;; - forward) - COMPREPLY=( $( compgen -W \ - '$( "$1" help 2>&1 | command sed -ne "s/^ *adb *forward *-/-/p" | \ - _parse_help - )' -- "$cur" ) ) - ;; - reboot) - COMPREPLY=( $( compgen -W 'bootloader recovery' -- "$cur" ) ) - ;; - esac -} && -complete -F _adb adb - -# ex: filetype=sh diff --git a/completions/add_members b/completions/add_members index d582d94b9e8..efa4f1e2882 100644 --- a/completions/add_members +++ b/completions/add_members @@ -6,26 +6,26 @@ _add_members() _init_completion -s || return case $prev in - -r|-d|--regular-members-file|--digest-members-file) + -r | -d | --regular-members-file | --digest-members-file) _filedir return ;; - -w|-a|--welcome-msg|--admin-notify) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + -w | -a | --welcome-msg | --admin-notify) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--regular-members-file --digest-members-file - --welcome-msg --admin-notify --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--regular-members-file --digest-members-file + --welcome-msg --admin-notify --help' -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _add_members add_members + complete -F _add_members add_members # ex: filetype=sh diff --git a/completions/alias b/completions/alias index e90dff60726..92211d839ef 100644 --- a/completions/alias +++ b/completions/alias @@ -7,14 +7,14 @@ _alias() case ${words[@]} in *[^=]) - COMPREPLY=( $( compgen -A alias -- "$cur" ) ) + COMPREPLY=($(compgen -A alias -- "$cur")) ;; *=) - COMPREPLY=( "$( alias ${cur%=} 2>/dev/null | command sed \ - -e 's|^alias '"$cur"'\(.*\)$|\1|' )" ) + COMPREPLY=("$(alias ${cur%=} 2>/dev/null | command sed \ + -e 's|^alias '"$cur"'\(.*\)$|\1|')") ;; esac } && -complete -F _alias -o nospace alias + complete -F _alias -o nospace alias # ex: filetype=sh diff --git a/completions/ant b/completions/ant index 639cde97079..2c7a9b0bae3 100644 --- a/completions/ant +++ b/completions/ant @@ -11,7 +11,7 @@ _ant_parse_targets() if [[ $line =~ \<(target|extension-point)[[:space:]].*name=[\"\']([^\"\']+) ]]; then targets+=" ${BASH_REMATCH[2]}" fi - done < $1 + done <$1 # parse imports while read -rd '>' line; do @@ -22,7 +22,7 @@ _ant_parse_targets() _ant_parse_targets $imported_buildfile fi fi - done < $1 + done <$1 } _ant() @@ -31,15 +31,15 @@ _ant() _init_completion || return case $prev in - -h|-help|--h|--help|-projecthelp|-p|-version|-diagnostics) + -h | -help | --h | --help | -projecthelp | -p | -version | -diagnostics) return ;; - -buildfile|-file|-f) + -buildfile | -file | -f) _filedir 'xml' return ;; - -logfile|-l) - _filedir + -logfile | -l) + [[ $1 != *phing || $prev != -l ]] && _filedir return ;; -propertyfile) @@ -47,34 +47,37 @@ _ant() return ;; -nice) - COMPREPLY=( $( compgen -W '{1..10}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..10}' -- "$cur")) return ;; -lib) _filedir -d return ;; - -logger|-listener|-inputhandler|-main|-find|-s) + -logger | -listener | -inputhandler | -main | -find | -s) return ;; esac if [[ $cur == -D* ]]; then return - elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + elif [[ $cur == -* ]]; then + # The /dev/null && \ - complete -C complete-ant-cmd.pl -F _ant ant || : + complete -F _ant ant phing +if type complete-ant-cmd.pl &>/dev/null; then + complete -C complete-ant-cmd.pl -F _ant ant +fi # ex: filetype=sh diff --git a/completions/apache2ctl b/completions/apache2ctl index 747897441f4..980b3c58c84 100644 --- a/completions/apache2ctl +++ b/completions/apache2ctl @@ -6,11 +6,11 @@ _apache2ctl() _init_completion || return local APWORDS - APWORDS=$($1 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | \ + APWORDS=$($1 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | tr "|" " ") - COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$APWORDS" -- "$cur")) } && -complete -F _apache2ctl apache2ctl + complete -F _apache2ctl apache2ctl # ex: filetype=sh diff --git a/completions/appdata-validate b/completions/appdata-validate index 3285a3b32ec..03d8cc9a064 100644 --- a/completions/appdata-validate +++ b/completions/appdata-validate @@ -6,13 +6,13 @@ _appdata_validate() _init_completion -s || return case $prev in - -h|--help|--version) + -h | --help | --version) return ;; --output-format) - COMPREPLY=( $( compgen -W "$( $1 --help | - command sed -ne 's/--output-format.*\[\(.*\)\]/\1/' -e 's/|/ /gp' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 --help | + command sed -ne 's/--output-format.*\[\(.*\)\]/\1/' -e 's/|/ /gp')" \ + -- "$cur")) return ;; esac @@ -20,13 +20,13 @@ _appdata_validate() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir appdata.xml } && -complete -F _appdata_validate appdata-validate + complete -F _appdata_validate appdata-validate # ex: filetype=sh diff --git a/completions/apt-build b/completions/apt-build index 0723bcc4c45..713f4c3948c 100644 --- a/completions/apt-build +++ b/completions/apt-build @@ -6,48 +6,49 @@ _apt_build() _init_completion || return local special i - for (( i=0; i < ${#words[@]}-1; i++ )); do + for ((i = 1; i < ${#words[@]} - 1; i++)); do if [[ ${words[i]} == @(install|remove|source|info|clean) ]]; then special=${words[i]} + break fi done - if [[ -n $special ]]; then + if [[ -v special ]]; then case $special in - install|source|info) - COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) ) + install | source | info) + COMPREPLY=($(_xfunc apt-cache _apt_cache_packages)) ;; remove) - COMPREPLY=( \ - $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) ) + COMPREPLY=( + $(_xfunc dpkg _comp_dpkg_installed_packages "$cur")) ;; esac return fi case $prev in - --patch|--build-dir|--repository-dir) + --patch | --build-dir | --repository-dir) _filedir return ;; - -h|--help) + -h | --help) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --show-upgraded -u --build-dir + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --show-upgraded -u --build-dir --repository-dir --build-only --build-command --reinstall --rebuild --remove-builddep --no-wrapper --purge --patch --patch-strip -p - --yes -y --version -v --no-source' -- "$cur" ) ) + --yes -y --version -v --no-source' -- "$cur")) else - COMPREPLY=( $( compgen -W 'update upgrade install remove source + COMPREPLY=($(compgen -W 'update upgrade install remove source dist-upgrade world clean info clean-build update-repository' \ - -- "$cur" ) ) + -- "$cur")) fi } && -complete -F _apt_build apt-build + complete -F _apt_build apt-build # ex: filetype=sh diff --git a/completions/apt-cache b/completions/apt-cache index 96b5fd44d82..eeadac96728 100644 --- a/completions/apt-cache +++ b/completions/apt-cache @@ -1,18 +1,22 @@ # Debian apt-cache(8) completion -*- shell-script -*- # List APT binary packages -_apt_cache_packages() { - apt-cache --no-generate pkgnames "$cur" 2> /dev/null +_apt_cache_packages() +{ + apt-cache --no-generate pkgnames "$cur" 2>/dev/null || : } # List APT source packages -_apt_cache_sources() { - apt-cache dumpavail | command grep "^Source: $1" | cut -f2 -d" " | sort -u +_apt_cache_sources() +{ + compgen -W "$(apt-cache dumpavail | + awk '$1 == "Source:" { print $2 }' | sort -u)" -- "$1" } # List APT source packages -_apt_cache_src_packages() { - compgen -W '$( _apt_cache_sources "$cur" )' -- "$cur" +_apt_cache_src_packages() +{ + compgen -W '$(_apt_cache_sources "$cur")' -- "$cur" } _apt_cache() @@ -20,63 +24,67 @@ _apt_cache() local cur prev words cword _init_completion || return - local special i + local special ispecial if [[ $cur != show ]]; then - for (( i=0; i < ${#words[@]}-1; i++ )); do - if [[ ${words[i]} == @(add|depends|dotty|madison|policy|rdepends|show?(pkg|src|)) ]]; then - special=${words[i]} + for ((ispecial = 1; ispecial < ${#words[@]} - 1; ispecial++)); do + if [[ ${words[ispecial]} == @(add|depends|dotty|madison|policy|rdepends|show?(pkg|src|)) ]]; then + special=${words[ispecial]} + break fi done fi - - if [[ -n $special ]]; then + if [[ -v special && $ispecial -lt $cword ]]; then case $special in - add) - _filedir - ;; + add) + _filedir + ;; - showsrc) - COMPREPLY=( $( _apt_cache_sources "$cur" ) ) - ;; + showsrc) + COMPREPLY=($(_apt_cache_sources "$cur")) + ;; - *) - COMPREPLY=( $( _apt_cache_packages ) ) - ;; + *) + COMPREPLY=($(_apt_cache_packages)) + ;; esac return fi - case $prev in - --config-file|--pkg-cache|--src-cache|-!(-*)[cps]) + --config-file | --pkg-cache | --src-cache | -!(-*)[cps]) _filedir return ;; + --with-source) + _filedir '@(deb|dsc|changes)' + COMPREPLY+=($( + compgen -f -o plusdirs -X '!?(*/)@(Sources|Packages)' -- "$cur" + )) + return + ;; search) - if [[ "$cur" != -* ]]; then + if [[ $cur != -* ]]; then return fi ;; esac - if [[ "$cur" == -* ]]; then - - COMPREPLY=( $( compgen -W '-h -v -p -s -q -i -f -a -g -c -o --help - --version --pkg-cache --src-cache --quiet --important --full - --all-versions --no-all-versions --generate --no-generate - --names-only --all-names --recurse --config-file --option - --installed' -- "$cur" ) ) - else - - COMPREPLY=( $( compgen -W 'add gencaches show showpkg showsrc stats - dump dumpavail unmet search search depends rdepends pkgnames - dotty xvcg policy madison' -- "$cur" ) ) - + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--pkg-cache --src-cache --quiet --important + --no-pre-depends --no-depends --no-recommends --no-suggests + --no-conflicts --no-breaks --no-replaces --no-enhances --implicit + --full --all-versions --no-all-versions --generate --no-generate + --names-only --all-names --recurse --installed --with-source --help + --version --config-file --option' -- "$cur")) + elif [[ ! -v special ]]; then + COMPREPLY=($(compgen -W 'gencaches showpkg stats showsrc dump + dumpavail unmet show search depends rdepends pkgnames dotty xvcg + policy madison' -- "$cur")) fi } && -complete -F _apt_cache apt-cache + complete -F _apt_cache apt-cache # ex: filetype=sh diff --git a/completions/apt-get b/completions/apt-get index 8296d682ed8..3449952ed4f 100644 --- a/completions/apt-get +++ b/completions/apt-get @@ -1,73 +1,88 @@ # Debian apt-get(8) completion -*- shell-script -*- +_comp_cmd_apt_get_installed_packages() +{ + if [[ -f /etc/debian_version ]]; then + # Debian system + COMPREPLY=($( + _xfunc dpkg _comp_dpkg_installed_packages $cur + )) + else + # assume RPM based + _xfunc rpm _rpm_installed_packages + fi +} + _apt_get() { - local cur prev words cword - _init_completion -n = || return + local cur prev words cword package + _init_completion -n ':=' || return local special i - for (( i=0; i < ${#words[@]}-1; i++ )); do - if [[ ${words[i]} == @(install|remove|autoremove|purge|source|build-dep|download|changelog) ]]; then + for ((i = 1; i < ${#words[@]} - 1; i++)); do + if [[ ${words[i]} == @(install|remove|auto?(-)remove|purge|source|build-dep|download|changelog) ]]; then special=${words[i]} + break fi done - if [[ -n $special ]]; then + if [[ -v special ]]; then case $special in - remove|autoremove|purge) - if [[ -f /etc/debian_version ]]; then - # Debian system - COMPREPLY=( $( \ - _xfunc dpkg _comp_dpkg_installed_packages $cur ) ) - else - # assume RPM based - _xfunc rpm _rpm_installed_packages - fi + remove | auto?(-)remove | purge) + _comp_cmd_apt_get_installed_packages ;; source) - COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ - 2> /dev/null ) $( apt-cache dumpavail | \ - command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) ) + COMPREPLY=($(_xfunc apt-cache _apt_cache_packages) + $(compgen -W "$(apt-cache dumpavail | + awk '$1 == "Source:" { print $2 }' | sort -u)" -- "$cur")) ;; - install) + install | reinstall) if [[ $cur == */* ]]; then _filedir deb return elif [[ $cur == *=* ]]; then - COMPREPLY=( $( compgen -W "$( \ - apt-cache --no-generate show "${cur%%=*}" 2>/dev/null | - command sed -ne \ - 's/^Version:[[:space:]]*\([^[:space:]]\)/\1/p' )" \ - -- "${cur#*=}" ) ) + package="${cur%%=*}" + cur="${cur#*=}" + COMPREPLY=($(IFS=$'\n' compgen -W "$( + apt-cache --no-generate madison "$package" 2>/dev/null | + while IFS=' |' read -r _ version _; do + echo "$version" + done + )" \ + -- "$cur")) + __ltrim_colon_completions "$cur" return fi ;;& + build-dep) + _filedir -d + [[ $cur != */* ]] || return + ;;& *) - COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ - 2>/dev/null ) ) + COMPREPLY+=($(_xfunc apt-cache _apt_cache_packages)) ;; esac return fi case $prev in - --help|--version|--option|-!(-*)[hvo]) + --error-on | --help | --version | --option | -!(-*)[ehvo]) return ;; - --config-file|-!(-*)c) + --config-file | -!(-*)c) _filedir return ;; - --target-release|--default-release|-!(-*)t) - COMPREPLY=( $( compgen -W "$( apt-cache policy | command sed -ne \ - 's/^ *release.*[ ,]o=\(Debian\|Ubuntu\),a=\(\w*\).*/\2/p' )" \ - -- "$cur" ) ) + --target-release | --default-release | -!(-*)t) + COMPREPLY=($(compgen -W "$(apt-cache policy | command sed -ne \ + 's/^ *release.*[ ,]o=\(Debian\|Ubuntu\),a=\(\w*\).*/\2/p')" \ + -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-install-recommends --install-suggests + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--no-install-recommends --install-suggests --download-only --fix-broken --ignore-missing --fix-missing --no-download --quiet --simulate --just-print --dry-run --recon --no-act --yes --assume-yes --assume-no --no-show-upgraded @@ -79,16 +94,16 @@ _apt_get() --trivial-only --no-remove --auto-remove --autoremove --only-source --diff-only --dsc-only --tar-only --arch-only --indep-only --allow-unauthenticated --no-allow-insecure-repositories - --allow-releaseinfo-change --show-progress --with-source --help - --version --config-file --option' -- "$cur" ) ) + --allow-releaseinfo-change --show-progress --with-source --error-on + --help --version --config-file --option' -- "$cur")) else - COMPREPLY=( $( compgen -W 'update upgrade dist-upgrade - dselect-upgrade install remove purge source build-dep check - download clean autoclean autoremove changelog indextargets' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'update upgrade dist-upgrade + dselect-upgrade install reinstall remove purge source build-dep + satisfy check download clean autoclean autoremove changelog + indextargets' -- "$cur")) fi } && -complete -F _apt_get apt-get + complete -F _apt_get apt-get # ex: filetype=sh diff --git a/completions/apt-mark b/completions/apt-mark new file mode 100644 index 00000000000..a264c2f32ae --- /dev/null +++ b/completions/apt-mark @@ -0,0 +1,65 @@ +# Debian apt-mark(8) completion -*- shell-script -*- + +_comp_cmd_apt_mark() +{ + local cur prev words cword split + _init_completion -s || return + + local special i + for ((i = 1; i < ${#words[@]} - 1; i++)); do + if [[ ${words[i]} == @(auto|manual|minimize-manual|showauto|showmanual|hold|unhold|showhold|install|remove|deinstall|purge|showinstall|showremove|showpurge) ]]; then + special=${words[i]} + break + fi + done + + if [[ -v special ]]; then + case $special in + auto | manual | unhold) + local -A showcmds=([auto]=manual [manual]=auto [unhold]=hold) + local showcmd=${showcmds[$special]} + COMPREPLY=($( + compgen -W "$("$1" show$showcmd 2>/dev/null)" -- "$cur" + )) + return + ;; + minimize-manual) + return + ;; + *) + _xfunc apt-get _comp_cmd_apt_get_installed_packages + ;; + esac + return + fi + + case $prev in + --help | --version | --option | -!(-*)[hvo]) + return + ;; + --config-file | -!(-*)c) + _filedir conf + return + ;; + --file | -!(-*)f) + _filedir + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--file= --help --version --config-file + --option' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + else + COMPREPLY=($(compgen -W 'auto manual minimize-manual showauto + showmanual hold unhold showhold install remove purge + showinstall showremove showpurge' -- "$cur")) + fi + +} && + complete -F _comp_cmd_apt_mark apt-mark + +# ex: filetype=sh diff --git a/completions/aptitude b/completions/aptitude index 4e3954a55a4..7e733098328 100644 --- a/completions/aptitude +++ b/completions/aptitude @@ -1,54 +1,46 @@ # Debian aptitude(1) completion -*- shell-script -*- -_have grep-status && { -_comp_dpkg_hold_packages() -{ - grep-status -P -e "^$1" -a -FStatus 'hold' -n -s Package -} -} || { -_comp_dpkg_hold_packages() -{ - command grep -B 2 'hold' /var/lib/dpkg/status | \ - awk "/Package: $1/ { print \$2 }" -} -} +if _have grep-status; then + _comp_dpkg_hold_packages() + { + grep-status -P -e "^$1" -a -FStatus 'hold' -n -s Package + } +else + _comp_dpkg_hold_packages() + { + command grep -B 2 'hold' /var/lib/dpkg/status | + awk "/Package: $1/ { print \$2 }" + } +fi _aptitude() { local cur prev words cword _init_completion || return - local dashoptions='-S -u -i -h --help --version -s --simulate -d - --download-only -P --prompt -y --assume-yes -F --display-format -O - --sort -w --width -f -r -g --with-recommends -R -G --without-recommends - -t --target-release -V --show-versions -D --show-deps -Z -v --verbose - --purge-unused --schedule-only' - local special i - for (( i=0; i < ${#words[@]}-1; i++ )); do + for ((i = 1; i < ${#words[@]} - 1; i++)); do if [[ ${words[i]} == @(@(|re)install|@(|un)hold|@(|un)markauto|@(dist|full|safe)-upgrade|download|show|forbid-version|purge|remove|changelog|why@(|-not)|keep@(|-all)|build-dep|@(add|remove)-user-tag|versions) ]]; then special=${words[i]} + break fi - #exclude some mutually exclusive options - [[ ${words[i]} == '-u' ]] && dashoptions=${dashoptions/-i} - [[ ${words[i]} == '-i' ]] && dashoptions=${dashoptions/-u} done - if [[ -n "$special" ]]; then + if [[ -v special ]]; then case $special in - install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade| \ - safe-upgrade|download|show|changelog|why|why-not|build-dep| \ - add-user-tag|remove-user-tag|versions) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) ) + install | hold | markauto | unmarkauto | dist-upgrade | full-upgrade | \ + safe-upgrade | download | show | changelog | why | why-not | build-dep | \ + add-user-tag | remove-user-tag | versions) + COMPREPLY=($(_xfunc apt-cache _apt_cache_packages)) return ;; - purge|remove|reinstall|forbid-version) - COMPREPLY=( \ - $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) ) + purge | remove | reinstall | forbid-version) + COMPREPLY=( + $(_xfunc dpkg _comp_dpkg_installed_packages "$cur")) return ;; unhold) - COMPREPLY=( $( _comp_dpkg_hold_packages "$cur" ) ) + COMPREPLY=($(_comp_dpkg_hold_packages "$cur")) return ;; esac @@ -56,32 +48,73 @@ _aptitude() case $prev in # don't complete anything if these options are found - autoclean|clean|forget-new|search|upgrade|update|keep-all) + autoclean | clean | forget-new | search | upgrade | update | keep-all) return ;; -!(-*)S) _filedir return ;; - --target-release|--default-release|-!(-*)t) - COMPREPLY=( $( apt-cache policy | \ - command grep "release.o=Debian,a=$cur" | \ - command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) ) + --display-format | --width | -!(-*)[wFo]) + return + ;; + --sort | -!(-*)O) + COMPREPLY=($(compgen -W 'installsize installsizechange debsize + name priority version' -- "$cur")) + return + ;; + --target-release | --default-release | -!(-*)t) + COMPREPLY=($(apt-cache policy | + command grep "release.o=Debian,a=$cur" | + command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2>/dev/null)) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$dashoptions" -- "$cur" ) ) + if [[ $cur == -* ]]; then + local opts=" $($1 --help 2>&1 | command sed -e \ + 's/--with(out)-recommends/--without-recommends\n--with-recommends/' | + _parse_help - | tr '\n' ' ') " + + # Exclude some mutually exclusive options + for i in "${words[@]}"; do + [[ $i == -u ]] && opts=${opts/ -i / } + [[ $i == -i ]] && opts=${opts/ -u / } + done + + # Do known short -> long replacements; at least up to 0.8.12, --help + # outputs mostly only short ones. + COMPREPLY=($opts) + for i in "${!COMPREPLY[@]}"; do + case ${COMPREPLY[i]} in + -h) COMPREPLY[i]=--help ;; + -s) COMPREPLY[i]=--simulate ;; + -d) COMPREPLY[i]=--download-only ;; + -P) COMPREPLY[i]=--prompt ;; + -y) COMPREPLY[i]=--assume-yes ;; + -F) COMPREPLY[i]=--display-format ;; + -O) COMPREPLY[i]=--sort ;; + -W) COMPREPLY[i]=--show-why ;; + -w) COMPREPLY[i]=--width ;; + -V) COMPREPLY[i]=--show-versions ;; + -D) COMPREPLY[i]=--show-deps ;; + -v) COMPREPLY[i]=--verbose ;; + -t) COMPREPLY[i]=--target-release ;; + -q) COMPREPLY[i]=--quiet ;; + esac + done + + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) else - COMPREPLY=( $( compgen -W 'update upgrade safe-upgrade forget-new + COMPREPLY=($(compgen -W 'update upgrade safe-upgrade forget-new clean autoclean install reinstall remove hold unhold purge markauto unmarkauto why why-not dist-upgrade full-upgrade download search show forbid-version changelog keep keep-all build-dep add-user-tag - remove-user-tag versions' -- "$cur" ) ) + remove-user-tag versions' -- "$cur")) fi } && -complete -F _aptitude -o default aptitude aptitude-curses + complete -F _aptitude -o default aptitude aptitude-curses # ex: filetype=sh diff --git a/completions/arch b/completions/arch index cd33b4f0c47..afeed05d498 100644 --- a/completions/arch +++ b/completions/arch @@ -3,44 +3,44 @@ # Try to detect whether this is the mailman "arch" to avoid installing # it for the coreutils/util-linux-ng one. _have mailmanctl && -_arch() -{ - local cur prev words cword split - _init_completion -s || return + _arch() + { + local cur prev words cword split + _init_completion -s || return - case $prev in - -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return - ;; - -d|--file) - _filedir - return - ;; - esac - - $split && return - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - else - local args=$cword - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == -* ]]; then - args=$(($args-1)) - fi - done - case $args in - 1) - _xfunc list_lists _mailman_lists + case $prev in + -w | -g | -d | --welcome-msg | --goodbye-msg | --digest) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) + return ;; - 2) + --file) _filedir + return ;; esac - fi -} && -complete -F _arch arch + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + else + local args=$cword + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -* ]]; then + ((args--)) + fi + done + case $args in + 1) + _xfunc list_lists _mailman_lists + ;; + 2) + _filedir + ;; + esac + fi + + } && + complete -F _arch arch # ex: filetype=sh diff --git a/completions/arp b/completions/arp index 65a06601e7c..c1e8284652b 100644 --- a/completions/arp +++ b/completions/arp @@ -6,28 +6,30 @@ _arp() _init_completion || return case $prev in - --device|-!(-*)i) + --device | -!(-*)i) _available_interfaces -a return ;; - --protocol|-!(-*)[Ap]) + --protocol | -!(-*)[Ap]) # TODO protocol/address family return ;; - --file|-!(-*)f) + --file | -!(-*)f) _filedir return ;; - --hw-type|-!(-*)[Ht]) + --hw-type | -!(-*)[Ht]) # TODO: parse from --help output? - COMPREPLY=( $( compgen -W 'ash ether ax25 netrom rose arcnet \ - dlci fddi hippi irda x25 eui64' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ash ether ax25 netrom rose arcnet \ + dlci fddi hippi irda x25 eui64' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) return fi @@ -35,9 +37,9 @@ _arp() _count_args "" "@(--device|--protocol|--file|--hw-type|-!(-*)[iApfHt])" case $args in 1) - local ips=$( "$1" -an | sed -ne \ - 's/.*(\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}\)).*/\1/p' ) - COMPREPLY=( $( compgen -W '$ips' -- "$cur" ) ) + local ips=$("$1" -an | command sed -ne \ + 's/.*(\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}\)).*/\1/p') + COMPREPLY=($(compgen -W '$ips' -- "$cur")) ;; 2) # TODO if -d mode: "pub"; if not -f mode: hw_addr @@ -54,6 +56,6 @@ _arp() ;; esac } && -complete -F _arp arp + complete -F _arp arp # ex: filetype=sh diff --git a/completions/arping b/completions/arping index 62442d330de..57e1e19b471 100644 --- a/completions/arping +++ b/completions/arping @@ -6,7 +6,7 @@ _arping() _init_completion || return case $prev in - -*c|-*w) + -*c | -*w) return ;; -*I) @@ -20,12 +20,12 @@ _arping() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) return fi _known_hosts_real -- "$cur" } && -complete -F _arping arping + complete -F _arping arping # ex: filetype=sh diff --git a/completions/arpspoof b/completions/arpspoof index e31288fcc68..d1a1373593b 100644 --- a/completions/arpspoof +++ b/completions/arpspoof @@ -16,13 +16,13 @@ _arpspoof() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) else _known_hosts_real -- "$cur" fi } && -complete -F _arpspoof arpspoof + complete -F _arpspoof arpspoof # ex: filetype=sh diff --git a/completions/asciidoc b/completions/asciidoc index e4af83d7eb4..1ea4abf2e96 100644 --- a/completions/asciidoc +++ b/completions/asciidoc @@ -2,7 +2,7 @@ _asciidoc_doctype() { - COMPREPLY+=( $( compgen -W 'article book manpage' -- "$cur" ) ) + COMPREPLY+=($(compgen -W 'article book manpage' -- "$cur")) } _asciidoc() @@ -11,26 +11,26 @@ _asciidoc() _init_completion -s || return case $prev in - --attribute|-!(-*)a) + --attribute | -!(-*)a) return ;; - --backend|-!(-*)b) - COMPREPLY=( $( compgen -W 'docbook html4 xhtml11' -- "$cur" ) ) + --backend | -!(-*)b) + COMPREPLY=($(compgen -W 'docbook html4 xhtml11' -- "$cur")) return ;; - --conf-file|-!(-*)f) + --conf-file | -!(-*)f) _filedir conf return ;; - --doctype|-!(-*)d) + --doctype | -!(-*)d) _asciidoc_doctype return ;; - --help|-!(-*)h) - COMPREPLY=( $( compgen -W 'manpage syntax topics' -- "$cur" ) ) + --help | -!(-*)h) + COMPREPLY=($(compgen -W 'manpage syntax topics' -- "$cur")) return ;; - --out-file|-!(-*)o) + --out-file | -!(-*)o) _filedir return ;; @@ -39,14 +39,14 @@ _asciidoc() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" "--help manpage" )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1" "--help manpage")' \ + -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _asciidoc asciidoc asciidoc.py + complete -F _asciidoc asciidoc asciidoc.py # ex: filetype=sh diff --git a/completions/aspell b/completions/aspell index 9457a5fafd8..6696ca3da22 100644 --- a/completions/aspell +++ b/completions/aspell @@ -3,14 +3,17 @@ _aspell_dictionary() { local datadir aspell=${1:-aspell} - datadir=$( $aspell config data-dir 2>/dev/null || echo /usr/lib/aspell ) + datadir=$($aspell config data-dir 2>/dev/null || echo /usr/lib/aspell) # First, get aliases (dicts dump does not list them) - COMPREPLY=( $( printf '%s\n' $datadir/*.alias ) ) - COMPREPLY=( "${COMPREPLY[@]%.alias}" ) - COMPREPLY=( "${COMPREPLY[@]#$datadir/}" ) + COMPREPLY=($datadir/*.alias) + if ((${#COMPREPLY[@]})); then + COMPREPLY=("${COMPREPLY[@]%.alias}") + COMPREPLY=("${COMPREPLY[@]#$datadir/}") + fi # Then, add the canonical dicts - COMPREPLY+=( $( $aspell dicts 2>/dev/null ) ) - COMPREPLY=( $( compgen -X '\*' -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY+=($($aspell dicts 2>/dev/null)) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -X '\*' -W '"${COMPREPLY[@]}"' -- "$cur")) } _aspell() @@ -19,47 +22,47 @@ _aspell() _init_completion -s || return case $prev in - -c|-p|check|--conf|--personal|--repl|--per-conf) + -c | -p | check | --conf | --personal | --repl | --per-conf) _filedir return ;; - --conf-dir|--data-dir|--dict-dir|--home-dir|--local-data-dir|--prefix) + --conf-dir | --data-dir | --dict-dir | --home-dir | --local-data-dir | --prefix) _filedir -d return ;; - dump|create|merge) - COMPREPLY=( $( compgen -W 'master personal repl' -- "$cur" ) ) + dump | create | merge) + COMPREPLY=($(compgen -W 'master personal repl' -- "$cur")) return ;; --mode) - COMPREPLY=( $( compgen -W "$( $1 modes 2>/dev/null | \ - awk '{ print $1 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 modes 2>/dev/null | + awk '{ print $1 }')" -- "$cur")) return ;; --sug-mode) - COMPREPLY=( $( compgen -W 'ultra fast normal bad-speller' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ultra fast normal bad-speller' \ + -- "$cur")) return ;; --keymapping) - COMPREPLY=( $( compgen -W 'aspell ispell' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'aspell ispell' -- "$cur")) return ;; - -d|--master) + -d | --master) _aspell_dictionary "$1" return ;; - --add-filter|--rem-filter) - COMPREPLY=( $( compgen -W "$( $1 filters 2>/dev/null | \ - awk '{ print $1 }' )" -- "$cur" ) ) + --add-filter | --rem-filter) + COMPREPLY=($(compgen -W "$($1 filters 2>/dev/null | + awk '{ print $1 }')" -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= --encoding= --add-filter= --rem-filter= --mode= --add-extra-dicts= --rem-extra-dicts= --home-dir= --ignore= --ignore-accents --dont-ignore-accents --ignore-case --dont-ignore-case @@ -76,13 +79,13 @@ _aspell() --add-tex-command= --rem-tex-command= --tex-check-comments --dont-tex-check-comments --add-tex-extension --rem-tex-extension --add-sgml-check= --rem-sgml-check= --add-sgml-extension - --rem-sgml-extension' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + --rem-sgml-extension' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W 'usage help check pipe list config soundslike - filter version dump create merge' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'usage help check pipe list config soundslike + filter version dump create merge' -- "$cur")) fi } && -complete -F _aspell aspell + complete -F _aspell aspell # ex: filetype=sh diff --git a/completions/autoconf b/completions/autoconf index c67f1bdbe89..b51e797e001 100644 --- a/completions/autoconf +++ b/completions/autoconf @@ -6,20 +6,20 @@ _autoconf() _init_completion -s || return case "$prev" in - --help|-h|--version|-V|--trace|-t) + --help | -h | --version | -V | --trace | -t) return ;; - --output|-o) + --output | -o) _filedir return ;; - --warnings|-W) - local cats=( cross obsolete syntax ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) + --warnings | -W) + local cats=(cross obsolete syntax) + COMPREPLY=($(compgen -W \ + '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur")) return ;; - --prepend-include|-B|--include|-I) + --prepend-include | -B | --include | -I) _filedir -d return ;; @@ -27,14 +27,14 @@ _autoconf() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir '@(ac|in)' } && -complete -F _autoconf autoconf + complete -F _autoconf autoconf # ex: filetype=sh diff --git a/completions/automake b/completions/automake index c2a96580ab4..5fe5f4f86d7 100644 --- a/completions/automake +++ b/completions/automake @@ -6,13 +6,13 @@ _automake() _init_completion -s || return case "$prev" in - --help|--version) + --help | --version) return ;; - --warnings|-W) - local cats=( gnu obsolete override portability syntax unsupported ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) + --warnings | -W) + local cats=(gnu obsolete override portability syntax unsupported) + COMPREPLY=($(compgen -W \ + '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur")) return ;; --libdir) @@ -23,14 +23,14 @@ _automake() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _automake automake automake-1.1{0..6} + complete -F _automake automake automake-1.1{0..6} # ex: filetype=sh diff --git a/completions/autoreconf b/completions/autoreconf index c067cec13a6..9b0f0dc9410 100644 --- a/completions/autoreconf +++ b/completions/autoreconf @@ -6,17 +6,17 @@ _autoreconf() _init_completion -s || return case "$prev" in - --help|-h|--version|-V) + --help | -h | --version | -V) return ;; - --warnings|-W) - local cats=( cross gnu obsolete override portability syntax \ - unsupported ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) + --warnings | -W) + local cats=(cross gnu obsolete override portability syntax + unsupported) + COMPREPLY=($(compgen -W \ + '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur")) return ;; - --prepend-include|-B|--include|-I) + --prepend-include | -B | --include | -I) _filedir -d return ;; @@ -24,18 +24,18 @@ _autoreconf() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - if [[ $1 == autoheader ]] ; then + if [[ $1 == *autoheader ]]; then _filedir '@(ac|in)' else _filedir -d fi } && -complete -F _autoreconf autoreconf autoheader + complete -F _autoreconf autoreconf autoheader # ex: filetype=sh diff --git a/completions/autorpm b/completions/autorpm index 8c6e299a182..d55322ab819 100644 --- a/completions/autorpm +++ b/completions/autorpm @@ -5,10 +5,10 @@ _autorpm() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W '--notty --debug --help --version auto add - fullinfo info help install list remove set' -- "$cur" ) ) + COMPREPLY=($(compgen -W '--notty --debug --help --version auto add + fullinfo info help install list remove set' -- "$cur")) } && -complete -F _autorpm autorpm + complete -F _autorpm autorpm # ex: filetype=sh diff --git a/completions/autoscan b/completions/autoscan index ff3a092beac..e0071437197 100644 --- a/completions/autoscan +++ b/completions/autoscan @@ -6,10 +6,10 @@ _autoscan() _init_completion -s || return case "$prev" in - --help|--version|-!(-*)[hV]) + --help | --version | -!(-*)[hV]) return ;; - --prepend-include|--include|-!(-*)[BI]) + --prepend-include | --include | -!(-*)[BI]) _filedir -d return ;; @@ -17,18 +17,18 @@ _autoscan() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - if [[ $1 == autoupdate ]] ; then + if [[ $1 == *autoupdate ]]; then _filedir '@(ac|in)' else _filedir -d fi } && -complete -F _autoscan autoscan autoupdate + complete -F _autoscan autoscan autoupdate # ex: filetype=sh diff --git a/completions/avahi-browse b/completions/avahi-browse new file mode 100644 index 00000000000..18c9448fe7c --- /dev/null +++ b/completions/avahi-browse @@ -0,0 +1,40 @@ +# bash completion for avahi-browse(1) -*- shell-script -*- + +_comp_cmd_avahi_browse() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --domain | -!(-*)D) + return + ;; + --help | --version | -!(-*)[hV]*) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} != *= ]] || compopt -o nospace + return + fi + + # Complete service types except with -a/-D/-b + [[ $1 != *-domains ]] || return + local word + for word in "${words[@]}"; do + case $word in + --all | --browse-domains | --dump-db | -!(-*)[aDb]*) + return + ;; + esac + done + COMPREPLY=($(compgen -W '$("$1" --dump-db --no-db-lookup)' -- "$cur")) + +} && + complete -F _comp_cmd_avahi_browse avahi-browse avahi-browse-domains + +# ex: filetype=sh diff --git a/completions/avctrl b/completions/avctrl index acd9aeb7bb3..89c24e470d0 100644 --- a/completions/avctrl +++ b/completions/avctrl @@ -5,16 +5,16 @@ _avctrl() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --quiet' -- "$cur")) else local args _count_args - if [[ $args -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'discover switch' -- "$cur" ) ) + if ((args == 1)); then + COMPREPLY=($(compgen -W 'discover switch' -- "$cur")) fi fi } && -complete -F _avctrl avctrl + complete -F _avctrl avctrl # ex: filetype=sh diff --git a/completions/badblocks b/completions/badblocks index 689f4fae3d9..29c4e00d6c1 100644 --- a/completions/badblocks +++ b/completions/badblocks @@ -15,18 +15,15 @@ _badblocks() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then # Filter out -w (dangerous) and -X (internal use) - for i in ${!COMPREPLY[@]}; do - [[ ${COMPREPLY[i]} == -[wX] ]] && unset 'COMPREPLY[i]' - done + COMPREPLY=($(compgen -X -[wX] -W '$(_parse_usage "$1")' -- "$cur")) return fi cur=${cur:=/dev/} _filedir } && -complete -F _badblocks badblocks + complete -F _badblocks badblocks # ex: filetype=sh diff --git a/completions/bind b/completions/bind index c1f7e224129..2ee428b214e 100644 --- a/completions/bind +++ b/completions/bind @@ -10,8 +10,8 @@ _bind() return ;; -*m) - COMPREPLY=( $( compgen -W "emacs emacs-standard emacs-meta - emacs-ctlx vi vi-move vi-command vi-insert" -- "$cur" ) ) + COMPREPLY=($(compgen -W "emacs emacs-standard emacs-meta + emacs-ctlx vi vi-move vi-command vi-insert" -- "$cur")) return ;; -*f) @@ -19,18 +19,18 @@ _bind() return ;; -*[qu]) - COMPREPLY=( $( compgen -W '$( "$1" -l )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$("$1" -l)' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi - COMPREPLY=( $( compgen -A binding -- "$cur" ) ) + COMPREPLY=($(compgen -A binding -- "$cur")) } && -complete -F _bind bind + complete -F _bind bind # ex: filetype=sh diff --git a/completions/bk b/completions/bk index 334e25b49d5..4e4d140aeb1 100644 --- a/completions/bk +++ b/completions/bk @@ -6,13 +6,13 @@ _bk() local cur prev words cword _init_completion || return - local BKCMDS="$( bk help topics 2>/dev/null | \ - awk '/^ bk/ { print $2 }' | xargs printf '%s ' )" + local BKCMDS="$(bk help topics 2>/dev/null | + awk '/^ bk/ { print $2 }' | xargs printf '%s ')" - COMPREPLY=( $( compgen -W "$BKCMDS" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$BKCMDS" -- "$cur")) _filedir } && -complete -F _bk bk + complete -F _bk bk # ex: filetype=sh diff --git a/completions/brctl b/completions/brctl index 01370654e8c..14569b64878 100644 --- a/completions/brctl +++ b/completions/brctl @@ -9,31 +9,32 @@ _brctl() case $cword in 1) - COMPREPLY=( $( compgen -W "addbr delbr addif delif setageing + COMPREPLY=($(compgen -W "addbr delbr addif delif setageing setbridgeprio setfd sethello setmaxage setpathcost setportprio - show showmacs showstp stp" -- "$cur" ) ) + show showmacs showstp stp" -- "$cur")) ;; 2) case $command in - show) - ;; + show) ;; + *) - COMPREPLY=( $( compgen -W "$($1 show | \ - awk 'NR>1 {print $1}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 show | + awk 'NR>1 {print $1}')" -- "$cur")) + ;; esac ;; 3) case $command in - addif|delif) + addif | delif) _configured_interfaces ;; stp) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) ;; esac ;; esac } && -complete -F _brctl -o default brctl + complete -F _brctl -o default brctl # ex: filetype=sh diff --git a/completions/btdownloadheadless.py b/completions/btdownloadheadless.py index f0b74615633..a470e535780 100644 --- a/completions/btdownloadheadless.py +++ b/completions/btdownloadheadless.py @@ -6,14 +6,14 @@ _init_completion || return case $prev in - --responsefile|--saveas) + --responsefile | --saveas) _filedir return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--max_uploads --keepalive_interval + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--max_uploads --keepalive_interval --download_slice_size --request_backlog --max_message_length --ip --minport --maxport --responsefile --url --saveas --timeout --timeout_check_interval --max_slice_length --max_rate_period @@ -21,12 +21,12 @@ --min_peers --http_timeout --max_initiate --max_allow_in --check_hashes --max_upload_rate --snub_time --spew --rarest_first_cutoff --min_uploads --report_hash_failures' \ - -- "$cur" ) ) + -- "$cur")) else _filedir fi } && -complete -F _btdownload btdownloadheadless.py btdownloadcurses.py \ - btdownloadgui.py + complete -F _btdownload btdownloadheadless.py btdownloadcurses.py \ + btdownloadgui.py # ex: filetype=sh diff --git a/completions/bts b/completions/bts index ba33fd66090..d535d13ed04 100644 --- a/completions/bts +++ b/completions/bts @@ -1,92 +1,89 @@ # bts completion -*- shell-script -*- # List bug numbers from bugs cache in ~/.devscripts_cache/bts -_cached_bugs() { - [[ -d $HOME/.devscripts_cache/bts ]] && \ - find $HOME/.devscripts_cache/bts -maxdepth 1 -name "$cur[0-9]*.html" \ +_cached_bugs() +{ + [[ -d $HOME/.devscripts_cache/bts ]] && + find $HOME/.devscripts_cache/bts -maxdepth 1 -name "${cur}[0-9]*.html" \ -printf "%f\n" | cut -d'.' -f1 } # List APT source packages prefixed with "src:" -_src_packages_with_prefix() { +_src_packages_with_prefix() +{ ppn=${cur:4} # partial package name, after stripping "src:" - compgen -P "src:" -W '$( _xfunc apt-cache _apt_cache_sources "$ppn" )' \ + compgen -P "src:" -W '$(_xfunc apt-cache _apt_cache_sources "$ppn")' \ -- "$ppn" } - _bts() { local cur prev words cword split _init_completion -s || return case $prev in - show|bugs) - COMPREPLY=( $( compgen -W 'release-critical RC from: tag: - usertag:' -- "$cur" ) $( _cached_bugs ) - $( _src_packages_with_prefix ) ) + show | bugs) + COMPREPLY=($(compgen -W 'release-critical RC from: tag: + usertag:' -- "$cur") $(_cached_bugs) + $(_src_packages_with_prefix)) return ;; select) - COMPREPLY=( $( compgen -W 'package: source: maintainer: submitter: + COMPREPLY=($(compgen -W 'package: source: maintainer: submitter: severity: status: tag: owner: correspondent: affects: bugs: - users: archive:' -- "$cur" ) ) + users: archive:' -- "$cur")) return ;; status) - COMPREPLY=( $( compgen -W 'file: fields: verbose' -- "$cur" ) - $( _cached_bugs ) ) + COMPREPLY=($(compgen -W 'file: fields: verbose' -- "$cur") + $(_cached_bugs)) return ;; - block|unblock) - COMPREPLY=( $( compgen -W 'by with' -- "$cur" ) ) + block | unblock) + COMPREPLY=($(compgen -W 'by with' -- "$cur")) return ;; severity) - COMPREPLY=( $( compgen -W 'wishlist minor normal important serious - grave critical' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'wishlist minor normal important serious + grave critical' -- "$cur")) return ;; limit) - COMPREPLY=( $( compgen -W 'submitter date subject msgid package - source tag severity owner affects archive' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'submitter date subject msgid package + source tag severity owner affects archive' -- "$cur")) return ;; - clone|done|reopen|archive|unarchive|retitle|summary|submitter|found\ - |notfound|fixed|notfixed|merge|forcemerge|unmerge|claim|unclaim\ - |forwarded|notforwarded|owner|noowner|subscribe|unsubscribe\ - |reportspam|spamreport|affects|usertag|usertags|reassign|tag\ - |tags) - COMPREPLY=( $( _cached_bugs ) ) + clone | "done" | reopen | archive | unarchive | retitle | summary | submitter | found | notfound | fixed | notfixed | merge | forcemerge | unmerge | claim | unclaim | forwarded | notforwarded | owner | noowner | subscribe | unsubscribe | reportspam | spamreport | affects | usertag | usertags | reassign | tag | tags) + COMPREPLY=($(_cached_bugs)) return ;; package) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) ) + COMPREPLY=($(_xfunc apt-cache _apt_cache_packages)) return ;; cache) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) - $( _src_packages_with_prefix ) - $( compgen -W 'from: release-critical RC' -- "$cur" ) ) + COMPREPLY=($(_xfunc apt-cache _apt_cache_packages) + $(_src_packages_with_prefix) + $(compgen -W 'from: release-critical RC' -- "$cur")) return ;; cleancache) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) - $( _src_packages_with_prefix ) - $( compgen -W 'from: tag: usertag: ALL' -- "$cur" ) ) + COMPREPLY=($(_xfunc apt-cache _apt_cache_packages) + $(_src_packages_with_prefix) + $(compgen -W 'from: tag: usertag: ALL' -- "$cur")) return ;; user) # non-predicible arguments - COMPREPLY=( ) + COMPREPLY=() return ;; :) # Chances are that "src:" is being completed # COMP_WORDS would be: "bts cleancache src : " pos=$((COMP_CWORD - 2)) - if [[ $pos -gt 0 && "${COMP_WORDS[$pos]}" == "src" ]]; then - COMPREPLY=( $( _xfunc apt-cache _apt_cache_src_packages ) ) + if [[ $pos -gt 0 && ${COMP_WORDS[pos]} == "src" ]]; then + COMPREPLY=($(_xfunc apt-cache _apt_cache_src_packages)) return fi ;; @@ -94,7 +91,7 @@ _bts() $split && return - COMPREPLY=( $( compgen -W '--offline --online --no-offline + COMPREPLY=($(compgen -W '--offline --online --no-offline --no-action --cache --no-cache --cache-mode --cache-delay --mbox --mailreader --cc-addr --use-default-cc --no-use-default-cc --sendmail --mutt --no-mutt --smtp-host --smtp-username @@ -107,9 +104,9 @@ _bts() merge forcemerge unmerge tag tags affects user usertag usertags claim unclaim severity forwarded notforwarded package limit owner noowner subscribe unsubscribe reportspam spamreport cache cleancache version - help' -- "$cur" ) ) + help' -- "$cur")) } && -complete -F _bts bts + complete -F _bts bts # ex: filetype=sh diff --git a/completions/bzip2 b/completions/bzip2 index 940ddcf691c..40e50fe321e 100644 --- a/completions/bzip2 +++ b/completions/bzip2 @@ -6,38 +6,37 @@ _bzip2() _init_completion || return case $prev in - --help|-!(-*)[bhp]) + --help | -!(-*)[bhp]) return ;; -!(-*)n) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - local helpopts=$( _parse_help "$1" ) - COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + local helpopts=$(_parse_help "$1") + COMPREPLY=($(compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \ + -- "$cur")) return fi - local IFS=$'\n' xspec="*.bz2" + local IFS=$'\n' xspec="*.?(t)bz2" - if [[ "$prev" == --* ]]; then - [[ "$prev" == --@(decompress|list|test) ]] && xspec="!"$xspec - [[ "$prev" == --compress ]] && xspec= - elif [[ "$prev" == -* ]]; then - [[ "$prev" == -*[dt]* ]] && xspec="!"$xspec - [[ "$prev" == -*z* ]] && xspec= + if [[ $prev == --* ]]; then + [[ $prev == --@(decompress|list|test) ]] && xspec="!"$xspec + [[ $prev == --compress ]] && xspec= + elif [[ $prev == -* ]]; then + [[ $prev == -*[dt]* ]] && xspec="!"$xspec + [[ $prev == -*z* ]] && xspec= fi _tilde "$cur" || return compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur")) } && -complete -F _bzip2 bzip2 pbzip2 lbzip2 + complete -F _bzip2 bzip2 pbzip2 lbzip2 # ex: filetype=sh diff --git a/completions/cancel b/completions/cancel index 5a03368193f..3e0c1d52735 100644 --- a/completions/cancel +++ b/completions/cancel @@ -14,14 +14,14 @@ _cancel() return ;; -u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) return ;; esac - COMPREPLY=( $( compgen -W \ - "$( lpstat 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + "$(lpstat 2>/dev/null | cut -d' ' -f1)" -- "$cur")) } && -complete -F _cancel cancel + complete -F _cancel cancel # ex: filetype=sh diff --git a/completions/cardctl b/completions/cardctl index 273d1a9040c..bb3a0dba522 100644 --- a/completions/cardctl +++ b/completions/cardctl @@ -5,11 +5,11 @@ _cardctl() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'status config ident suspend resume reset - eject insert scheme' -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -W 'status config ident suspend resume reset + eject insert scheme' -- "$cur")) fi } && -complete -F _cardctl cardctl pccardctl + complete -F _cardctl cardctl pccardctl # ex: filetype=sh diff --git a/completions/carton b/completions/carton new file mode 100644 index 00000000000..5d700c8903f --- /dev/null +++ b/completions/carton @@ -0,0 +1,81 @@ +# carton(3pm) completion -*- shell-script -*- + +_carton_commands() +{ + local cmds=$("${1:-carton}" usage 2>&1 | + command sed -ne '/.*command.* is one of/{n;p;q;}') + COMPREPLY+=($(IFS="$IFS," compgen -W "$cmds" -- "$cur")) +} + +_carton_command_help() +{ + local help=$(PERLDOC_PAGER=cat PERLDOC=-otext "${1:-carton}" -h $2 2>&1) + COMPREPLY+=($(compgen -W '$help' -- "$cur")) +} + +_carton() +{ + local cur prev words cword split + _init_completion -s || return + + local i command + for ((i = 1; i < cword; i++)); do + case ${words[i]} in + -*) ;; + *) + command=${words[i]} + break + ;; + esac + done + + if [[ ! -v command ]]; then + _carton_commands "$1" + return + fi + + case $prev in + --version | -v) + return + ;; + --help | -h) + [[ -n $command ]] || _carton_commands "$1" + return + ;; + --cpanfile) + if [[ $command == install ]]; then + _filedir + return + fi + ;; + --path) + if [[ $command == install ]]; then + _filedir -d + return + fi + ;; + --without) + if [[ $command == install ]]; then + local phases="configure build test runtime develop" + COMPREPLY+=($(compgen -W '$phases' -- "$cur")) + return + fi + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + [[ $command == @(help|usage) ]] || COMPREPLY=(--help) + _carton_command_help "$1" $command + fi + + case $command in + show | update) + : # TODO modules completion + ;; + esac +} && + complete -F _carton carton + +# ex: filetype=sh diff --git a/completions/ccache b/completions/ccache index e6a4422d9c7..80c39de0542 100644 --- a/completions/ccache +++ b/completions/ccache @@ -6,7 +6,7 @@ _ccache() _init_completion -s || return local i - for (( i=1; i <= COMP_CWORD; i++ )); do + for ((i = 1; i <= COMP_CWORD; i++)); do if [[ ${COMP_WORDS[i]} != -* ]]; then _command_offset $i return @@ -15,14 +15,14 @@ _ccache() done case $prev in - --help|--version|--max-files|--max-size|-!(-*)[hVFM]) + --help | --version | --max-files | --max-size | -!(-*)[hVFM]) return ;; - --set-config|-!(-*)o) + --set-config | -!(-*)o) if [[ $cur != *=* ]]; then - COMPREPLY=( $( compgen -S = -W "$( $1 -p 2>/dev/null | \ - awk '$3 = "=" { print $2 }' )" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -S = -W "$($1 -p 2>/dev/null | + awk '$3 = "=" { print $2 }')" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi return ;; @@ -30,9 +30,9 @@ _ccache() $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _ccache ccache + complete -F _ccache ccache # ex: filetype=sh diff --git a/completions/ccze b/completions/ccze index 887313d8b65..35f4c3f3314 100644 --- a/completions/ccze +++ b/completions/ccze @@ -6,38 +6,39 @@ _ccze() _init_completion -s || return case $prev in - -'?'|--help|--usage|-V|--version) + -'?' | --help | --usage | -V | --version) return ;; - --argument|--color|-!(-*)[ac]) + --argument | --color | -!(-*)[ac]) # TODO? return ;; - --rcfile|-!(-*)F) + --rcfile | -!(-*)F) _filedir return ;; - --mode|-!(-*)m) - COMPREPLY=( $( compgen -W "curses ansi html" -- "$cur" ) ) + --mode | -!(-*)m) + COMPREPLY=($(compgen -W "curses ansi html" -- "$cur")) return ;; - --option|-!(-*)o) + --option | -!(-*)o) local -a opts=(scroll wordcolor lookups transparent cssfile) - COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]/#/no}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '${opts[@]} ${opts[@]/#/no}' -- "$cur")) return ;; - --plugin|-!(-*)p) - COMPREPLY=( $( compgen -W '$( "$1" --list-plugins | - sed -ne "s/^\([a-z0-9]\{1,\}\)[[:space:]]\{1,\}|.*/\1/p" )' \ - -- "$cur" ) ) + --plugin | -!(-*)p) + COMPREPLY=($(compgen -W '$("$1" --list-plugins | command \ + sed -ne "s/^\([a-z0-9]\{1,\}\)[[:space:]]\{1,\}|.*/\1/p")' \ + -- "$cur")) return + ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _ccze ccze + complete -F _ccze ccze # ex: filetype=sh diff --git a/completions/cfagent b/completions/cfagent index fbf364eda41..e7ba04de0b2 100644 --- a/completions/cfagent +++ b/completions/cfagent @@ -6,16 +6,16 @@ _cfagent() _init_completion || return case $prev in - -f|--file) + -f | --file) _filedir return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _cfagent cfagent + complete -F _cfagent cfagent # ex: filetype=sh diff --git a/completions/cfrun b/completions/cfrun index f4d1f265418..72b613890a3 100644 --- a/completions/cfrun +++ b/completions/cfrun @@ -6,9 +6,9 @@ _cfrun() _init_completion || return local i section=1 - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == -- ]]; then - section=$((section + 1)) + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -- ]]; then + ((section++)) fi done @@ -21,27 +21,27 @@ _cfrun() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-f -h -d -S -T -v' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-f -h -d -S -T -v' -- "$cur")) else - hostfile=${CFINPUTS:-/var/lib/cfengine/inputs}/cfrun.hosts - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == -f ]]; then - hostfile=${words[i+1]} + local hostfile=${CFINPUTS:-/var/lib/cfengine/inputs}/cfrun.hosts + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -f ]]; then + hostfile=${words[i + 1]} break fi done [[ ! -f $hostfile ]] && return - COMPREPLY=( $(compgen -W "$( command grep -v \ - -E '(=|^$|^#)' $hostfile )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(command grep -v \ + -E '(=|^$|^#)' $hostfile)" -- "$cur")) fi ;; 2) - COMPREPLY=( $( compgen -W '$( _parse_help cfagent )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help cfagent)' -- "$cur")) ;; esac } && -complete -F _cfrun cfrun + complete -F _cfrun cfrun # ex: filetype=sh diff --git a/completions/chage b/completions/chage index ee8f211355a..fcf87cd49cd 100644 --- a/completions/chage +++ b/completions/chage @@ -6,11 +6,11 @@ _chage() _init_completion -s || return case $prev in - --lastday|--expiredate|--help|--inactive|--mindays|--maxdays|\ - --warndays|-!(-*)[dEhImMW]) + --lastday | --expiredate | --help | --inactive | --mindays | --maxdays | \ + --warndays | -!(-*)[dEhImMW]) return ;; - --root|-!(-*)R) + --root | -!(-*)R) _filedir -d return ;; @@ -18,13 +18,13 @@ _chage() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) } && -complete -F _chage chage + complete -F _chage chage # ex: filetype=sh diff --git a/completions/change_pw b/completions/change_pw index b0f2061fccf..04837ea96b5 100644 --- a/completions/change_pw +++ b/completions/change_pw @@ -6,7 +6,7 @@ _change_pw() _init_completion -s || return case $prev in - -l|--listname) + -l | --listname) _xfunc list_lists _mailman_lists return ;; @@ -14,12 +14,12 @@ _change_pw() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all --domain --listname --password --quiet - --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--all --domain --listname --password --quiet + --help' -- "$cur")) fi } && -complete -F _change_pw change_pw + complete -F _change_pw change_pw # ex: filetype=sh diff --git a/completions/check_db b/completions/check_db index 6f666173024..aaec99fdec3 100644 --- a/completions/check_db +++ b/completions/check_db @@ -5,13 +5,13 @@ _check_db() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--all --verbose --help' -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _check_db check_db + complete -F _check_db check_db # ex: filetype=sh diff --git a/completions/check_perms b/completions/check_perms index 0fb05b11baf..8ff276ef317 100644 --- a/completions/check_perms +++ b/completions/check_perms @@ -5,11 +5,11 @@ _check_perms() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-f -v -h' -- "$cur")) fi } && -complete -F _check_perms check_perms + complete -F _check_perms check_perms # ex: filetype=sh diff --git a/completions/checksec b/completions/checksec index 4e9fb60121f..deeb1be4b62 100644 --- a/completions/checksec +++ b/completions/checksec @@ -2,14 +2,14 @@ _checksec() { - local cur prev words cword - _init_completion || return + local cur prev words cword split + _init_completion -s || return case $prev in - --version|--help) + --version | --help) return ;; - --file|--fortify-file) + --file | --fortify-file) _filedir return ;; @@ -21,17 +21,34 @@ _checksec() _pnames return ;; - --proc-libs|--fortify-proc) + --proc-libs | --fortify-proc) _pids return ;; + --format) + COMPREPLY=($(compgen -W '$($1 --help 2>/dev/null | + command sed \ + -e "s/[{,}]/ /g" \ + -ne "s/^[[:space:]]*--format=//p" + )' -- "$cur")) + ;; + --output) + COMPREPLY=($(compgen -W '$($1 --help 2>/dev/null | + command sed \ + -e "s/[{,}]/ /g" \ + -ne "s/^[[:space:]]*--output=//p" + )' -- "$cur")) + ;; esac + $split && return + if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi } && -complete -F _checksec checksec + complete -F _checksec checksec # ex: filetype=sh diff --git a/completions/chgrp b/completions/chgrp index 986a77a6224..4793a45779a 100644 --- a/completions/chgrp +++ b/completions/chgrp @@ -7,7 +7,7 @@ _chgrp() cur=${cur//\\\\/} - if [[ "$prev" == --reference ]]; then + if [[ $prev == --reference ]]; then _filedir return fi @@ -15,25 +15,25 @@ _chgrp() $split && return # options completion - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then local w opts - for w in "${words[@]}" ; do - [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break + for w in "${words[@]}"; do + [[ $w == -@(R|-recursive) ]] && opts="-H -L -P" && break done - COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference + COMPREPLY=($(compgen -W '-c -h -f -R -v --changes --dereference --no-dereference --silent --quiet --reference --recursive --verbose - --help --version $opts' -- "$cur" ) ) + --help --version $opts' -- "$cur")) return fi # first parameter on line or first since an option? - if [[ $cword -eq 1 && "$cur" != -* || "$prev" == -* ]]; then + if [[ $cword -eq 1 && $cur != -* || $prev == -* ]]; then _allowed_groups "$cur" else _filedir fi } && -complete -F _chgrp chgrp + complete -F _chgrp chgrp # ex: filetype=sh diff --git a/completions/chkconfig b/completions/chkconfig index 8766b3a2105..8ff66376aab 100644 --- a/completions/chkconfig +++ b/completions/chkconfig @@ -6,32 +6,32 @@ _chkconfig() _init_completion -s || return case $prev in - --level=[1-6]|[1-6]|--list|--add|--del|--override) + --level=[1-6] | [1-6] | --list | --add | --del | --override) _services _xinetd_services return ;; --level) - COMPREPLY=( $( compgen -W '{1..6}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..6}' -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--list --add --del --override --level' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--list --add --del --override --level' \ + -- "$cur")) else - if [[ $cword -eq 2 || $cword -eq 4 ]]; then - COMPREPLY=( $( compgen -W 'on off reset resetpriorities' \ - -- "$cur" ) ) + if ((cword == 2 || cword == 4)); then + COMPREPLY=($(compgen -W 'on off reset resetpriorities' \ + -- "$cur")) else _services _xinetd_services fi fi } && -complete -F _chkconfig chkconfig + complete -F _chkconfig chkconfig # ex: filetype=sh diff --git a/completions/chmod b/completions/chmod index a3b50afd576..95b8278c8c5 100644 --- a/completions/chmod +++ b/completions/chmod @@ -6,7 +6,7 @@ _chmod() _init_completion -s || return case $prev in - --help|--version) + --help | --version) return ;; --reference) @@ -17,22 +17,26 @@ _chmod() $split && return - if [[ $cur == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + # Adapted from coreutils 8.28 chmod man page + local modearg="-@(@(+([rwxXst])|[ugo])|+([0-7]))" + + # shellcheck disable=SC2053 + if [[ $cur == -* && $cur != $modearg ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local args - _count_args + _count_args "" "" "$modearg" case $args in - 1) ;; # mode + 1) ;; # mode *) _filedir ;; esac } && -complete -F _chmod chmod + complete -F _chmod chmod # ex: filetype=sh diff --git a/completions/chown b/completions/chown index c4479dd274e..1d746b7a26f 100644 --- a/completions/chown +++ b/completions/chown @@ -19,28 +19,28 @@ _chown() $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # Complete -options local w opts - for w in "${words[@]}" ; do - [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break + for w in "${words[@]}"; do + [[ $w == -@(R|-recursive) ]] && opts="-H -L -P" && break done - COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference + COMPREPLY=($(compgen -W '-c -h -f -R -v --changes --dereference --no-dereference --from --silent --quiet --reference --recursive - --verbose --help --version $opts' -- "$cur" ) ) + --verbose --help --version $opts' -- "$cur")) else local args # The first argument is an usergroup; the rest are filedir. _count_args : - if [[ $args -eq 1 ]]; then + if ((args == 1)); then _usergroup -u else _filedir fi fi } && -complete -F _chown chown + complete -F _chown chown # ex: filetype=sh diff --git a/completions/chpasswd b/completions/chpasswd index 1e24a1769cf..3abea9981dd 100644 --- a/completions/chpasswd +++ b/completions/chpasswd @@ -6,15 +6,15 @@ _chpasswd() _init_completion -s || return case $prev in - --crypt|-!(-*)c) - COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \ - -- "$cur" ) ) + --crypt | -!(-*)c) + COMPREPLY=($(compgen -W 'DES MD5 NONE SHA256 SHA512' \ + -- "$cur")) return ;; - --sha-rounds|-!(-*)s) + --sha-rounds | -!(-*)s) return ;; - --root|-!(-*)R) + --root | -!(-*)R) _filedir -d return ;; @@ -22,9 +22,9 @@ _chpasswd() $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _chpasswd chpasswd + complete -F _chpasswd chpasswd # ex: filetype=sh diff --git a/completions/chromium-browser b/completions/chromium-browser index a57b17280bf..9ee989629e5 100644 --- a/completions/chromium-browser +++ b/completions/chromium-browser @@ -3,18 +3,33 @@ _chromium_browser() { local cur prev words cword split - _init_completion -s || return + _init_completion -s -n : || return case $prev in - --help|--app|--proxy-server|--proxy-pac-url|-h) + --help | --app | --proxy-pac-url | -h) return ;; --user-data-dir) _filedir -d return ;; + --proxy-server) + case $cur in + *://*) + local prefix="${cur%%://*}://" + _known_hosts_real -- "${cur#*://}" + COMPREPLY=("${COMPREPLY[@]/#/$prefix}") + __ltrim_colon_completions "$cur" + ;; + *) + compopt -o nospace + COMPREPLY=($(compgen -S :// -W 'http socks socks4 socks5' -- "$cur")) + ;; + esac + return + ;; --password-store) - COMPREPLY=( $( compgen -W 'basic gnome kwallet' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'basic gnome kwallet' -- "$cur")) return ;; esac @@ -22,14 +37,14 @@ _chromium_browser() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - _filedir "@(?([xs])htm?(l)|pdf)" + _filedir "@(?([mxs])htm?(l)|pdf|txt)" } && -complete -F _chromium_browser chromium-browser google-chrome \ - google-chrome-stable chromium chrome + complete -F _chromium_browser chromium-browser google-chrome \ + google-chrome-stable chromium chrome # ex: filetype=sh diff --git a/completions/chronyc b/completions/chronyc index 53b87e4614c..27bd8ef961e 100644 --- a/completions/chronyc +++ b/completions/chronyc @@ -2,12 +2,14 @@ _chronyc_command_args() { - local -a args=( $( compgen -W "$( $1 help 2>/dev/null | \ - awk '/^'$prev'\s[^ []/ { gsub("\\|", " ", $2); print $2 }' )" ) ) + local -a args + args=($(compgen -W "$($1 help 2>/dev/null | + awk '/^'$prev'\s[^ []/ { gsub("\\|", " ", $2); print $2 }')")) case $args in \) _known_hosts_real -- "$cur" ;; \<*) ;; - *) COMPREPLY+=( $( compgen -W '${args[@]}' -- "$cur" ) ) ;; + *) ((${#args[@]})) && + COMPREPLY+=($(compgen -W '"${args[@]}"' -- "$cur")) ;; esac } @@ -17,7 +19,7 @@ _chronyc() _init_completion || return case $prev in - --help|-*p) + --help | -*p) return ;; -*h) @@ -27,26 +29,27 @@ _chronyc() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -6' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1") -6' -- "$cur")) return fi - local i args=0 - for (( i=1; i < cword; i++ )); do - [[ ${words[i]} != -* && ${words[i-1]} != @(-p|-h) ]] && (( args++ )) + local i args + args=0 + for ((i = 1; i < cword; i++)); do + [[ ${words[i]} != -* && ${words[i - 1]} != @(-p|-h) ]] && ((args++)) done case $args in 0) - COMPREPLY=( $( compgen -W "$( $1 help 2>/dev/null | \ - awk '!/(^ |: *$)/ { sub("\\|", " ", $1); print $1 }' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 help 2>/dev/null | + awk '!/(^ |: *$)/ { sub("\\|", " ", $1); print $1 }')" \ + -- "$cur")) ;; 1) _chronyc_command_args "$1" - if [[ ! $COMPREPLY && $prev == sources?(tats) ]]; then + if [[ ! ${COMPREPLY-} && $prev == sources?(tats) ]]; then # [-v] not handled by _chronyc_command_args yet - COMPREPLY=( $( compgen -W '-v' -- "$cur" ) ) + COMPREPLY=($(compgen -W '-v' -- "$cur")) fi ;; 2) @@ -54,6 +57,6 @@ _chronyc() ;; esac } && -complete -F _chronyc chronyc + complete -F _chronyc chronyc # ex: filetype=sh diff --git a/completions/chrpath b/completions/chrpath index 8d2b4558446..2883967b1f9 100644 --- a/completions/chrpath +++ b/completions/chrpath @@ -6,22 +6,22 @@ _chrpath() _init_completion || return case $prev in - --version|--help|-!(-*)[vh]) + --version | --help | -!(-*)[vh]) return ;; - --replace|-!(-*)r) + --replace | -!(-*)r) _filedir -d return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _filedir } && -complete -F _chrpath chrpath + complete -F _chrpath chrpath # ex: filetype=sh diff --git a/completions/cksfv b/completions/cksfv index 346e0605bd7..da404ddadab 100644 --- a/completions/cksfv +++ b/completions/cksfv @@ -5,13 +5,13 @@ _cksfv() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi case "$prev" in - -*C|-*g) + -*C | -*g) _filedir -d return ;; @@ -24,6 +24,6 @@ _cksfv() _filedir } && -complete -F _cksfv cksfv + complete -F _cksfv cksfv # ex: filetype=sh diff --git a/completions/cleanarch b/completions/cleanarch index edac34f80d6..0f7d5f5722a 100644 --- a/completions/cleanarch +++ b/completions/cleanarch @@ -5,12 +5,12 @@ _cleanarch() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--status --dry-run --quiet --help' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--status --dry-run --quiet --help' \ + -- "$cur")) fi } && -complete -F _cleanarch cleanarch + complete -F _cleanarch cleanarch # ex: filetype=sh diff --git a/completions/clisp b/completions/clisp index 23b04f04a4a..c4259a00dd8 100644 --- a/completions/clisp +++ b/completions/clisp @@ -8,15 +8,15 @@ _clisp() _init_completion || return # completing an option (may or may not be separated by a space) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help --version --license -B -K -M -m -L + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-h --help --version --license -B -K -M -m -L -N -E -q --quiet --silent -w -I -ansi -traditional -p -C -norc -i - -c -l -o -x ' -- "$cur" ) ) + -c -l -o -x ' -- "$cur")) else _filedir fi } && -complete -F _clisp -o default clisp + complete -F _clisp -o default clisp # ex: filetype=sh diff --git a/completions/clone_member b/completions/clone_member index fe45e494cad..a3ca2b31b68 100644 --- a/completions/clone_member +++ b/completions/clone_member @@ -6,7 +6,7 @@ _clone_member() _init_completion -s || return case $prev in - -l|--listname) + -l | --listname) _xfunc list_lists _mailman_lists return ;; @@ -14,12 +14,12 @@ _clone_member() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listname --remove --admin --quiet - --nomodify --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--listname --remove --admin --quiet + --nomodify --help' -- "$cur")) fi } && -complete -F _clone_member clone_member + complete -F _clone_member clone_member # ex: filetype=sh diff --git a/completions/complete b/completions/complete index dd34c3cafa1..caf5dfdaa5a 100644 --- a/completions/complete +++ b/completions/complete @@ -7,43 +7,44 @@ _complete() case $prev in -*o) - COMPREPLY=( $( compgen -W 'bashdefault default dirnames filenames - nospace plusdirs' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'bashdefault default dirnames filenames + nospace plusdirs' -- "$cur")) return ;; -*A) - COMPREPLY=( $( compgen -W 'alias arrayvar binding builtin command + COMPREPLY=($(compgen -W 'alias arrayvar binding builtin command directory disabled enabled export file function group helptopic hostname job keyword running service setopt shopt signal - stopped user variable' -- "$cur" ) ) + stopped user variable' -- "$cur")) return ;; -*C) - COMPREPLY=( $( compgen -A command -- "$cur" ) ) + COMPREPLY=($(compgen -A command -- "$cur")) return ;; -*F) - COMPREPLY=( $( compgen -A function -- "$cur" ) ) + COMPREPLY=($(compgen -A function -- "$cur")) return ;; - -*p|-*r) - COMPREPLY=( $( complete -p | command sed -e 's|.* ||' ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + -*p | -*r) + COMPREPLY=($(complete -p | command sed -e 's|.* ||')) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # relevant options completion - local opts="-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X" - [[ $1 != compgen ]] && opts+=" -F -C" - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local -a opts=(-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X) + [[ $1 != compgen ]] && opts+=(-F -C) + COMPREPLY=($(compgen -W '${opts[@]}' -- "$cur")) else - COMPREPLY=( $( compgen -A command -- "$cur" ) ) + COMPREPLY=($(compgen -A command -- "$cur")) fi } && -complete -F _complete compgen complete + complete -F _complete compgen complete # ex: filetype=sh diff --git a/completions/config_list b/completions/config_list index 653c628ae17..1807e338263 100644 --- a/completions/config_list +++ b/completions/config_list @@ -6,7 +6,7 @@ _config_list() _init_completion -s || return case $prev in - -i|-o|--inputfile|--outputfile) + -i | -o | --inputfile | --outputfile) _filedir return ;; @@ -14,14 +14,14 @@ _config_list() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--inputfile --outputfile --checkonly - --verbose --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--inputfile --outputfile --checkonly + --verbose --help' -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _config_list config_list + complete -F _config_list config_list # ex: filetype=sh diff --git a/completions/configure b/completions/configure index 0e37726b2a5..72560960e44 100644 --- a/completions/configure +++ b/completions/configure @@ -6,37 +6,38 @@ _configure() _init_completion -s || return case $prev in - -h|--help|-V|--version|--program-prefix|--program-suffix|\ - --program-transform-name) + -h | --help | -V | --version | --program-prefix | --program-suffix | \ + --program-transform-name) return ;; --*file) _filedir return ;; - --*prefix|--*dir) + --*prefix | --*dir) _filedir -d return ;; esac - $split && return + if $split || [[ $cur != -* ]]; then + _filedir + return + fi # if $COMP_CONFIGURE_HINTS is not null, then completions of the form # --option=SETTING will include 'SETTING' as a contextual hint - [[ "$cur" != -* ]] && return - - if [[ -n $COMP_CONFIGURE_HINTS ]]; then - COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ + if [[ ${COMP_CONFIGURE_HINTS-} ]]; then + COMPREPLY=($(compgen -W "$($1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; \ - if ($2 ~ /--[A-Za-z]/) print $2 }' | command sed -e 's/[[,].*//g' )" \ - -- "$cur" ) ) - [[ $COMPREPLY == *=* ]] && compopt -o nospace + if ($2 ~ /--[A-Za-z]/) print $2 }' | command sed -e 's/[[,].*//g')" \ + -- "$cur")) + [[ ${COMPREPLY-} == *=* ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _configure configure + complete -F _configure configure # ex: filetype=sh diff --git a/completions/convert b/completions/convert index 59647d59929..a2d95cd107c 100644 --- a/completions/convert +++ b/completions/convert @@ -4,122 +4,122 @@ _ImageMagick() { case $prev in -channel) - COMPREPLY=( $( compgen -W 'Red Green Blue Opacity Matte Cyan - Magenta Yellow Black' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Red Green Blue Opacity Matte Cyan + Magenta Yellow Black' -- "$cur")) return ;; -colormap) - COMPREPLY=( $( compgen -W 'shared private' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'shared private' -- "$cur")) return ;; -colorspace) - COMPREPLY=( $( compgen -W 'GRAY OHTA RGB Transparent XYZ YCbCr YIQ - YPbPr YUV CMYK' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'GRAY OHTA RGB Transparent XYZ YCbCr YIQ + YPbPr YUV CMYK' -- "$cur")) return ;; -compose) - COMPREPLY=( $( compgen -W 'Over In Out Atop Xor Plus Minus Add + COMPREPLY=($(compgen -W 'Over In Out Atop Xor Plus Minus Add Subtract Difference Multiply Bumpmap Copy CopyRed CopyGreen - CopyBlue CopyOpacity' -- "$cur" ) ) + CopyBlue CopyOpacity' -- "$cur")) return ;; -compress) - COMPREPLY=( $( compgen -W 'None BZip Fax Group4 JPEG Lossless LZW - RLE Zip' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'None BZip Fax Group4 JPEG Lossless LZW + RLE Zip' -- "$cur")) return ;; -dispose) - COMPREPLY=( $( compgen -W 'Undefined None Background Previous' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Undefined None Background Previous' \ + -- "$cur")) return ;; -encoding) - COMPREPLY=( $( compgen -W 'AdobeCustom AdobeExpert AdobeStandard + COMPREPLY=($(compgen -W 'AdobeCustom AdobeExpert AdobeStandard AppleRoman BIG5 GB2312 Latin2 None SJIScode Symbol Unicode - Wansung' -- "$cur" ) ) + Wansung' -- "$cur")) return ;; -endian) - COMPREPLY=( $( compgen -W 'MSB LSB' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'MSB LSB' -- "$cur")) return ;; -filter) - COMPREPLY=( $( compgen -W 'Point Box Triangle Hermite Hanning + COMPREPLY=($(compgen -W 'Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell - Lanczos Bessel Sinc' -- "$cur" ) ) + Lanczos Bessel Sinc' -- "$cur")) return ;; -format) - COMPREPLY=( $( compgen -W "$( convert -list format | awk \ - '/ [r-][w-][+-] / { sub("[*]$","",$1); print tolower($1) }' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(convert -list format | awk \ + '/ [r-][w-][+-] / { sub("[*]$","",$1); print tolower($1) }')" \ + -- "$cur")) return ;; -gravity) - COMPREPLY=( $( compgen -W 'Northwest North NorthEast West Center - East SouthWest South SouthEast' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Northwest North NorthEast West Center + East SouthWest South SouthEast' -- "$cur")) return ;; -intent) - COMPREPLY=( $( compgen -W 'Absolute Perceptual Relative - Saturation' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Absolute Perceptual Relative + Saturation' -- "$cur")) return ;; -interlace) - COMPREPLY=( $( compgen -W 'None Line Plane Partition' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'None Line Plane Partition' -- "$cur")) return ;; -limit) - COMPREPLY=( $( compgen -W 'Disk File Map Memory' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Disk File Map Memory' -- "$cur")) return ;; -list) - COMPREPLY=( $( compgen -W 'Delegate Format Magic Module Resource - Type' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Delegate Format Magic Module Resource + Type' -- "$cur")) return ;; -map) - COMPREPLY=( $( compgen -W 'best default gray red green blue' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'best default gray red green blue' \ + -- "$cur")) _filedir return ;; -noise) - COMPREPLY=( $( compgen -W 'Uniform Gaussian Multiplicative - Impulse Laplacian Poisson' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Uniform Gaussian Multiplicative + Impulse Laplacian Poisson' -- "$cur")) return ;; -preview) - COMPREPLY=( $( compgen -W 'Rotate Shear Roll Hue Saturation + COMPREPLY=($(compgen -W 'Rotate Shear Roll Hue Saturation Brightness Gamma Spiff Dull Grayscale Quantize Despeckle - ReduceNoise AddNoise Sharpen Blur Treshold EdgeDetect Spread + ReduceNoise AddNoise Sharpen Blur Threshold EdgeDetect Spread Shade Raise Segment Solarize Swirl Implode Wave OilPaint - CharcoalDrawing JPEG' -- "$cur" ) ) + CharcoalDrawing JPEG' -- "$cur")) return ;; - -mask|-profile|-texture|-tile|-write) + -mask | -profile | -texture | -tile | -write) _filedir return ;; -type) - COMPREPLY=( $( compgen -W 'Bilevel Grayscale Palette PaletteMatte + COMPREPLY=($(compgen -W 'Bilevel Grayscale Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationlMatte - Optimize' -- "$cur" ) ) + Optimize' -- "$cur")) return ;; -units) - COMPREPLY=( $( compgen -W 'Undefined PixelsPerInch - PixelsPerCentimeter' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Undefined PixelsPerInch + PixelsPerCentimeter' -- "$cur")) return ;; -virtual-pixel) - COMPREPLY=( $( compgen -W 'Constant Edge mirror tile' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'Constant Edge mirror tile' -- "$cur")) return ;; -visual) - COMPREPLY=( $( compgen -W 'StaticGray GrayScale StaticColor - PseudoColor TrueColor DirectColor defaut visualid' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'StaticGray GrayScale StaticColor + PseudoColor TrueColor DirectColor default visualid' \ + -- "$cur")) return ;; esac @@ -134,17 +134,17 @@ _convert() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+adjoin +append +compress +contrast +debug + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+adjoin +append +compress +contrast +debug +dither +endian +gamma +label +map +mask +matte +negate +noise - +page +raise +render +write' -- "$cur" ) ) + +page +raise +render +write' -- "$cur")) else _filedir fi } && -complete -F _convert convert + complete -F _convert convert _mogrify() { @@ -153,16 +153,16 @@ _mogrify() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither +endian - +gamma +label +map +mask +matte +negate +page +raise' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+compress +contrast +debug +dither +endian + +gamma +label +map +mask +matte +negate +page +raise' -- "$cur")) else _filedir fi } && -complete -F _mogrify mogrify + complete -F _mogrify mogrify _display() { @@ -171,16 +171,16 @@ _display() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither +endian - +gamma +label +map +matte +negate +page +raise +write' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+compress +contrast +debug +dither +endian + +gamma +label +map +matte +negate +page +raise +write' -- "$cur")) else _filedir fi } && -complete -F _display display + complete -F _display display _animate() { @@ -189,16 +189,16 @@ _animate() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug +dither +gamma +map +matte' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+debug +dither +gamma +map +matte' \ + -- "$cur")) else _filedir fi } && -complete -F _animate animate + complete -F _animate animate _identify() { @@ -207,15 +207,15 @@ _identify() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+debug' -- "$cur")) else _filedir fi } && -complete -F _identify identify + complete -F _identify identify _montage() { @@ -224,16 +224,16 @@ _montage() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+adjoin +compress +debug +dither +endian - +gamma +label +matte +page' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+adjoin +compress +debug +dither +endian + +gamma +label +matte +page' -- "$cur")) else _filedir fi } && -complete -F _montage montage + complete -F _montage montage _composite() { @@ -242,16 +242,16 @@ _composite() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +debug +dither +endian +label - +matte +negate +page +write' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+compress +debug +dither +endian +label + +matte +negate +page +write' -- "$cur")) else _filedir fi } && -complete -F _composite composite + complete -F _composite composite _compare() { @@ -260,15 +260,15 @@ _compare() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+debug' -- "$cur")) else _filedir fi } && -complete -F _compare compare + complete -F _compare compare _conjure() { @@ -277,15 +277,15 @@ _conjure() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+debug' -- "$cur")) else _filedir fi } && -complete -F _conjure conjure + complete -F _conjure conjure _import() { @@ -294,15 +294,15 @@ _import() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+debug' -- "$cur")) else _filedir fi } && -complete -F _import import + complete -F _import import _stream() { @@ -311,14 +311,14 @@ _stream() _ImageMagick && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W '+debug' -- "$cur")) else _filedir fi } && -complete -F _stream stream + complete -F _stream stream # ex: filetype=sh diff --git a/completions/cowsay b/completions/cowsay index 4f4411acca9..6ba1d0fb1b5 100644 --- a/completions/cowsay +++ b/completions/cowsay @@ -7,17 +7,17 @@ _cowsay() case $prev in -f) - COMPREPLY=( $( compgen -W \ - '$( cowsay -l 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + '$(cowsay -l 2>/dev/null | tail -n +2)' -- "$cur")) return ;; esac # relevant options completion - COMPREPLY=( $( compgen -W '-b -d -g -p -s -t -w -y -e -f -h -l -n -T -W' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '-b -d -g -p -s -t -w -y -e -f -h -l -n -T -W' \ + -- "$cur")) } && -complete -F _cowsay -o default cowsay cowthink + complete -F _cowsay -o default cowsay cowthink # ex: filetype=sh diff --git a/completions/cpan2dist b/completions/cpan2dist index 9704782d020..b5e59dae9f9 100644 --- a/completions/cpan2dist +++ b/completions/cpan2dist @@ -8,30 +8,30 @@ _cpan2dist() case $prev in --format) # should remove ":" from COMP_WORDBREAKS, but doesn't work (?) - COMPREPLY=( $( compgen -W '$(perl -MCPANPLUS::Dist -e \ + COMPREPLY=($(compgen -W '$(perl -MCPANPLUS::Dist -e \ "print map { \"\$_\n\" } CPANPLUS::Dist->dist_types")' \ - -- "$cur" ) ) + -- "$cur")) return ;; - --banlist|--ignorelist|--modulelist|--logfile) + --banlist | --ignorelist | --modulelist | --logfile) _filedir return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else - local cpandirs=( "$HOME/.cpanplus/" "$HOME/.cpan/source/modules/" ) + local cpandirs=("$HOME/.cpanplus/" "$HOME/.cpan/source/modules/") local packagelist - for dir in ${cpandirs[@]}; do - [[ -d "$dir" && -r "$dir/02packages.details.txt.gz" ]] && \ + for dir in "${cpandirs[@]}"; do + [[ -d $dir && -r "$dir/02packages.details.txt.gz" ]] && packagelist="$dir/02packages.details.txt.gz" done - [[ $packagelist ]] && COMPREPLY=( $( zgrep "^${cur//-/::}" \ - $packagelist 2>/dev/null | awk '{print $1}' | command sed -e 's/::/-/g' ) ) + [[ -v packagelist ]] && COMPREPLY=($(zgrep "^${cur//-/::}" \ + $packagelist 2>/dev/null | awk '{print $1}' | command sed -e 's/::/-/g')) fi } && -complete -F _cpan2dist -o default cpan2dist + complete -F _cpan2dist -o default cpan2dist # ex: filetype=sh diff --git a/completions/cpio b/completions/cpio index 0c6e1962768..d6fde0c361b 100644 --- a/completions/cpio +++ b/completions/cpio @@ -7,46 +7,46 @@ _cpio() # --name value style option case $prev in - --format|-!(-*)H) - COMPREPLY=( $( compgen -W \ - 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) ) + --format | -!(-*)H) + COMPREPLY=($(compgen -W \ + 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur")) return ;; - --file|--pattern-file|-!(-*)[EFI]) + --file | --pattern-file | -!(-*)[EFI]) _filedir return ;; - --owner|-!(-*)R) + --owner | -!(-*)R) _usergroup return ;; --rsh-command) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) return ;; esac $split && return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through - -? --help --license --usage --version' -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -W '-o --create -i --extract -p --pass-through + -? --help --license --usage --version' -- "$cur")) else case ${words[1]} in - -o|--create) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-0 -a -c -v -A -B -L -V -C -H -M + -o | --create) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-0 -a -c -v -A -B -L -V -C -H -M -O -F --file --format --message --null --reset-access-time --verbose --dot --append --block-size --dereference --io-size --quiet --force-local --rsh-command --help --version' \ - -- "$cur" ) ) + -- "$cur")) fi ;; - -i|--extract) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-b -c -d -f -m -n -r -t -s -u -v + -i | --extract) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-b -c -d -f -m -n -r -t -s -u -v -B -S -V -C -E -H -M -R -I -F --file --make-directories --nonmatching --preserve-modification-time --numeric-uid-gid --rename --list --swap-bytes --swap @@ -55,17 +55,17 @@ _cpio() --owner --no-preserve-owner --message --force-local --no-absolute-filenames --sparse --only-verify-crc --quiet --rsh-command --help --to-stdout --version' \ - -- "$cur" ) ) + -- "$cur")) fi ;; - -p*|--pass-through) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-0 -a -d -l -m -u -v -L -V -R + -p* | --pass-through) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-0 -a -d -l -m -u -v -L -V -R --null --reset-access-time --make-directories --link --quiet --preserve-modification-time --unconditional --verbose --dot --dereference --owner --no-preserve-owner --sparse --help --version' \ - -- "$cur" ) ) + -- "$cur")) else _filedir -d fi @@ -73,6 +73,6 @@ _cpio() esac fi } && -complete -F _cpio cpio + complete -F _cpio cpio # ex: filetype=sh diff --git a/completions/cppcheck b/completions/cppcheck index 86990dd5fb0..8ea9571536d 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -6,36 +6,36 @@ _cppcheck() _init_completion -s || return case $prev in - --append|--exitcode-suppressions|--rule-file|--config-excludes-file|\ - --suppressions-list|--includes-file|--include|-i) + --append | --exitcode-suppressions | --rule-file | --config-excludes-file | \ + --suppressions-list | --includes-file | --include | -i) _filedir return ;; - -D|-U|--rule|--suppress|--template|--max-configs|-h|--help|--version|\ - --errorlist|--config-exclude|-l) + -D | -U | --rule | --suppress | --template | --max-configs | -h | --help | --version | \ + --errorlist | --config-exclude | -l) return ;; --enable) # split comma-separated list split=false - if [[ "$cur" == ?*,* ]]; then + if [[ $cur == ?*,* ]]; then prev="${cur%,*}" cur="${cur##*,}" split=true fi - COMPREPLY=( $( compgen -W 'all warning style performance + COMPREPLY=($(compgen -W 'all warning style performance portability information unusedFunction missingInclude' \ - -- "$cur" ) ) - $split && COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} ) + -- "$cur")) + $split && COMPREPLY=(${COMPREPLY[@]/#/"$prev,"}) return ;; --error-exitcode) - COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..255}' -- "$cur")) return ;; --file-list) _filedir - [[ -z $cur || $cur == - ]] && COMPREPLY+=( - ) + [[ -z $cur || $cur == - ]] && COMPREPLY+=(-) return ;; -I) @@ -43,25 +43,25 @@ _cppcheck() return ;; -j) - COMPREPLY=( $( compgen -W "{2..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=($(compgen -W "{2..$(_ncpus)}" -- "$cur")) return ;; - --language|-x) - COMPREPLY=( $( compgen -W 'c c++' -- "$cur" ) ) + --language | -x) + COMPREPLY=($(compgen -W 'c c++' -- "$cur")) return ;; --std) - COMPREPLY=( $( compgen -W 'c89 c99 c11 c++03 c++11 posix' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'c89 c99 c11 c++03 c++11 c++14 c++17 + c++20' -- "$cur")) return ;; --platform) _filedir - COMPREPLY+=( $( compgen -W 'unix32 unix64 win32A win32W win64 - native' -- "$cur" ) ) + COMPREPLY+=($(compgen -W 'unix32 unix64 win32A win32W win64 + native' -- "$cur")) return ;; - -rp|--relative-paths) + -rp | --relative-paths) if $split; then # -rp without argument is allowed _filedir -d return @@ -72,7 +72,7 @@ _cppcheck() return ;; --xml-version) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + COMPREPLY=($(compgen -W '1 2' -- "$cur")) return ;; esac @@ -80,12 +80,12 @@ _cppcheck() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _filedir '@([cht]pp|[cht]xx|cc|[ch]++|[ch])' fi } && -complete -F _cppcheck cppcheck + complete -F _cppcheck cppcheck # ex: filetype=sh diff --git a/completions/crontab b/completions/crontab index 59a41238b3c..672220da35d 100644 --- a/completions/crontab +++ b/completions/crontab @@ -12,37 +12,37 @@ _crontab() ;; esac - local -A opts=( [-u]= [-l]= [-r]= [-e]= ) + local -A opts=([-u]="" [-l]="" [-r]="" [-e]="") [[ $OSTYPE == *linux* ]] && opts[-i]= [[ -d /sys/fs/selinux || -d /selinux ]] && opts[-s]= local i - for (( i=0; i < ${#words[@]}-1; i++ )); do - [[ ${words[i]} ]] && unset "opts[${words[i]}]" + for i in "${!words[@]}"; do + [[ ${words[i]} && $i -ne $cword ]] && unset -v "opts[${words[i]}]" case "${words[i]}" in -l) - unset 'opts[-r]' 'opts[-e]' 'opts[-i]' 'opts[-s]' + unset -v 'opts[-r]' 'opts[-e]' 'opts[-i]' 'opts[-s]' ;; -e) - unset 'opts[-l]' 'opts[-r]' 'opts[-i]' + unset -v 'opts[-l]' 'opts[-r]' 'opts[-i]' ;; -r) - unset 'opts[-l]' 'opts[-e]' + unset -v 'opts[-l]' 'opts[-e]' ;; -u) - unset 'opts[-i]' + unset -v 'opts[-i]' ;; esac done - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '${!opts[@]}' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '${!opts[@]}' -- "$cur")) return fi # do filenames only if we did not have -l, -r, or -e - [[ "${words[@]}" == *\ -[lre]* ]] || _filedir + [[ ${words[*]} == *\ -[lre]* ]] || _filedir } && -complete -F _crontab crontab + complete -F _crontab crontab # ex: filetype=sh diff --git a/completions/cryptsetup b/completions/cryptsetup index a98d67b1c1e..e73e165e8a2 100644 --- a/completions/cryptsetup +++ b/completions/cryptsetup @@ -2,8 +2,7 @@ _cryptsetup_name() { - COMPREPLY=( $( compgen -X control -W '$( command ls /dev/mapper )' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -X control -W '$(command ls /dev/mapper)' -- "$cur")) } _cryptsetup_device() @@ -18,16 +17,16 @@ _cryptsetup() _init_completion -s || return case $prev in - --help|--version|--cipher|--hash|--*-size|--key-slot|--size|--offset|\ - --skip|--iter-time|--timeout|--tries|-!(-*)[chslSbopitT]) + --help | --version | --cipher | --hash | --*-size | --key-slot | --size | --offset | \ + --skip | --iter-time | --timeout | --tries | -!(-*)[chslSbopitT]) return ;; - --key-file|--master-key-file|--header-backup-file|-!(-*)d) + --key-file | --master-key-file | --header-backup-file | -!(-*)d) _filedir return ;; - --type|-!(-*)M) - COMPREPLY=( $( compgen -W "luks plain loopaes tcrypt" -- "$cur" ) ) + --type | -!(-*)M) + COMPREPLY=($(compgen -W "luks plain loopaes tcrypt" -- "$cur")) return ;; esac @@ -37,19 +36,20 @@ _cryptsetup() local arg _get_first_arg if [[ -z $arg ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W 'open close resize status benchmark + COMPREPLY=($(compgen -W 'open close resize status benchmark repair erase luksFormat luksAddKey luksRemoveKey luksChangeKey luksKillSlot luksUUID isLuks luksDump tcryptDump luksSuspend - luksResume luksHeaderBackup luksHeaderRestore' -- "$cur" ) ) + luksResume luksHeaderBackup luksHeaderRestore' -- "$cur")) fi else - local args; _count_args "" "-!(-*)[chslSbopitTdM]" + local args + _count_args "" "-!(-*)[chslSbopitTdM]" case $arg in - open|create|luksOpen|loopaesOpen|tcryptOpen) + open | create | luksOpen | loopaesOpen | tcryptOpen) case $args in 2) _cryptsetup_device @@ -59,15 +59,15 @@ _cryptsetup() ;; esac ;; - close|remove|luksClose|loopaesClose|tcryptClose|status|resize|\ - luksSuspend|luksResume) + close | remove | luksClose | loopaesClose | tcryptClose | status | resize | \ + luksSuspend | luksResume) case $args in 2) _cryptsetup_name ;; esac ;; - luksFormat|luksAddKey|luksRemoveKey) + luksFormat | luksAddKey | luksRemoveKey | luksChangeKey) case $args in 2) _cryptsetup_device @@ -77,27 +77,27 @@ _cryptsetup() ;; esac ;; - luksKillSlot|luksDelKey|luksUUID|isLuks|luksDump) + luksKillSlot | luksDelKey | luksUUID | isLuks | luksDump) case $args in 2) _cryptsetup_device ;; esac ;; - luksHeaderBackup|luksHeaderRestore) + luksHeaderBackup | luksHeaderRestore) case $args in 2) _cryptsetup_device ;; 3) - COMPREPLY=( '--header-backup-file' ) + COMPREPLY=('--header-backup-file') ;; - esac + esac ;; esac fi } && -complete -F _cryptsetup cryptsetup + complete -F _cryptsetup cryptsetup # ex: filetype=sh diff --git a/completions/curl b/completions/curl index 6bc4ba8e112..c1d972c4986 100644 --- a/completions/curl +++ b/completions/curl @@ -6,90 +6,162 @@ _curl() _init_completion || return case $prev in - --ciphers|--connect-timeout|--continue-at|--form|--form-string|\ - --ftp-account|--ftp-alternative-to-user|--ftp-port|--header|--help|\ - --hostpubmd5|--keepalive-time|--krb|--limit-rate|--local-port|\ - --mail-from|--mail-rcpt|--max-filesize|--max-redirs|--max-time|--pass|\ - --proto|--proto-redir|--proxy-user|--proxy1.0|--quote|--range|\ - --request|--retry|--retry-delay|--retry-max-time|\ - --socks5-gssapi-service|--telnet-option|--tftp-blksize|--time-cond|\ - --url|--user|--user-agent|--version|--write-out|--resolve|--tlsuser|\ - --tlspassword|-!(-*)[CFPHhmQrXtzuAVw]) - return - ;; - --config|--cookie|--cookie-jar|--dump-header|--egd-file|\ - --key|--libcurl|--output|--random-file|--upload-file|--trace|\ - --trace-ascii|--netrc-file|-!(-*)[KbcDoT]) + --abstract-unix-socket | --alt-svc | --config | --cookie | \ + --cookie-jar | --dump-header | --egd-file | --etag-compare | \ + --etag-save | --hsts | --key | --libcurl | --netrc-file | \ + --output | --proxy-key | --random-file | --trace | --trace-ascii | \ + --unix-socket | --upload-file | -!(-*)[KbcDoT]) _filedir return ;; - --cacert|--cert|-!(-*)E) + --ciphers | --connect-timeout | --connect-to | --continue-at | \ + --curves | --data-raw | --doh-url | --expect100-timeout | --form | \ + --form-string | --ftp-account | --ftp-alternative-to-user | \ + --happy-eyeballs-timeout-ms | --hostpubmd5 | --keepalive-time | \ + --limit-rate | --local-port | --login-options | --mail-auth | \ + --mail-from | --mail-rcpt | --max-filesize | --max-redirs | \ + --max-time | --pass | --proto | --proto-default | --proto-redir | \ + --proxy-ciphers | --proxy-pass | --proxy-service-name | \ + --proxy-tls13-ciphers | --proxy-tlspassword | --proxy-tlsuser | \ + --proxy-user | --proxy1.0 | --quote | --range | --referer | \ + --resolve | --retry | --retry-delay | --retry-max-time | \ + --sasl-authzid | --service-name | --socks5-gssapi-service | \ + --speed-limit | --speed-time | --telnet-option | --tftp-blksize | \ + --time-cond | --tls13-ciphers | --tlspassword | --tlsuser | \ + --url | --user | --user-agent | --version | --write-out | \ + -!(-*)[CFmQreYytzuAVw]) + return + ;; + --cacert | --cert | --proxy-cacert | --proxy-cert | -!(-*)E) _filedir '@(c?(e)rt|cer|pem|der)' return ;; - --capath) + --capath | --output-dir | --proxy-capath) _filedir -d return ;; - --cert-type|--key-type) - COMPREPLY=( $( compgen -W 'DER PEM ENG' -- "$cur" ) ) + --cert-type | --key-type | --proxy-cert-type | --proxy-key-type) + COMPREPLY=($(compgen -W 'DER PEM ENG' -- "$cur")) return ;; - --crlfile) + --crlfile | --proxy-crlfile) _filedir crl return ;; - --data|--data-ascii|--data-binary|--data-urlencode|-!(-*)d) + --data | --data-ascii | --data-binary | --data-urlencode | --header | \ + --proxy-header | -!(-*)[dH]) if [[ $cur == \@* ]]; then cur=${cur:1} _filedir - COMPREPLY=( "${COMPREPLY[@]/#/@}" ) + if [[ ${#COMPREPLY[@]} -eq 1 && -d ${COMPREPLY[0]} ]]; then + COMPREPLY[0]+=/ + compopt -o nospace + fi + COMPREPLY=("${COMPREPLY[@]/#/@}") fi return ;; --delegation) - COMPREPLY=( $( compgen -W 'none policy always' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'none policy always' -- "$cur")) + return + ;; + --dns-ipv[46]-addr) + _ip_addresses -${prev:9:1} + return + ;; + --dns-servers | --noproxy) + _known_hosts_real -- "${cur##*,}" + ((${#COMPREPLY[@]})) && + _comp_delimited , -W '"${COMPREPLY[@]}"' return ;; --engine) - COMPREPLY=( $( compgen -W 'list' -- "$cur" ) ) + local engines=$( + "$1" --engine list 2>/dev/null | + command grep "^[[:space:]]" + ) + COMPREPLY=($(compgen -W '$engines list' -- "$cur")) + return + ;; + --ftp-port | -!(-*)P) + _available_interfaces -a + _known_hosts_real -- "$cur" + _ip_addresses -a return ;; --ftp-method) - COMPREPLY=( $( compgen -W 'multicwd nocwd singlecwd' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'multicwd nocwd singlecwd' -- "$cur")) return ;; --ftp-ssl-ccc-mode) - COMPREPLY=( $( compgen -W 'active passive' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'active passive' -- "$cur")) return ;; --interface) _available_interfaces -a return ;; - --proxy|--socks4|--socks4a|--socks5|--socks5-hostname|-!(-*)x) + --help | -!(-*)h) + local x categories=( + $("$1" --help non-existent-category 2>&1 | + awk '/^[[:space:]]/ {print $1}') + ) + if ((${#categories[@]})); then + for x in "${categories[@]}"; do + # Looks like an option? Likely no --help category support + [[ $x != -* ]] || return + done + COMPREPLY=($(compgen -W '${categories[@]}' -- "$cur")) + fi + return + ;; + --krb) + COMPREPLY=($(compgen -W 'clear safe confidential private' -- "$cur")) + return + ;; + --pinnedpubkey | --proxy-pinnedpubkey) + _filedir '@(pem|der|key)' + return + ;; + --preproxy | --proxy | --socks4 | --socks4a | --socks5 | \ + --socks5-hostname | -!(-*)x) _known_hosts_real -- "$cur" return ;; --pubkey) - _filedir pub + _xfunc ssh _ssh_identityfile pub + return + ;; + --request | -!(-*)X) + # TODO: these are valid for http(s) only + COMPREPLY=($( + compgen -W \ + 'GET HEAD POST PUT DELETE CONNECT OPTIONS TRACE PATCH' \ + -- "$cur" + )) return ;; --stderr) - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + COMPREPLY=($(compgen -W '-' -- "$cur")) _filedir return ;; - --tlsauthtype) - COMPREPLY=( $( compgen -W 'SRP' -- "$cur" ) ) + --tls-max) + COMPREPLY=($(compgen -W 'default 1.0 1.1 1.2 1.3' -- "$cur")) + return + ;; + --tlsauthtype | --proxy-tlsauthtype) + COMPREPLY=($(compgen -W 'SRP' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help all)' -- "$cur")) + [[ ${COMPREPLY-} ]] || + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _curl curl + complete -F _curl curl # ex: filetype=sh diff --git a/completions/cvs b/completions/cvs index a16d8a5211f..917527d1bb0 100644 --- a/completions/cvs +++ b/completions/cvs @@ -4,9 +4,9 @@ _cvs_entries() { local prefix=${cur%/*}/ IFS=$'\n' [[ -e ${prefix:-}CVS/Entries ]] || prefix="" - entries=( $( cut -d/ -f2 -s ${prefix:-}CVS/Entries 2>/dev/null ) ) + entries=($(cut -d/ -f2 -s ${prefix:-}CVS/Entries 2>/dev/null)) if [[ $entries ]]; then - entries=( "${entries[@]/#/${prefix:-}}" ) + entries=("${entries[@]/#/${prefix:-}}") compopt -o filenames fi } @@ -14,9 +14,9 @@ _cvs_entries() _cvs_modules() { if [[ -n $prefix ]]; then - COMPREPLY=( $( command ls -d ${cvsroot}/${prefix}/!(CVSROOT) ) ) + COMPREPLY=($(command ls -d ${cvsroot}/${prefix}/!(CVSROOT))) else - COMPREPLY=( $( command ls -d ${cvsroot}/!(CVSROOT) ) ) + COMPREPLY=($(command ls -d ${cvsroot}/!(CVSROOT))) fi } @@ -27,21 +27,21 @@ _cvs_commands() _cvs_command_options() { - COMPREPLY=( $( compgen -W '$( _parse_help "$1" "--help $2" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1" "--help $2")' -- "$cur")) } _cvs_kflags() { - COMPREPLY=( $( compgen -W 'kv kvl k o b v' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'kv kvl k o b v' -- "$cur")) } _cvs_roots() { local -a cvsroots - cvsroots=( $CVSROOT ) - [[ -r ~/.cvspass ]] && cvsroots+=( $( awk '{ print $2 }' ~/.cvspass ) ) - [[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots < CVS/Root - COMPREPLY=( $( compgen -W '${cvsroots[@]}' -- "$cur" ) ) + [[ -v CVSROOT ]] && cvsroots=("$CVSROOT") + [[ -r ~/.cvspass ]] && cvsroots+=($(awk '{ print $2 }' ~/.cvspass)) + [[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots /dev/null ) ) + [[ -z $cur ]] && files=(!(CVS)) || + files=($(command ls -d ${cur}* 2>/dev/null)) local f - for i in ${!files[@]}; do + for i in "${!files[@]}"; do if [[ ${files[i]} == ?(*/)CVS ]]; then - unset 'files[i]' - else + unset -v 'files[i]' + elif ((${#entries[@]})); then for f in "${entries[@]}"; do - if [[ ${files[i]} == $f && ! -d $f ]]; then - unset 'files[i]' + if [[ ${files[i]} == "$f" && ! -d $f ]]; then + unset -v 'files[i]' break fi done fi done - COMPREPLY=( $( compgen -X "$_backup_glob" -W '${files[@]}' \ - -- "$cur" ) ) + ((${#files[@]})) && + COMPREPLY=($(compgen -X "$_backup_glob" -W '"${files[@]}"' \ + -- "$cur")) else _cvs_command_options "$1" $mode fi @@ -189,21 +190,23 @@ _cvs() ;; esac - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _cvs_command_options "$1" $mode else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + ((${#entries[@]})) && + COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) fi ;; annotate) - [[ "$prev" == -[rD] ]] && return + [[ $prev == -[rD] ]] && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _cvs_command_options "$1" $mode else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + ((${#entries[@]})) && + COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) fi ;; checkout) @@ -222,11 +225,12 @@ _cvs() ;; esac - if [[ "$cur" != -* ]]; then - [[ -z $cvsroot ]] && cvsroot=$CVSROOT - COMPREPLY=( $( cvs -d "$cvsroot" co -c 2> /dev/null | \ - awk '{print $1}' ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + if [[ $cur != -* ]]; then + [[ ! -v cvsroot ]] && cvsroot=${CVSROOT-} + COMPREPLY=($(cvs -d "$cvsroot" co -c 2>/dev/null | + awk '{print $1}')) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) else _cvs_command_options "$1" $mode fi @@ -243,7 +247,7 @@ _cvs() ;; esac - if [[ "$cur" != -* ]]; then + if [[ $cur != -* ]]; then # if $COMP_CVS_REMOTE is not null, 'cvs commit' will # complete on remotely checked-out files (requires # passwordless access to the remote repository @@ -251,15 +255,18 @@ _cvs() # this is the least computationally intensive way found so # far, but other changes (something other than # changed/removed/new) may be missing - changed=( $( cvs -q diff --brief 2>&1 | \ - command sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p' ) ) - newremoved=( $( cvs -q diff --brief 2>&1 | \ - command sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p' ) ) - COMPREPLY=( $( compgen -W '${changed[@]:-} \ - ${newremoved[@]:-}' -- "$cur" ) ) + changed=($(cvs -q diff --brief 2>&1 | + command sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p')) + newremoved=($(cvs -q diff --brief 2>&1 | + command sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p')) + ((${#changed[@]})) && COMPREPLY+=("${changed[@]}") + ((${#newremoved[@]})) && COMPREPLY+=("${newremoved[@]}") + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + ((${#entries[@]})) && + COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) fi else _cvs_command_options "$1" $mode @@ -268,21 +275,23 @@ _cvs() cvsroot) _cvs_roots ;; - diff|log) - if [[ "$cur" == -* ]]; then + diff | log | status) + if [[ $cur == -* ]]; then _cvs_command_options "$1" $mode - [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) ) + ((${#entries[@]})) && + COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) fi ;; - editors|watchers) - if [[ "$cur" == -* ]]; then + editors | watchers) + if [[ $cur == -* ]]; then _cvs_command_options "$1" $mode else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + ((${#entries[@]})) && + COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) fi ;; export) @@ -301,10 +310,11 @@ _cvs() ;; esac - if [[ "$cur" != -* ]]; then - [[ -z $cvsroot ]] && cvsroot=$CVSROOT - COMPREPLY=( $( cvs -d "$cvsroot" co -c | awk '{print $1}' ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + if [[ $cur != -* ]]; then + [[ ! -v cvsroot ]] && cvsroot=${CVSROOT-} + COMPREPLY=($(cvs -d "$cvsroot" co -c | awk '{print $1}')) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) else _cvs_command_options "$1" $mode fi @@ -321,32 +331,35 @@ _cvs() ;; esac - if [[ "$cur" != -* ]]; then + if [[ $cur != -* ]]; then # starts with same algorithm as checkout - [[ -z $cvsroot ]] && cvsroot=$CVSROOT + [[ ! -v cvsroot ]] && cvsroot=${CVSROOT-} local prefix=${cur%/*} if [[ -r ${cvsroot}/${prefix} ]]; then _cvs_modules - COMPREPLY=( ${COMPREPLY[@]#$cvsroot} ) - COMPREPLY=( ${COMPREPLY[@]#\/} ) + COMPREPLY=(${COMPREPLY[@]#$cvsroot}) + COMPREPLY=(${COMPREPLY[@]#\/}) fi - pwd=$( pwd ) + pwd=$(pwd) pwd=${pwd##*/} - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $pwd' -- "$cur" ) ) + [[ $pwd ]] && COMPREPLY+=("$pwd") + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) else _cvs_command_options "$1" $mode fi ;; remove) - if [[ "$cur" != -* ]]; then + if [[ $cur != -* ]]; then _cvs_entries - if [[ "$prev" != -f ]]; then + if [[ $prev != -f ]]; then # find out what files are missing - for i in ${!entries[@]}; do - [[ -r "${entries[i]}" ]] && unset 'entries[i]' + for i in "${!entries[@]}"; do + [[ -r ${entries[i]} ]] && unset -v 'entries[i]' done fi - COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) ) + ((${#entries[@]})) && + COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) else _cvs_command_options "$1" $mode fi @@ -363,11 +376,12 @@ _cvs() ;; esac - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _cvs_command_options "$1" $mode else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + ((${#entries[@]})) && + COMPREPLY=($(compgen -W '"${entries[@]}"' -- "$cur")) fi ;; "") @@ -381,18 +395,18 @@ _cvs() return ;; -*z) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) return ;; esac - COMPREPLY=( $( compgen -W '$( _cvs_commands ) - $( _parse_help "$1" --help-options ) --help --help-commands - --help-options --version' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_cvs_commands) + $(_parse_help "$1" --help-options) --help --help-commands + --help-options --version' -- "$cur")) ;; esac } && -complete -F _cvs cvs + complete -F _cvs cvs # ex: filetype=sh diff --git a/completions/cvsps b/completions/cvsps index 64dab54f529..4fdfefc3a9f 100644 --- a/completions/cvsps +++ b/completions/cvsps @@ -6,27 +6,27 @@ _cvsps() _init_completion -n : || return case $prev in - -h|-z|-f|-d|-l|--diff-opts|--debuglvl) + -h | -z | -f | -d | -l | --diff-opts | --debuglvl) return ;; -s) - COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | - awk '/^PatchSet:?[ \t]/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 2>/dev/null | + awk '/^PatchSet:?[ \t]/ { print $2 }')" -- "$cur")) return ;; -a) - COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | - awk '/^Author:[ \t]/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 2>/dev/null | + awk '/^Author:[ \t]/ { print $2 }')" -- "$cur")) return ;; -b) - COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | - awk '/^Branch:[ \t]/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 2>/dev/null | + awk '/^Branch:[ \t]/ { print $2 }')" -- "$cur")) return ;; -r) - COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | - awk '/^Tag:[ \t]+[^(]/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 2>/dev/null | + awk '/^Tag:[ \t]+[^(]/ { print $2 }')" -- "$cur")) return ;; -p) @@ -38,7 +38,7 @@ _cvsps() return ;; -Z) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) return ;; --root) @@ -47,12 +47,12 @@ _cvsps() ;; esac - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) else _xfunc cvs _cvs_roots fi } && -complete -F _cvsps cvsps + complete -F _cvsps cvsps # ex: filetype=sh diff --git a/completions/dd b/completions/dd index b2647bca1cb..04d876a0f55 100644 --- a/completions/dd +++ b/completions/dd @@ -6,37 +6,37 @@ _dd() _init_completion -n = || return case $cur in - if=*|of=*) + if=* | of=*) cur=${cur#*=} _filedir return ;; conv=*) cur=${cur#*=} - COMPREPLY=( $( compgen -W 'ascii ebcdic ibm block unblock lcase + COMPREPLY=($(compgen -W 'ascii ebcdic ibm block unblock lcase ucase sparse swab sync excl nocreat notrunc noerror fdatasync - fsync' -- "$cur" ) ) + fsync' -- "$cur")) return ;; - iflag=*|oflag=*) + iflag=* | oflag=*) cur=${cur#*=} - COMPREPLY=( $( compgen -W 'append direct directory dsync sync + COMPREPLY=($(compgen -W 'append direct directory dsync sync fullblock nonblock noatime nocache noctty nofollow count_bytes - skip_bytes seek_bytes' -- "$cur" ) ) + skip_bytes seek_bytes' -- "$cur")) return ;; status=*) cur=${cur#*=} - COMPREPLY=( $( compgen -W 'none noxfer progress' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'none noxfer progress' -- "$cur")) return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) \ - $( compgen -W 'bs cbs conv count ibs if iflag obs of oflag - seek skip status' -S '=' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur") + $(compgen -W 'bs cbs conv count ibs if iflag obs of oflag + seek skip status' -S '=' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _dd dd + complete -F _dd dd # ex: filetype=sh diff --git a/completions/declare b/completions/declare new file mode 100644 index 00000000000..d52c872cf24 --- /dev/null +++ b/completions/declare @@ -0,0 +1,41 @@ +# bash declare completion -*- shell-script -*- + +_comp_cmd_declare() +{ + local cur prev words cword + _init_completion -n := || return + + if [[ $cur == [-+]* ]]; then + local opts + opts=($(_parse_usage "$1")) + # Most options also have a '+' form. + # We'll exclude the ones that don't with compgen. + opts+=(${opts[*]/-/+}) + COMPREPLY=($(compgen -W "${opts[*]}" -X '+[Ffgp]' -- "$cur")) + return + fi + + local i=1 + while [[ ${words[i]} == [-+]* ]]; do + case ${words[i]} in + -*[aA]*) + COMPREPLY=($(compgen -A arrayvar -- "$cur")) + return + ;; + -*[fF]*) + COMPREPLY=($(compgen -A function -- "$cur")) + return + ;; + esac + ((i++)) + done + if ((i > 1)); then + # There was at least one option and it was not one that limited + # operations to functions and array variables + _comp_variable_assignments $cur && return + COMPREPLY=($(compgen -A variable -- "$cur")) + fi +} && + complete -F _comp_cmd_declare declare typeset + +# ex: filetype=sh diff --git a/completions/deja-dup b/completions/deja-dup index a508bb1eed5..1854d6a40e5 100644 --- a/completions/deja-dup +++ b/completions/deja-dup @@ -6,7 +6,7 @@ _deja_dup() _init_completion -s || return case $prev in - -'?'|--help|--help-*) + -'?' | --help | --help-*) return ;; --restore) @@ -21,13 +21,12 @@ _deja_dup() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi } && -complete -F _deja_dup deja-dup + complete -F _deja_dup deja-dup # ex: filetype=sh diff --git a/completions/desktop-file-validate b/completions/desktop-file-validate index 93f210619d9..8f4e139d022 100644 --- a/completions/desktop-file-validate +++ b/completions/desktop-file-validate @@ -12,12 +12,12 @@ _desktop_file_validate() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _filedir desktop } && -complete -F _desktop_file_validate desktop-file-validate + complete -F _desktop_file_validate desktop-file-validate # ex: filetype=sh diff --git a/completions/dhclient b/completions/dhclient index 797eca423ad..ce4b745262c 100644 --- a/completions/dhclient +++ b/completions/dhclient @@ -6,11 +6,11 @@ _dhclient() _init_completion || return case $prev in - -p|-e) + -p | -e) return ;; -D) - COMPREPLY=( $( compgen -W 'LL LLT' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'LL LLT' -- "$cur")) return ;; -*f) @@ -23,12 +23,12 @@ _dhclient() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) else _available_interfaces fi } && -complete -F _dhclient dhclient + complete -F _dhclient dhclient # ex: filetype=sh diff --git a/completions/dict b/completions/dict index c161546e64a..f3426ffd201 100644 --- a/completions/dict +++ b/completions/dict @@ -13,38 +13,35 @@ _dict() local host port db i - for (( i=1; i < cword; i++ )); do + for ((i = 1; i < cword; i++)); do case ${words[i]} in - --host|-!(-*)h) - host=${words[i+1]} + --host | -!(-*)h) + host=${words[++i]} [[ -n $host ]] && host="-h $host" - i=$((++i)) ;; - --port|-!(-*)p) - port=${words[i+1]} + --port | -!(-*)p) + port=${words[++i]} [[ -n $port ]] && port="-p $port" - i=$((++i)) ;; - --database|-!(-*)d) - db=${words[i+1]} + --database | -!(-*)d) + db=${words[++i]} [[ -n $db ]] && host="-d $db" - i=$((++i)) ;; esac done - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi case $prev in - --database|-info|-!(-*)[di]) - COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) ) + --database | -info | -!(-*)[di]) + COMPREPLY=($(compgen -W '$(_dictdata -D)' -- "$cur")) return ;; - --strategy|-!(-*)s) - COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) ) + --strategy | -!(-*)s) + COMPREPLY=($(compgen -W '$(_dictdata -S)' -- "$cur")) return ;; esac @@ -55,13 +52,13 @@ _dict() # it down with grep if $cur looks like something that's safe to embed # in a pattern instead. if [[ $cur == +([-A-Za-z0-9/.]) ]]; then - COMPREPLY=( $( compgen -W \ - '$( command grep "^${cur//./\\.}" $dictfile )' -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + '$(command grep "^${cur//./\\.}" $dictfile)' -- "$cur")) else - COMPREPLY=( $( compgen -W '$( cat $dictfile )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(cat $dictfile)' -- "$cur")) fi fi } && -complete -F _dict -o default dict rdict + complete -F _dict -o default dict rdict # ex: filetype=sh diff --git a/completions/dmypy b/completions/dmypy new file mode 100644 index 00000000000..3c37137fb14 --- /dev/null +++ b/completions/dmypy @@ -0,0 +1,48 @@ +# dmypy completion -*- shell-script -*- + +_dmypy() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help | --version | -[hV]) + return + ;; + --status-file) + _filedir + return + ;; + esac + + local cmd i + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} != -* && ${words[i - 1]} != --status-file ]]; then + cmd=${words[i]} + break + fi + done + + case ${cmd-} in + check | run) + _filedir '@(py|pyi)' + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + return + fi + + if [[ ! -v cmd ]]; then + local cmds=$($1 --help 2>&1 | + command sed -ne '/positional arguments/{p;n;p;q;}' | + command sed -ne 's/{\(.*\)}/\1/p') + COMPREPLY=($(IFS="," compgen -W '$cmds' -- "$cur")) + return + fi +} && + complete -F _dmypy dmypy + +# ex: filetype=sh diff --git a/completions/dnssec-keygen b/completions/dnssec-keygen new file mode 100644 index 00000000000..3f68a687389 --- /dev/null +++ b/completions/dnssec-keygen @@ -0,0 +1,48 @@ +# bash completion for dnssec-keygen(8) -*- shell-script -*- + +_dnssec_keygen_optarg() +{ + local args=$("$1" -h 2>&1 | + command sed -e 's/|/ /g' -e 's/(.*//' \ + -ne '/^[[:space:]]*'$2'/,/^[[:space:]]*[(-]/p' | + command sed -e 's/^[[:space:]]*'$2'.*://' -e '/^[[:space:]]*-/d') + COMPREPLY+=($(compgen -W '$args' -- "$cur")) +} + +_dnssec_keygen() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -[hbEgLpsPARIDSi]) + return + ;; + -K) + _filedir -d + return + ;; + -[ancdfTtm]) + _dnssec_keygen_optarg "$1" $prev + return + ;; + -r) + cur=${cur:=/dev/} + _filedir + return + ;; + -v) + COMPREPLY=($(compgen -W '{0..10}' -- "$cur")) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" | \ + command sed -e "s/:\$//")' -- "$cur")) + return + fi +} && + complete -F _dnssec_keygen dnssec-keygen + +# ex: filetype=sh diff --git a/completions/dnsspoof b/completions/dnsspoof index d6b7872b415..86ade91db39 100644 --- a/completions/dnsspoof +++ b/completions/dnsspoof @@ -16,11 +16,11 @@ _dnsspoof() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) fi } && -complete -F _dnsspoof dnsspoof + complete -F _dnsspoof dnsspoof # ex: filetype=sh diff --git a/completions/dot b/completions/dot index bc3531bbc74..4a6e114fab9 100644 --- a/completions/dot +++ b/completions/dot @@ -8,38 +8,41 @@ _dot() [[ $prev == -[V?] ]] && return case $cur in - -G*|-N*|-E*|-l?*|-q?*|-s?*|-Ln*|-LU*|-LC*|-LT*) + -G* | -N* | -E* | -l?* | -q?* | -s?* | -Ln* | -LU* | -LC* | -LT*) return ;; -T*) - local langs=( $( "$1" -TNON_EXISTENT 2>&1 | \ - command sed -ne 's/.*one of://p' ) ) - COMPREPLY=( $( compgen -P -T -W '${langs[@]}' -- "${cur#-T}" ) ) + local langs=($("$1" -TNON_EXISTENT 2>&1 | + command sed -ne 's/.*one of://p')) + ((${#langs[@]})) && + COMPREPLY=($(compgen -P -T -W '"${langs[@]}"' -- "${cur#-T}")) return ;; -K*) - local layouts=( $( "$1" -KNON_EXISTENT 2>&1 | \ - command sed -ne 's/.*one of://p' ) ) - COMPREPLY=( $( compgen -P -K -W '${layouts[@]}' -- "${cur#-K}" ) ) + local layouts=($("$1" -KNON_EXISTENT 2>&1 | + command sed -ne 's/.*one of://p')) + ((${#layouts[@]})) && + COMPREPLY=($(compgen -P -K -W '"${layouts[@]}"' -- "${cur#-K}")) return ;; -o*) cur=${cur#-o} _filedir - COMPREPLY=( $( compgen -P -o -W '${COMPREPLY[@]}' -- "$cur" ) ) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -P -o -W '"${COMPREPLY[@]}"' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-V -v -G -N -E -T -K -l -o -O -P -q -s -y -n - -n1 -n2 -x -Lg -LO -Ln -LU -LC -LT -m -c -?' -- "$cur" ) ) - [[ $COMPREPLY == -@([GNETKo]|L[nUCT]) ]] && compopt -o nospace + COMPREPLY=($(compgen -W '-V -v -G -N -E -T -K -l -o -O -P -q -s -y -n + -n1 -n2 -x -Lg -LO -Ln -LU -LC -LT -m -c -?' -- "$cur")) + [[ ${COMPREPLY-} == -@([GNETKo]|L[nUCT]) ]] && compopt -o nospace return fi _filedir dot } && -complete -F _dot dot + complete -F _dot dot # ex: filetype=sh diff --git a/completions/dpkg b/completions/dpkg index f5b79103b38..87b55112733 100644 --- a/completions/dpkg +++ b/completions/dpkg @@ -1,36 +1,34 @@ # This function is required by _dpkg and _dpkg-reconfigure -*- shell-script -*- -_have grep-status && { -_comp_dpkg_installed_packages() -{ - grep-status -P -e "^$1" -a -FStatus 'ok installed' -n -s Package -} -} || { -_comp_dpkg_installed_packages() -{ - command grep -A 1 "Package: $1" /var/lib/dpkg/status 2>/dev/null | \ - command grep -B 1 -Ee "ok installed|half-installed|unpacked| \ +if _have grep-status; then + _comp_dpkg_installed_packages() + { + grep-status -P -e "^${1-}" -a -FStatus 'ok installed' -n -s Package + } + + _comp_dpkg_purgeable_packages() + { + grep-status -P -e "^${1-}" -a -FStatus 'ok installed' -o -FStatus 'ok config-files' -n -s Package + } +else + _comp_dpkg_installed_packages() + { + command grep -A 1 "Package: ${1-}" /var/lib/dpkg/status 2>/dev/null | + command grep -B 1 -Ee "ok installed|half-installed|unpacked| \ half-configured" \ - -Ee "^Essential: yes" | \ - awk "/Package: $1/ { print \$2 }" 2>/dev/null -} -} + -Ee "^Essential: yes" | + awk "/Package: ${1-}/ { print \$2 }" 2>/dev/null + } -_have grep-status && { -_comp_dpkg_purgeable_packages() -{ - grep-status -P -e "^$1" -a -FStatus 'ok installed' -o -FStatus 'ok config-files' -n -s Package -} -} || { -_comp_dpkg_purgeable_packages() -{ - command grep -A 1 "Package: $1" /var/lib/dpkg/status 2>/dev/null | \ - command grep -B 1 -Ee "ok installed|half-installed|unpacked| \ + _comp_dpkg_purgeable_packages() + { + command grep -A 1 "Package: ${1-}" /var/lib/dpkg/status 2>/dev/null | + command grep -B 1 -Ee "ok installed|half-installed|unpacked| \ half-configured|config-files" \ - -Ee "^Essential: yes" | \ - awk "/Package: $1/ { print \$2 }" 2>/dev/null -} -} + -Ee "^Essential: yes" | + awk "/Package: ${1-}/ { print \$2 }" 2>/dev/null + } +fi # Debian dpkg(1) completion # @@ -44,45 +42,82 @@ _dpkg() # find the last option flag if [[ $cur != -* ]]; then while [[ $prev != -* && $i -ne 1 ]]; do - i=$((i-1)) - prev=${words[i-1]} + prev=${words[--i - 1]} done fi case $prev in - --install|--unpack|--record-avail|--contents|--info|--fsys-tarfile|\ - --field|--control|--extract|--vextract|-!(-*)[ciAIfexW]) + --install | --unpack | --record-avail | --contents | --info | --fsys-tarfile | \ + --field | --control | --extract | --vextract | --raw-extract | -!(-*)[ciAIfexX]) _filedir '?(u|d)deb' return ;; - --build|-!(-*)b) + --build | --admindir | --instdir | --root | -!(-*)b) _filedir -d return ;; - --status|--print-avail|--list|--show|-!(-*)[splW]) - COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) ) + --status | --print-avail | --list | -!(-*)[spl]) + COMPREPLY=($(_xfunc apt-cache _apt_cache_packages)) return ;; - --search|-!(-*)S) + --show | -!(-*)W) + if [[ $1 == *dpkg-query ]]; then + COMPREPLY=($(_xfunc apt-cache _apt_cache_packages)) + else + _filedir '?(u|d)deb' + fi + return + ;; + --search | -!(-*)S) _filedir return ;; - --remove|--verify|-!(-*)[rV]) - COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) + --remove | --verify | -!(-*)[rV]) + COMPREPLY=($(_comp_dpkg_installed_packages "$cur")) + return + ;; + --listfiles | --purge | -!(-*)[LP]) + COMPREPLY=($(_comp_dpkg_purgeable_packages "$cur")) + return + ;; + --debug | -!(-*)D) + COMPREPLY=($(compgen -W 'help' -- "$cur")) + return + ;; + --ignore-depends) + local packages=$( + cur=${cur##*,} _xfunc apt-cache _apt_cache_packages + ) + _comp_delimited , -W '$packages' + return + ;; + --log) + _filedir log + return + ;; + --path-exclude | --path-include) + return + ;; + --status-logger) + COMPREPLY=($(compgen -c -- "$cur")) return ;; - --listfiles|--purge|-!(-*)[LP]) - COMPREPLY=( $( _comp_dpkg_purgeable_packages "$cur" ) ) + --verify-format) + COMPREPLY=($(compgen -W 'rpm' -- "$cur")) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + for i in ${!COMPREPLY[*]}; do + # remove ones ending with a dash (known parse issue, hard to fix) + [[ ${COMPREPLY[i]} != *- ]] || unset -v 'COMPREPLY[i]' + done + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _dpkg dpkg dpkg-deb dpkg-query + complete -F _dpkg dpkg dpkg-deb dpkg-query # Debian GNU dpkg-reconfigure(8) completion # @@ -94,26 +129,28 @@ _dpkg_reconfigure() local opt case $prev in - --frontend|-!(-*)f) - opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) ) - opt=( ${opt[@]##*/} ) - opt=( ${opt[@]%.pm} ) - COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) ) + --frontend | -!(-*)f) + opt=(/usr/share/perl5/Debconf/FrontEnd/*) + if ((${#opt[@]})); then + opt=(${opt[@]##*/}) + opt=(${opt[@]%.pm}) + COMPREPLY=($(compgen -W '${opt[@]}' -- "$cur")) + fi return ;; - --priority|-!(-*)p) - COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) ) + --priority | -!(-*)p) + COMPREPLY=($(compgen -W 'low medium high critical' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--frontend --priority --all --unseen-only - --help --showold --force --terse' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--frontend --priority --all --unseen-only + --help --showold --force --terse' -- "$cur")) else - COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) + COMPREPLY=($(_comp_dpkg_installed_packages "$cur")) fi } && -complete -F _dpkg_reconfigure -o default dpkg-reconfigure + complete -F _dpkg_reconfigure -o default dpkg-reconfigure # ex: filetype=sh diff --git a/completions/dpkg-source b/completions/dpkg-source index 826d0f83970..05fa3a1116f 100644 --- a/completions/dpkg-source +++ b/completions/dpkg-source @@ -5,7 +5,7 @@ _dpkg_source() local cur prev words cword _init_completion || return - local options work i action packopts unpackopts fields + local options word action packopts unpackopts fields packopts="-c -l -F -V -T -D -U -W -E -sa -i -I -sk -sr -ss -sA -sK -sP \ -sU -sR" @@ -14,13 +14,13 @@ _dpkg_source() fields="Format Source Version Binary Maintainer Uploader Architecture \ Standards-Version Build-Depends Files" - action="options" - for (( i=0; i < ${#words[@]}-1; i++ )); do - if [[ ${words[$i]} == "-x" ]]; then + action=options + for word in "${words[@]:1}"; do + if [[ $word == -x ]]; then action=unpack - elif [[ ${words[$i]} == "-b" ]]; then + elif [[ $word == -b ]]; then action=pack - elif [[ ${words[$i]} == "-h" ]]; then + elif [[ $word == -h ]]; then action=help fi done @@ -33,7 +33,7 @@ _dpkg_source() _filedir 'dsc' ;; *) - COMPREPLY=( $( compgen -W "$unpackopts" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$unpackopts" -- "$cur")) _filedir -d _filedir ;; @@ -45,7 +45,7 @@ _dpkg_source() -b) _filedir -d ;; - -c|-l|-T|-i|-I) + -c | -l | -T | -i | -I) # -c: get controlfile # -l: get per-version info from this file # -T: read variables here, not debian/substvars @@ -57,9 +57,9 @@ _dpkg_source() ;; -F) # -F: force change log format - COMPREPLY=( $( command ls /usr/lib/dpkg/parsechangelog ) ) + COMPREPLY=($(command ls /usr/lib/dpkg/parsechangelog)) ;; - -V|-D) + -V) # -V: set a substitution variable # we don't know anything about possible variables or values # so we don't try to suggest any completion. @@ -68,31 +68,31 @@ _dpkg_source() -D) # -D: override or add a .dsc field and value # if $cur doesn't contain a = yet, suggest variable names - if [[ "$cur" == *=* ]]; then + if [[ $cur == *=* ]]; then # $cur contains a "=" COMPREPLY=() else - COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$fields" -- "$cur")) fi ;; -U) # -U: remove a field # Suggest possible fieldnames - COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$fields" -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W "$packopts $unpackopts" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$packopts $unpackopts" \ + -- "$cur")) ;; esac return ;; *) - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) return ;; esac } && -complete -F _dpkg_source dpkg-source + complete -F _dpkg_source dpkg-source # ex: filetype=sh diff --git a/completions/dselect b/completions/dselect index 19a90fd643d..4c1802671a2 100644 --- a/completions/dselect +++ b/completions/dselect @@ -10,20 +10,20 @@ _dselect() _filedir -d return ;; - -D|-debug) + -D | -debug) _filedir return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else - COMPREPLY=( $( compgen -W 'access update select install config remove - quit' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'access update select install config remove + quit' -- "$cur")) fi } && -complete -F _dselect dselect + complete -F _dselect dselect # ex: filetype=sh diff --git a/completions/dsniff b/completions/dsniff index 165ab74bcad..749c533cbfb 100644 --- a/completions/dsniff +++ b/completions/dsniff @@ -6,7 +6,7 @@ _dsniff() _init_completion || return case $prev in - -r|-w|-f|-p) + -r | -w | -f | -p) _filedir return ;; @@ -16,11 +16,11 @@ _dsniff() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -r -w -p' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1") -r -w -p' -- "$cur")) fi } && -complete -F _dsniff dsniff + complete -F _dsniff dsniff # ex: filetype=sh diff --git a/completions/dumpdb b/completions/dumpdb index ced754f5afd..eb1927fa044 100644 --- a/completions/dumpdb +++ b/completions/dumpdb @@ -5,14 +5,14 @@ _dumpdb() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--marshal --pickle --noprint --help' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--marshal --pickle --noprint --help' \ + -- "$cur")) else _filedir fi } && -complete -F _dumpdb dumpdb + complete -F _dumpdb dumpdb # ex: filetype=sh diff --git a/completions/dumpe2fs b/completions/dumpe2fs index fe992f62b0b..413a5bf6745 100644 --- a/completions/dumpe2fs +++ b/completions/dumpe2fs @@ -15,14 +15,14 @@ _dumpe2fs() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi cur=${cur:=/dev/} _filedir } && -complete -F _dumpe2fs dumpe2fs + complete -F _dumpe2fs dumpe2fs # ex: filetype=sh diff --git a/completions/e2freefrag b/completions/e2freefrag index bee4a169df0..c89dc9cbc8b 100644 --- a/completions/e2freefrag +++ b/completions/e2freefrag @@ -6,19 +6,19 @@ _e2freefrag() _init_completion || return case $prev in - -c|-h) + -c | -h) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" -h)' -- "$cur")) return fi cur=${cur:=/dev/} _filedir } && -complete -F _e2freefrag e2freefrag + complete -F _e2freefrag e2freefrag # ex: filetype=sh diff --git a/completions/e2label b/completions/e2label index c145c3a0d5c..ac8e4b5f718 100644 --- a/completions/e2label +++ b/completions/e2label @@ -5,11 +5,11 @@ _e2label() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then + if ((cword == 1)); then cur=${cur:=/dev/} _filedir fi } && -complete -F _e2label e2label + complete -F _e2label e2label # ex: filetype=sh diff --git a/completions/ebtables b/completions/ebtables index 05bfed602a3..de6bc54964f 100644 --- a/completions/ebtables +++ b/completions/ebtables @@ -6,47 +6,42 @@ _ebtables() _init_completion -s || return local table chain='s/^Bridge chain: \([^ ,]\{1,\}\).*$/\1/p' \ - targets='ACCEPT DROP CONTINUE RETURN' + targets='ACCEPT DROP CONTINUE RETURN' - if [[ ${words[@]} == *-t\ *filter* ]]; then - table="-t filter" - elif [[ ${words[@]} == *-t\ *nat* ]]; then - table="-t nat" - elif [[ ${words[@]} == *-t\ *mangle* ]]; then - table="-t mangle" - fi + [[ ${words[*]} =~ [[:space:]]-(t|-table=?)[[:space:]]*([^[:space:]]+) ]] && + table="-t ${BASH_REMATCH[2]}" case $prev in - -!(-*)[AIDPFXLZ]) - COMPREPLY=( $( compgen -W '`"$1" $table -L 2>/dev/null | \ - command sed -ne "$chain"`' -- "$cur" ) ) - ;; - -!(-*)t) - COMPREPLY=( $( compgen -W 'nat filter broute' -- "$cur" ) ) - ;; - -!(-*)j) - if [[ "$table" == "-t filter" || -z "$table" ]]; then - COMPREPLY=( $( compgen -W '$targets + -!(-*)[AIDPFXLZ]) + COMPREPLY=($(compgen -W '`"$1" $table -L 2>/dev/null | \ + command sed -ne "$chain"`' -- "$cur")) + ;; + -!(-*)t) + COMPREPLY=($(compgen -W 'nat filter broute' -- "$cur")) + ;; + -!(-*)j) + if [[ $table == "-t filter" || -z $table ]]; then + COMPREPLY=($(compgen -W '$targets $("$1" $table -L 2>/dev/null | \ command sed -n -e "s/INPUT\|OUTPUT\|FORWARD//" \ -e "$chain")' \ - -- "$cur" ) ) - elif [[ $table == "-t nat" ]]; then - COMPREPLY=( $( compgen -W '$targets + -- "$cur")) + elif [[ $table == "-t nat" ]]; then + COMPREPLY=($(compgen -W '$targets $("$1" $table -L 2>/dev/null | \ command sed -n -e "s/OUTPUT|PREROUTING|POSTROUTING//" \ -e "$chain")' \ - -- "$cur" ) ) - elif [[ $table == "-t broute" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP + -- "$cur")) + elif [[ $table == "-t broute" ]]; then + COMPREPLY=($(compgen -W 'ACCEPT DROP $("$1" $table -L 2>/dev/null | \ command sed -n -e "s/BROUTING//" -e "$chain")' \ - -- "$cur" ) ) - fi - ;; - *) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--802_3-sap --802_3-type --among-dst + -- "$cur")) + fi + ;; + *) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--802_3-sap --802_3-type --among-dst --among-dst-file --among-src --among-src-file --append --arp-gratuitous --arp-htype --arp-ip-dst --arp-ip-src --arp-mac-dst --arp-mac-src --arp-opcode --arp-ptype --arpreply-mac @@ -72,12 +67,12 @@ _ebtables() --stp-sender-prio --stp-type --table --to-destination --to-dst --to-source --to-src --ulog --ulog-cprange --ulog-nlgroup --ulog-prefix --ulog-qthreshold --version --vlan-encap --vlan-id - --vlan-prio --zero' -- "$cur" ) ) - fi - ;; + --vlan-prio --zero' -- "$cur")) + fi + ;; esac } && -complete -F _ebtables ebtables + complete -F _ebtables ebtables # ex: filetype=sh diff --git a/completions/ecryptfs-migrate-home b/completions/ecryptfs-migrate-home index 50798350276..d2eeb381bb7 100644 --- a/completions/ecryptfs-migrate-home +++ b/completions/ecryptfs-migrate-home @@ -9,14 +9,14 @@ _ecryptfs_migrate_home() --help) return ;; - --user|-u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + --user | -u) + COMPREPLY=($(compgen -u -- "$cur")) return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) } && -complete -F _ecryptfs_migrate_home ecryptfs-migrate-home + complete -F _ecryptfs_migrate_home ecryptfs-migrate-home # ex: filetype=sh diff --git a/completions/eog b/completions/eog index d5621119037..2330e1a2146 100644 --- a/completions/eog +++ b/completions/eog @@ -6,7 +6,7 @@ _eog() _init_completion -s || return case $prev in - -'?'|--help|--help-all|--help-gtk) + -'?' | --help | --help-all | --help-gtk) return ;; esac @@ -14,14 +14,13 @@ _eog() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir '@(ani|?(w)bmp|gif|ico|j2[ck]|jp[cefgx2]|jpeg|jpg2|pcx|p[gp]m|pn[gm]|ras|svg?(z)|tga|tif?(f)|x[bp]m)' } && -complete -F _eog eog + complete -F _eog eog # ex: filetype=sh diff --git a/completions/ether-wake b/completions/ether-wake index 5c368f7c6a0..d9526736cea 100644 --- a/completions/ether-wake +++ b/completions/ether-wake @@ -16,12 +16,12 @@ _ether_wake() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -u ) -V' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1" -u) -V' -- "$cur")) return fi _mac_addresses } && -complete -F _ether_wake ether-wake etherwake + complete -F _ether_wake ether-wake etherwake # ex: filetype=sh diff --git a/completions/evince b/completions/evince index 63d98801eac..1c97dd93c74 100644 --- a/completions/evince +++ b/completions/evince @@ -6,9 +6,9 @@ _evince() _init_completion -s || return case $prev in - --help*|--sm-client-id|--class|--name|--screen|--gdk-debug|\ - --gdk-no-debug|--gtk-module|--gtk-debug|--gtk-no-debug|--page-label|\ - --page-index|--find|--display|-!(-*)[hpil]) + --help* | --sm-client-id | --class | --name | --screen | --gdk-debug | \ + --gdk-no-debug | --gtk-module | --gtk-debug | --gtk-no-debug | --page-label | \ + --page-index | --find | --display | -!(-*)[hpil]) return ;; --sm-client-state-file) @@ -20,14 +20,13 @@ _evince() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir '@(@(?(e)ps|?(E)PS|[pf]df|[PF]DF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2|.xz|.XZ)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx)' } && -complete -F _evince evince + complete -F _evince evince # ex: filetype=sh diff --git a/completions/export b/completions/export index 31715f9a45b..4687ea22c93 100644 --- a/completions/export +++ b/completions/export @@ -3,10 +3,10 @@ _export() { local cur prev words cword - _init_completion -n = || return + _init_completion -n := || return local i action=variable remove=false - for (( i=1; i < cword; i++ )); do + for ((i = 1; i < cword; i++)); do case ${words[i]} in -p) return @@ -25,18 +25,15 @@ _export() done if [[ $cur == *=* ]]; then - local ocur=$cur oprev=$prev - prev=${cur%%=*} cur=${cur#*=} - _variables && return - cur=$ocur prev=$oprev + _comp_variable_assignments $cur && return fi case $cur in *=) - local pval=$( quote "$( eval printf %s \"\$${cur%=}\" )" ) + local pval=$(quote "$(eval printf %s \"\$\{${cur%=}-\}\")") # Complete previous value if it's not empty. if [[ $pval != \'\' ]]; then - COMPREPLY=( "$pval" ) + COMPREPLY=("$pval") else cur=${cur#*=} _filedir @@ -48,19 +45,18 @@ _export() ;; *) if [[ $cword -eq 1 && $cur == -* ]]; then - COMPREPLY=( $( compgen -W \ - '-p $( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '-p $(_parse_usage "$1")' -- "$cur")) return fi - local suffix + local suffix="" if ! $remove; then - suffix+== + suffix="=" compopt -o nospace fi - COMPREPLY=( $( compgen -A $action -S "$suffix" -- "$cur" ) ) + COMPREPLY=($(compgen -A $action -S "$suffix" -- "$cur")) ;; esac } && -complete -F _export export + complete -F _export export # ex: filetype=sh diff --git a/completions/faillog b/completions/faillog index acb74558890..c8b81bd07ea 100644 --- a/completions/faillog +++ b/completions/faillog @@ -6,22 +6,22 @@ _faillog() _init_completion -s || return case $prev in - --help|--lock-time|--maximum|--time|-!(-*)[hlmt]) + --help | --lock-time | --maximum | --time | -!(-*)[hlmt]) return ;; - --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + --user | -!(-*)u) + COMPREPLY=($(compgen -u -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _faillog faillog + complete -F _faillog faillog # ex: filetype=sh diff --git a/completions/fbgs b/completions/fbgs index c58a7af9e4e..1947b872c58 100644 --- a/completions/fbgs +++ b/completions/fbgs @@ -6,45 +6,45 @@ _fbgs() _init_completion || return case "$prev" in - -f|--font) + -f | --font) local IFS=$'\n' - COMPREPLY=( $( compgen -W '$( fc-list 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(fc-list 2>/dev/null)' -- "$cur")) return ;; - -m|--mode) - COMPREPLY=( $( compgen -W '$( command sed \ + -m | --mode) + COMPREPLY=($(compgen -W '$(command sed \ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \ - /etc/fb.modes 2> /dev/null )' -- "$cur" ) ) + /etc/fb.modes 2>/dev/null)' -- "$cur")) return ;; - -d|--device) - COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) ) + -d | --device) + COMPREPLY=($(compgen -f -d -- "${cur:-/dev/}")) return ;; - -fp|--firstpage|-lp|--lastpage|-r|--resolution|-s|--scroll|-t|\ - --timeout) + -fp | --firstpage | -lp | --lastpage | -r | --resolution | -s | --scroll | -t | \ + --timeout) # expect integer value - COMPREPLY+=( $( compgen -W '{0..9}' ) ) + COMPREPLY+=($(compgen -W '{0..9}')) compopt -o nospace return ;; - -T|--vt|-p|--password|-g|--gamma) + -T | --vt | -p | --password | -g | --gamma) # argument required but no completions available return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bell --help --password -fp --firstpage + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--bell --help --password -fp --firstpage -lp --lastpage --color -l -xl -xxl --resolution --autozoom --{,no}autoup --{,no}autodown --{,no}fitwidth --{,no}verbose --{,no}random --vt --scroll --timeout --{,no}once --gamma --font - --device --mode' -- "$cur" ) ) - [[ $COMPREPLY ]] && return + --device --mode' -- "$cur")) + [[ ${COMPREPLY-} ]] && return fi _filedir '?(e)ps|pdf' } && -complete -F _fbgs fbgs + complete -F _fbgs fbgs # ex: filetype=sh diff --git a/completions/fbi b/completions/fbi index 75b46b61e43..455887a3738 100644 --- a/completions/fbi +++ b/completions/fbi @@ -6,49 +6,49 @@ _fbi() _init_completion || return case "$prev" in - -l|--list) + -l | --list) _filedir return ;; - -r|--resolution) - COMPREPLY+=( $( compgen -W '{1..5}' ) ) + -r | --resolution) + COMPREPLY+=($(compgen -W '{1..5}')) return ;; - -f|--font) + -f | --font) local IFS=$'\n' - COMPREPLY=( $( compgen -W '$( fc-list 2> /dev/null )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(fc-list 2>/dev/null)' -- "$cur")) return ;; - -m|--mode) - COMPREPLY=( $( compgen -W '$( command sed \ + -m | --mode) + COMPREPLY=($(compgen -W '$(command sed \ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \ - /etc/fb.modes 2> /dev/null )' -- "$cur" ) ) + /etc/fb.modes 2>/dev/null)' -- "$cur")) return ;; - -d|--device) - COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) ) + -d | --device) + COMPREPLY=($(compgen -f -d -- "${cur:-/dev/}")) return ;; - --cachemem|--blend|-T|--vt|-s|--scroll|-t|--timeout|-g|--gamma) + --cachemem | --blend | -T | --vt | -s | --scroll | -t | --timeout | -g | --gamma) # argument required but no completions available return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version --store --list --text + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --version --store --list --text --autozoom --{,no}autoup --{,no}autodown --{,no}fitwidth --{,no}verbose --{,no}random --{,no}comments --{,no}edit --{,no}backup --{,no}preserve --{,no}readahead --cachemem --blend --vt --scroll --timeout --{,no}once --resolution --gamma --font - --device --mode' -- "$cur" ) ) - [[ $COMPREPLY ]] && return + --device --mode' -- "$cur")) + [[ ${COMPREPLY-} ]] && return fi # FIXME: It is hard to determine correct supported extensions. # fbi can handle any format that imagemagick can plus some others _filedir 'bmp|gif|jp?(e)g|pcd|png|p[pgb]m|tif?(f)|webp|xpm|xwd|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf' } && -complete -F _fbi fbi + complete -F _fbi fbi # ex: filetype=sh diff --git a/completions/feh b/completions/feh index 3b8fc384dda..0b15f8fd2ec 100644 --- a/completions/feh +++ b/completions/feh @@ -6,92 +6,95 @@ _feh() _init_completion -s || return case "$prev" in - --image-bg|-B) - COMPREPLY=( $( compgen -W 'checks white black' -- "$cur" ) ) + --image-bg | -B) + COMPREPLY=($(compgen -W 'checks white black' -- "$cur")) return ;; - --filelist|--output|--output-only|--start-at|-!(-*)[foO\|]) + --filelist | --output | --output-only | --start-at | -!(-*)[foO\|]) _filedir return ;; - --caption-path|--fontpath|--output-dir|-!(-*)[KCj]) + --caption-path | --fontpath | --output-dir | -!(-*)[KCj]) _filedir -d return ;; - --font|--menu-font|--title-font|-!(-*)[eM@]) + --font | --menu-font | --title-font | -!(-*)[eM@]) # expect string like "dejavu.ttf/12" - if [[ "$cur" == */* ]]; then # expect integer value - COMPREPLY=( $( compgen -P "$cur" -W '{0..9}' ) ) + if [[ $cur == */* ]]; then # expect integer value + COMPREPLY=($(compgen -P "$cur" -W '{0..9}')) compopt -o nospace return fi local font_path - # font_path="$( imlib2-config --prefix 2> /dev/null )/share/imlib2/data/fonts" - # COMPREPLY=( $( cd "$font_path" 2> /dev/null; compgen -f \ - # -X "!*.@([tT][tT][fF])" -S / -- "$cur" ) ) - for (( i=${#words[@]}-1; i>0; i-- )); do + # font_path="$(imlib2-config --prefix 2>/dev/null)/share/imlib2/data/fonts" + # COMPREPLY=( $(command cd -- "$font_path" 2>/dev/null; compgen -f \ + # -X "!*.@([tT][tT][fF])" -S / -- "$cur") ) + for ((i = ${#words[@]} - 1; i > 0; i--)); do if [[ ${words[i]} == -@(C|-fontpath) ]]; then - font_path="${words[i+1]}" - COMPREPLY+=( $( cd "$font_path" 2> /dev/null; compgen -f \ - -X "!*.@([tT][tT][fF])" -S / -- "$cur" ) ) + font_path="${words[i + 1]}" + COMPREPLY+=($( + command cd -- "$font_path" 2>/dev/null + compgen -f \ + -X "!*.@([tT][tT][fF])" -S / -- "$cur" + )) fi done compopt -o nospace return ;; - --theme|-!(-*)T) + --theme | -!(-*)T) local conf_path=~/.config/feh/themes local theme_name theme_opts [[ -r $conf_path ]] || return - while read theme_name theme_opts; do - if [[ "$theme_name" == '#'* || "$theme_name" == "" ]]; then + while read -r theme_name theme_opts; do + if [[ $theme_name == '#'* || $theme_name == "" ]]; then continue fi - COMPREPLY+=( $( compgen -W "$theme_name" -- "$cur" ) ) - done < "$conf_path" + COMPREPLY+=($(compgen -W "$theme_name" -- "$cur")) + done <"$conf_path" return ;; - --sort|-!(-*)S) - COMPREPLY=( $( compgen -W 'name filename mtime width height - pixels size format' -- "$cur" ) ) + --sort | -!(-*)S) + COMPREPLY=($(compgen -W 'name filename mtime width height + pixels size format' -- "$cur")) return ;; - --reload|--limit-height|--limit-width|--thumb-height|--thumb-width|\ - --thumb-redraw|--magick-timeout|-!(-*)[RHWEyJ]) + --reload | --limit-height | --limit-width | --thumb-height | --thumb-width | \ + --thumb-redraw | --magick-timeout | -!(-*)[RHWEyJ]) # expect integer value - COMPREPLY+=( $( compgen -W '{0..9}' ) ) + COMPREPLY+=($(compgen -W '{0..9}')) compopt -o nospace return ;; --zoom) # expect integer value or "max", "fill" - COMPREPLY=( $( compgen -W 'max fill' -- "$cur" ) ) - if [[ ! $cur || ! $COMPREPLY ]]; then - COMPREPLY+=( $( compgen -W '{0..9}' ) ) + COMPREPLY=($(compgen -W 'max fill' -- "$cur")) + if [[ ! $cur || ! ${COMPREPLY-} ]]; then + COMPREPLY+=($(compgen -W '{0..9}')) compopt -o nospace fi return ;; - --alpha|-!(-*)a) - COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) ) + --alpha | -!(-*)a) + COMPREPLY=($(compgen -W '{0..255}' -- "$cur")) return ;; - --bg|-!(-*)b) + --bg | -!(-*)b) _filedir - COMPREPLY+=( $( compgen -W 'trans' -- "$cur" ) ) + COMPREPLY+=($(compgen -W 'trans' -- "$cur")) return ;; - --geometry|--max-dimension|--min-dimension|-!(-*)g) + --geometry | --max-dimension | --min-dimension | -!(-*)g) # expect string like 640x480 - if [[ $cur && "$cur" != *x* ]]; then - COMPREPLY=( x ) + if [[ $cur && $cur != *x* ]]; then + COMPREPLY=(x) fi - COMPREPLY+=( $( compgen -W "{0..9}" ) ) + COMPREPLY+=($(compgen -W "{0..9}")) compopt -o nospace return ;; - --customlist|--index-info|--info|--slideshow-delay|--thumb-title|\ - --title|-!(-*)[LD~^]) + --customlist | --index-info | --info | --slideshow-delay | --thumb-title | \ + --title | -!(-*)[LD~^]) # argument required but no completions available return ;; @@ -99,17 +102,19 @@ _feh() $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # Some versions of feh just output "See 'man feh'" for --help :( - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - [[ $COMPREPLY ]] && return + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur")) + if [[ ${COMPREPLY-} ]]; then + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi fi # FIXME: It is hard to determine correct supported extensions. # feh can handle any format that imagemagick can plus some others - _filedir 'xpm|tif?(f)|png|p[npgba]m|iff|?(i)lbm|jp?(e)g|jfi?(f)|gif|bmp|arg?(b)|tga|xcf|ani|ico|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf' + _filedir 'xpm|tif?(f)|png|p[npgba]m|iff|?(i)lbm|jp?(e)g|jfi?(f)|gif|bmp|arg?(b)|tga|xcf|ani|ico|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf|ff?(.gz|.bz2)|webp' } && -complete -F _feh feh + complete -F _feh feh # ex: filetype=sh diff --git a/completions/file b/completions/file index 558273c0d64..21fbd161f47 100644 --- a/completions/file +++ b/completions/file @@ -6,27 +6,27 @@ _file() _init_completion || return case $prev in - --help|--version|--separator|-!(-*)[vF]) + --help | --version | --separator | -!(-*)[vF]) return ;; - --magic-file|--files-from|-!(-*)[mf]) + --magic-file | --files-from | -!(-*)[mf]) _filedir return ;; - --exclude|-!(-*)e) - COMPREPLY=( $( compgen -W 'apptype ascii cdf compress elf encoding - soft tar text tokens troff' -- "$cur" ) ) + --exclude | -!(-*)e) + COMPREPLY=($(compgen -W 'apptype ascii cdf compress elf encoding + soft tar text tokens troff' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _filedir } && -complete -F _file file + complete -F _file file # ex: filetype=sh diff --git a/completions/file-roller b/completions/file-roller index ef7b6ac74e1..27d23dfb1ea 100644 --- a/completions/file-roller +++ b/completions/file-roller @@ -5,22 +5,22 @@ _file_roller() local cur prev words cword split _init_completion -s || return - local exts='@(7z|ace|alz|ar|arj|[bglx]z|bz2|tb?(z)2|cab|cb[rz]|iso?(9660)|Z|t[abglx]z|cpio|deb|rar|?(g)tar|gem|lh[az]|lz[4h]|?(t)lrz|lzma|lzo|wim|swm|rpm|sit|zoo)' + local exts='@(7z?(.001)|ace|alz|ar|arj|[bglx]z|bz2|tb?(z)2|cab|cb[rz]|iso?(9660)|Z|t[abglx]z|cpio|deb|rar|?(g)tar|gem|lh[az]|lz[4h]|?(t)lrz|lzma|lzo|wim|swm|rpm|sit|zoo)' case $prev in - --help|--help-all|--help-gtk|--help-sm-client|-!(-*)'?') + --help | --help-all | --help-gtk | --help-sm-client | -!(-*)'?') return ;; --sm-client-state-file) _filedir return ;; - --add-to|-!(-*)a) + --add-to | -!(-*)a) _filedir_xspec unzip _filedir "$exts" return ;; - --extract-to|--default-dir|-!(-*)e) + --extract-to | --default-dir | -!(-*)e) _filedir -d return ;; @@ -29,15 +29,14 @@ _file_roller() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir_xspec unzip _filedir "$exts" } && -complete -F _file_roller file-roller + complete -F _file_roller file-roller # ex: filetype=sh diff --git a/completions/filefrag b/completions/filefrag index b4866dc0e49..d26e8c8a234 100644 --- a/completions/filefrag +++ b/completions/filefrag @@ -5,13 +5,13 @@ _filefrag() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi _filedir } && -complete -F _filefrag filefrag + complete -F _filefrag filefrag # ex: filetype=sh diff --git a/completions/filesnarf b/completions/filesnarf index 0cdcfe2776d..f959d80fc73 100644 --- a/completions/filesnarf +++ b/completions/filesnarf @@ -12,11 +12,11 @@ _snarf() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) fi } && -complete -F _snarf filesnarf mailsnarf msgsnarf + complete -F _snarf filesnarf mailsnarf msgsnarf # ex: filetype=sh diff --git a/completions/find b/completions/find index 4451d0595c9..2e25e7de82a 100644 --- a/completions/find +++ b/completions/find @@ -7,20 +7,29 @@ _find() local cur prev words cword _init_completion || return + local i + for i in ${!words[*]}; do + if [[ ${words[i]} == -@(exec|ok)?(dir) ]]; then + ((cword > i)) || break + _command_offset $((i + 1)) + return + fi + done + case $prev in - -maxdepth|-mindepth) - COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) ) + -maxdepth | -mindepth) + COMPREPLY=($(compgen -W '{0..9}' -- "$cur")) return ;; - -newer|-anewer|-cnewer|-fls|-fprint|-fprint0|-fprintf|-name|-iname|\ - -lname|-ilname|-wholename|-iwholename|-samefile) + -newer | -anewer | -cnewer | -fls | -fprint | -fprint0 | -fprintf | -name | -[il]name | \ + -ilname | -wholename | -[il]wholename | -samefile) _filedir return ;; -fstype) _fstypes - [[ $OSTYPE == *bsd* ]] && \ - COMPREPLY+=( $( compgen -W 'local rdonly' -- "$cur" ) ) + [[ $OSTYPE == *bsd* ]] && + COMPREPLY+=($(compgen -W 'local rdonly' -- "$cur")) return ;; -gid) @@ -28,11 +37,11 @@ _find() return ;; -group) - COMPREPLY=( $( compgen -g -- "$cur" 2>/dev/null) ) + COMPREPLY=($(compgen -g -- "$cur" 2>/dev/null)) return ;; - -xtype|-type) - COMPREPLY=( $( compgen -W 'b c d p f l s' -- "$cur" ) ) + -xtype | -type) + COMPREPLY=($(compgen -W 'b c d p f l s' -- "$cur")) return ;; -uid) @@ -40,42 +49,35 @@ _find() return ;; -user) - COMPREPLY=( $( compgen -u -- "$cur" ) ) - return - ;; - -exec|-execdir|-ok|-okdir) - words=(words[0] "$cur") - cword=1 - _command + COMPREPLY=($(compgen -u -- "$cur")) return ;; - -[acm]min|-[acm]time|-iname|-lname|-wholename|-iwholename|-lwholename|\ - -ilwholename|-inum|-path|-ipath|-regex|-iregex|-links|-perm|-size|\ - -used|-printf|-context) + -[acm]min | -[acm]time | -inum | -path | -ipath | -regex | -iregex | -links | -perm | \ + -size | -used | -printf | -context) # do nothing, just wait for a parameter to be given return ;; -regextype) - COMPREPLY=( $( compgen -W 'emacs posix-awk posix-basic posix-egrep - posix-extended' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'emacs posix-awk posix-basic posix-egrep + posix-extended' -- "$cur")) return ;; esac local i exprfound=false # set exprfound to true if there is already an expression present - for i in ${words[@]}; do - [[ "$i" == [-\(\),\!]* ]] && exprfound=true && break + for i in "${words[@]}"; do + [[ $i == [-\(\),\!]* ]] && exprfound=true && break done # handle case where first parameter is not a dash option - if ! $exprfound && [[ "$cur" != [-\(\),\!]* ]]; then + if ! $exprfound && [[ $cur != [-\(\),\!]* ]]; then _filedir -d return fi # complete using basic options - COMPREPLY=( $( compgen -W '-daystart -depth -follow -help + COMPREPLY=($(compgen -W '-daystart -depth -follow -help -ignore_readdir_race -maxdepth -mindepth -mindepth -mount -noignore_readdir_race -noleaf -regextype -version -warn -nowarn -xdev -amin -anewer -atime -cmin -cnewer -ctime -empty -executable -false @@ -84,22 +86,22 @@ _find() -readable -regex -samefile -size -true -type -uid -used -user -wholename -writable -xtype -context -delete -exec -execdir -fls -fprint -fprint0 -fprintf -ls -ok -okdir -print -print0 -printf -prune - -quit' -- "$cur" ) ) + -quit' -- "$cur")) - if [[ ${#COMPREPLY[@]} -ne 0 ]]; then + if ((${#COMPREPLY[@]} != 0)); then # this removes any options from the list of completions that have # already been specified somewhere on the command line, as long as # these options can only be used once (in a word, "options", in # opposition to "tests" and "actions", as in the find(1) manpage). - local -A onlyonce=( [-daystart]=1 [-depth]=1 [-follow]=1 [-help]=1 + local -A onlyonce=([-daystart]=1 [-depth]=1 [-follow]=1 [-help]=1 [-ignore_readdir_race]=1 [-maxdepth]=1 [-mindepth]=1 [-mount]=1 [-noignore_readdir_race]=1 [-noleaf]=1 [-nowarn]=1 [-regextype]=1 - [-version]=1 [-warn]=1 [-xdev]=1 ) + [-version]=1 [-warn]=1 [-xdev]=1) local j for i in "${words[@]}"; do - [[ $i && ${onlyonce[$i]} ]] || continue - for j in ${!COMPREPLY[@]}; do - [[ ${COMPREPLY[j]} == $i ]] && unset 'COMPREPLY[j]' + [[ $i && -v onlyonce["$i"] ]] || continue + for j in "${!COMPREPLY[@]}"; do + [[ ${COMPREPLY[j]} == "$i" ]] && unset -v 'COMPREPLY[j]' done done fi @@ -107,6 +109,6 @@ _find() _filedir } && -complete -F _find find + complete -F _find find # ex: filetype=sh diff --git a/completions/find_member b/completions/find_member index df1a24f9c94..cf30c70df58 100644 --- a/completions/find_member +++ b/completions/find_member @@ -6,7 +6,7 @@ _find_member() _init_completion -s || return case $prev in - -l|-x|--listname|--exclude) + -l | -x | --listname | --exclude) _xfunc list_lists _mailman_lists return ;; @@ -14,12 +14,12 @@ _find_member() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listname --exclude --owners --help' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--listname --exclude --owners --help' \ + -- "$cur")) fi } && -complete -F _find_member find_member + complete -F _find_member find_member # ex: filetype=sh diff --git a/completions/fio b/completions/fio index 00a3350bac0..9524017954f 100644 --- a/completions/fio +++ b/completions/fio @@ -6,28 +6,26 @@ _fio() _init_completion -s || return case $prev in - --help|--version) + --help | --version) return ;; --debug) - local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -W "process file io mem blktrace verify + _comp_delimited , -W "process file io mem blktrace verify random parse diskutil job mutex profile time net rate compress - steadystate helperthread" -- "${cur##*,}" ) ) - [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) + steadystate helperthread" return ;; --output-format) - COMPREPLY=( $( compgen -W "terse json json+ normal" -- "$cur" ) ) + COMPREPLY=($(compgen -W "terse json json+ normal" -- "$cur")) return ;; --terse-version) - COMPREPLY=( $( compgen -W "2 3" -- "$cur" ) ) + COMPREPLY=($(compgen -W "2 3" -- "$cur")) return ;; --cmdhelp) # TODO more commands? - COMPREPLY=( $( compgen -W "all" -- "$cur" ) ) + COMPREPLY=($(compgen -W "all" -- "$cur")) return ;; --enghelp) @@ -36,7 +34,7 @@ _fio() return ;; --eta) - COMPREPLY=( $( compgen -W "always never auto" -- "$cur" ) ) + COMPREPLY=($(compgen -W "always never auto" -- "$cur")) return ;; --daemonize) @@ -52,7 +50,7 @@ _fio() return ;; --idle-prof) - COMPREPLY=( $( compgen -W "system percpu calibrate" -- "$cur" ) ) + COMPREPLY=($(compgen -W "system percpu calibrate" -- "$cur")) return ;; --inflate-log) @@ -63,9 +61,9 @@ _fio() _filedir return ;; - --trigger|--trigger-remote) + --trigger | --trigger-remote) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) return ;; --aux-path) @@ -77,13 +75,13 @@ _fio() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir job } && -complete -F _fio fio + complete -F _fio fio # ex: filetype=sh diff --git a/completions/firefox b/completions/firefox index adbda33c533..0d0df6578f8 100644 --- a/completions/firefox +++ b/completions/firefox @@ -8,12 +8,19 @@ _firefox() [[ $cur == -MOZ_LOG*=* ]] && prev=${cur%%=*} cur=${cur#*=} case $prev in - --help|--version|--display|--UILocale|-MOZ_LOG|--new-window|--new-tab|\ - --private-window|--window-size|--search|--start-debugger-server|\ - --recording|--debugger-args|-[hvPa]) + --help | --version | --display | --UILocale | -MOZ_LOG | --new-window | --new-tab | \ + --private-window | --window-size | --search | --start-debugger-server | \ + --recording | --debugger-args | -[hva]) return ;; - --profile|--screenshot) + -P) + COMPREPLY=($(compgen -W "$( + awk -F= '$1 == "Name" { print $2 }' \ + ~/.mozilla/firefox/profiles.ini 2>/dev/null + )" -- "$cur")) + return + ;; + --profile | --screenshot) _filedir -d return ;; @@ -21,12 +28,12 @@ _firefox() _filedir log return ;; - --recording-file) + --recording-output | --recording-file) _filedir return ;; - --debugger|-d) - COMPREPLY=( $( compgen -c -- "$cur" ) ) + --debugger | -d) + COMPREPLY=($(compgen -c -- "$cur")) return ;; esac @@ -34,13 +41,13 @@ _firefox() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - _filedir "@(?([xs])htm?(l)|pdf)" + _filedir "@(?([xs])htm?(l)|pdf|txt)" } && -complete -F _firefox firefox mozilla-firefox iceweasel + complete -F _firefox firefox firefox-esr iceweasel mozilla-firefox # ex: filetype=sh diff --git a/completions/flake8 b/completions/flake8 index 37fce9eb212..045c40954c5 100644 --- a/completions/flake8 +++ b/completions/flake8 @@ -6,22 +6,22 @@ _flake8() _init_completion -s || return case $prev in - --help|--version|-!(-*)h) + --help | --version | -!(-*)h) return ;; --format) - COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'default pylint' -- "$cur")) return ;; - --jobs|-!(-*)j) - COMPREPLY=( $( compgen -W "auto {1..$(_ncpus)}" -- "$cur" ) ) + --jobs | -!(-*)j) + COMPREPLY=($(compgen -W "auto {1..$(_ncpus)}" -- "$cur")) return ;; - --output-file|--append-config|--config) + --output-file | --append-config | --config) _filedir return ;; - --include-in-doctest|--exclude-from-doctest) + --include-in-doctest | --exclude-from-doctest) _filedir py return ;; @@ -30,13 +30,13 @@ _flake8() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir py } && -complete -F _flake8 flake8 + complete -F _flake8 flake8 # ex: filetype=sh diff --git a/completions/freebsd-update b/completions/freebsd-update index 6ee2438b5fe..d5be861292f 100644 --- a/completions/freebsd-update +++ b/completions/freebsd-update @@ -8,7 +8,7 @@ _freebsd_update() _init_completion || return case $prev in - -b|-d) + -b | -d) _filedir -d return ;; @@ -16,14 +16,14 @@ _freebsd_update() _filedir return ;; - -k|-r|-s|-t) + -k | -r | -s | -t) return ;; esac - COMPREPLY=( $(compgen -W "fetch cron upgrade install rollback IDS" -- \ - $cur) ) + COMPREPLY=($(compgen -W "fetch cron upgrade install rollback IDS" -- \ + $cur)) } && -complete -F _freebsd_update freebsd-update + complete -F _freebsd_update freebsd-update # ex: filetype=sh diff --git a/completions/freeciv b/completions/freeciv index 40caa6b9b6c..01af31182de 100644 --- a/completions/freeciv +++ b/completions/freeciv @@ -6,36 +6,36 @@ _freeciv() _init_completion || return case $prev in - --help|--version|--name|--port|-[hvnp]) + --help | --version | --name | --port | -[hvnp]) return ;; - --file|--log|--music|--read|--Sound|--tiles|-[flmrSt]) + --file | --log | --music | --read | --Sound | --tiles | -[flmrSt]) _filedir return ;; - --Announce|-A) - COMPREPLY=( $( compgen -W 'IPv4 IPv6 none' -- "$cur" ) ) + --Announce | -A) + COMPREPLY=($(compgen -W 'IPv4 IPv6 none' -- "$cur")) return ;; - --debug|-d) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + --debug | -d) + COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) return ;; - --Meta|--server|-[Ms]) + --Meta | --server | -[Ms]) _known_hosts_real -- "$cur" return ;; - --Plugin|-P) - COMPREPLY=( $( compgen -W 'none esd sdl' -- "$cur" ) ) + --Plugin | -P) + COMPREPLY=($(compgen -W 'none esd sdl' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _freeciv freeciv{,-{gtk{2,3},sdl,xaw}} civclient + complete -F _freeciv freeciv{,-{gtk{2,3},sdl,xaw}} civclient # ex: filetype=sh diff --git a/completions/freeciv-server b/completions/freeciv-server index 78f57afae8e..a34b5a29fe5 100644 --- a/completions/freeciv-server +++ b/completions/freeciv-server @@ -6,17 +6,17 @@ _civserver() _init_completion || return case $prev in - -f|-g|-l|-r|--file|--log|--gamelog|--read) + -f | -g | -l | -r | --file | --log | --gamelog | --read) _filedir return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _civserver civserver freeciv-server + complete -F _civserver civserver freeciv-server # ex: filetype=sh diff --git a/completions/function b/completions/function index fbcf10d285b..133d721d8eb 100644 --- a/completions/function +++ b/completions/function @@ -5,33 +5,12 @@ _function() local cur prev words cword _init_completion || return - if [[ $1 == @(declare|typeset) ]]; then - if [[ $cur == [-+]* ]]; then - local opts - opts=( $( _parse_usage "$1" ) ) - # Most options also have a '+' form. We'll exclude the ones that don't with compgen. - opts+=( ${opts[*]/-/+} ) - COMPREPLY=( $( compgen -W "${opts[*]}" -X '+[Ffgp]' -- "$cur" ) ) - else - local i=1 - while [[ ${words[i]} == [-+]* ]]; do - if [[ ${words[i]} == -*[fF]* ]]; then - COMPREPLY=( $( compgen -A function -- "$cur" ) ) - return - fi - ((i++)) - done - if [[ $i -gt 1 ]]; then - # There was at least one option and it was not one that limited operations to functions - COMPREPLY=( $( compgen -A variable -- "$cur" ) ) - fi - fi - elif [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -A function -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -A function -- "$cur")) else - COMPREPLY=( "() $( type -- ${words[1]} | command sed -e 1,2d )" ) + COMPREPLY=("() $(type -- ${words[1]} | command sed -e 1,2d)") fi } && -complete -F _function function declare typeset + complete -F _function function # ex: filetype=sh diff --git a/completions/fusermount b/completions/fusermount index ba42b1d6e94..7e4892259b0 100644 --- a/completions/fusermount +++ b/completions/fusermount @@ -10,19 +10,19 @@ _fusermount() return ;; -*u) - COMPREPLY=( $( compgen -W "$( awk \ + COMPREPLY=($(compgen -W "$(awk \ '{ if ($3 ~ /^fuse(\.|$)/) print $2 }' /etc/mtab \ - 2>/dev/null )" -- "$cur" ) ) + 2>/dev/null)" -- "$cur")) return ;; esac - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) else _filedir -d fi } && -complete -F _fusermount fusermount + complete -F _fusermount fusermount # ex: filetype=sh diff --git a/completions/gcc b/completions/gcc index d593d092114..41913b01164 100644 --- a/completions/gcc +++ b/completions/gcc @@ -1,66 +1,87 @@ # gcc(1) completion -*- shell-script -*- -# -# The only unusual feature is that we don't parse "gcc --help -v" output -# directly, because that would include the options of all the other backend -# tools (linker, assembler, preprocessor, etc) without any indication that -# you cannot feed such options to the gcc driver directly. (For example, the -# linker takes a -z option, but you must type -Wl,-z for gcc.) Instead, we -# ask the driver ("g++") for the name of the compiler ("cc1"), and parse the -# --help output of the compiler. _gcc() { - local cur prev words cword + local cur prev prev2 words cword argument prefix prefix_length _init_completion || return - local cc backend + # Test that GCC is recent enough and if not fallback to + # parsing of --completion option. + if ! $1 --completion=" " 2>/dev/null; then + if [[ $cur == -* ]]; then + local cc=$($1 -print-prog-name=cc1 2>/dev/null) + [[ $cc ]] || return + COMPREPLY=($(compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' | + command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \ + -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + else + _filedir + fi + return + fi - case $1 in - gcj) - backend=jc1 - ;; - gpc) - backend=gpc1 - ;; - *77) - backend=f771 - ;; - *95) - backend=f951 - ;; - *) - backend=cc1 # (near-)universal backend - ;; - esac + # extract also for situations like: -fsanitize=add + if ((cword > 2)); then + prev2="${COMP_WORDS[cword - 2]}" + fi - if [[ "$cur" == -* ]]; then - cc=$( $1 -print-prog-name=$backend 2>/dev/null ) - [[ $cc ]] || return - # sink stderr: - # for C/C++/ObjectiveC it's useless - # for FORTRAN/Java it's an error - COMPREPLY=( $( compgen -W "$( $cc --help 2>/dev/null | tr '\t' ' ' |\ - command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/' )" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - else + # sample: -fsan + if [[ $cur == -* ]]; then + argument=$cur + prefix="" + # sample: -fsanitize= + elif [[ $cur == "=" && $prev == -* ]]; then + argument=$prev$cur + prefix=$prev$cur + # sample: -fsanitize=add + elif [[ $prev == "=" && $prev2 == -* ]]; then + argument=$prev2$prev$cur + prefix=$prev2$prev + # sample: --param lto- + elif [[ $prev == --param ]]; then + argument="$prev $cur" + prefix="$prev " + fi + + if [[ ! -v argument ]]; then _filedir + else + # In situation like '-fsanitize=add' $cur is equal to last token. + # Thus we need to strip the beginning of suggested option. + prefix_length=$((${#prefix} + 1)) + local flags=$($1 --completion="$argument" | cut -c $prefix_length-) + [[ ${flags} == "=*" ]] && compopt -o nospace 2>/dev/null + COMPREPLY=($(compgen -W "$flags" -- "")) fi } && -complete -F _gcc gcc{,-5,-6,-7,-8} g++{,-5,-6,-7,-8} g77 g95 \ - gccgo{,-5,-6,-7,-8} gcj gfortran{,-5,-6,-7,-8} gpc && -{ - cc --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand cc ) == *gcc* ]] && \ - complete -F _gcc cc || complete -F _minimal cc - c++ --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand c++ ) == *g++* ]] && \ - complete -F _gcc c++ || complete -F _minimal c++ - f77 --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand f77 ) == *gfortran* ]] && \ - complete -F _gcc f77 || complete -F _minimal f77 - f95 --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand f95 ) == *gfortran* ]] && \ - complete -F _gcc f95 || complete -F _minimal f95 -} + complete -F _gcc gcc{,-5,-6,-7,-8} g++{,-5,-6,-7,-8} g77 g95 \ + gccgo{,-5,-6,-7,-8} gcj gfortran{,-5,-6,-7,-8} gpc && + { + if cc --version 2>/dev/null | command grep -q GCC || + [[ $(_realcommand cc) == *gcc* ]]; then + complete -F _gcc cc + else + complete -F _minimal cc + fi + if c++ --version 2>/dev/null | command grep -q GCC || + [[ $(_realcommand c++) == *g++* ]]; then + complete -F _gcc c++ + else + complete -F _minimal c++ + fi + if f77 --version 2>/dev/null | command grep -q GCC || + [[ $(_realcommand f77) == *gfortran* ]]; then + complete -F _gcc f77 + else + complete -F _minimal f77 + fi + if f95 --version 2>/dev/null | command grep -q GCC || + [[ $(_realcommand f95) == *gfortran* ]]; then + complete -F _gcc f95 + else + complete -F _minimal f95 + fi + } # ex: filetype=sh diff --git a/completions/gcl b/completions/gcl index 5d1ca5f32a7..73a18b2d732 100644 --- a/completions/gcl +++ b/completions/gcl @@ -8,14 +8,14 @@ _gcl() _init_completion || return # completing an option (may or may not be separated by a space) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-eval -load -f -batch -dir -libdir -compile - -o-file -c-file -h-file -data-file -system-p' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-eval -load -f -batch -dir -libdir -compile + -o-file -c-file -h-file -data-file -system-p' -- "$cur")) else _filedir fi } && -complete -F _gcl -o default gcl + complete -F _gcl -o default gcl # ex: filetype=sh diff --git a/completions/gdb b/completions/gdb index 75414782c41..333766aff23 100644 --- a/completions/gdb +++ b/completions/gdb @@ -6,41 +6,42 @@ _gdb() _init_completion || return # gdb [options] --args executable-file [inferior-arguments ...] - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == --args ]]; then - _command_offset $((i+1)) + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == --args ]]; then + _command_offset $((i + 1)) return $? fi done # gdb [options] [executable-file [core-file or process-id]] - if [[ $cword -eq 1 ]]; then + if ((cword == 1)); then local IFS compopt -o filenames - if [[ "$cur" == */* ]]; then + if [[ $cur == */* ]]; then # compgen -c works as expected if $cur contains any slashes. IFS=$'\n' - COMPREPLY=( $( PATH="$PATH:." compgen -d -c -- "$cur" ) ) + COMPREPLY=($(PATH="$PATH:." compgen -d -c -- "$cur")) else # otherwise compgen -c contains Bash's built-in commands, # functions and aliases. Thus we need to retrieve the program # names manually. IFS=":" - local path_array=( $( \ - command sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH" ) ) + local path_array=($( + command sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH" + )) IFS=$'\n' - COMPREPLY=( $( compgen -d -W '$(find "${path_array[@]}" . \ + COMPREPLY=($(compgen -d -W '$(find ${path_array[@]+"${path_array[@]}"} . \ -mindepth 1 -maxdepth 1 -not -type d -executable \ - -printf "%f\\n" 2>/dev/null)' -- "$cur" ) ) + -printf "%f\\n" 2>/dev/null)' -- "$cur")) fi - elif [[ $cword -eq 2 ]]; then - COMPREPLY=( $( compgen -W "$( command ps axo comm,pid | \ - awk '{if ($1 ~ /^'"${prev##*/}"'/) print $2}' )" -- "$cur" ) ) + elif ((cword == 2)); then + COMPREPLY=($(compgen -W "$(command ps axo comm,pid | + awk '{if ($1 ~ /^'"${prev##*/}"'/) print $2}')" -- "$cur")) compopt -o filenames - COMPREPLY+=( $( compgen -f -X '!?(*/)core?(.+([0-9]))' -o plusdirs \ - -- "$cur" ) ) + COMPREPLY+=($(compgen -f -X '!?(*/)core?(.?*)' -o plusdirs \ + -- "$cur")) fi } && -complete -F _gdb gdb + complete -F _gdb gdb # ex: filetype=sh diff --git a/completions/genaliases b/completions/genaliases index f9a9890a723..5953b9efd70 100644 --- a/completions/genaliases +++ b/completions/genaliases @@ -5,11 +5,11 @@ _genaliases() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--quiet --help' -- "$cur")) fi } && -complete -F _genaliases genaliases + complete -F _genaliases genaliases # ex: filetype=sh diff --git a/completions/gendiff b/completions/gendiff index cb9bab39109..d37793f60cb 100644 --- a/completions/gendiff +++ b/completions/gendiff @@ -5,8 +5,8 @@ _gendiff() local cur prev words cword _init_completion -o '@(diff|patch)' || return - [[ $cword -eq 1 ]] && _filedir -d + ((cword == 1)) && _filedir -d } && -complete -F _gendiff gendiff + complete -F _gendiff gendiff # ex: filetype=sh diff --git a/completions/genisoimage b/completions/genisoimage index caf6d457be2..dfa39c0ab21 100644 --- a/completions/genisoimage +++ b/completions/genisoimage @@ -6,14 +6,14 @@ _mkisofs() _init_completion || return case $prev in - -o|-abstract|-biblio|-check-session|-copyright|-log-file| \ - -root-info|-prep-boot|-*-list) + -o | -abstract | -biblio | -check-session | -copyright | -log-file | \ + -root-info | -prep-boot | -*-list) _filedir return ;; -*-charset) - COMPREPLY=( $( compgen -W '$( mkisofs -input-charset \ - help 2>&1 | tail -n +3 )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(mkisofs -input-charset \ + help 2>&1 | tail -n +3)' -- "$cur")) return ;; -uid) @@ -26,13 +26,13 @@ _mkisofs() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) else _filedir fi } && -complete -F _mkisofs mkisofs genisoimage + complete -F _mkisofs mkisofs genisoimage # ex: filetype=sh diff --git a/completions/geoiplookup b/completions/geoiplookup index 0c92548aefa..c60be8986eb 100644 --- a/completions/geoiplookup +++ b/completions/geoiplookup @@ -6,7 +6,7 @@ _geoiplookup() _init_completion || return case $prev in - -h|-'?'|-v) + -h | -'?' | -v) return ;; -d) @@ -20,7 +20,7 @@ _geoiplookup() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1" -h)' -- "$cur")) return fi @@ -28,6 +28,6 @@ _geoiplookup() [[ $1 == *6 ]] && ipvx=-6 || ipvx=-4 _known_hosts_real $ipvx -- "$cur" } && -complete -F _geoiplookup geoiplookup geoiplookup6 + complete -F _geoiplookup geoiplookup geoiplookup6 # ex: filetype=sh diff --git a/completions/getconf b/completions/getconf index 80be667c60f..de1ad2d66ee 100644 --- a/completions/getconf +++ b/completions/getconf @@ -11,20 +11,22 @@ _getconf() return ;; -v) - COMPREPLY=( $( compgen -W \ - '$( "$1" -a 2>/dev/null | awk "{ print \$1 }" )' -- \ - "${cur:-POSIX_V}" ) ) + COMPREPLY=($(compgen -W \ + '$("$1" -a 2>/dev/null | awk "{ print \$1 }")' -- \ + "${cur:-POSIX_V}")) return ;; esac - if [[ $prev == PATH_MAX ]]; then # TODO more path vars, better handling + if [[ $prev == PATH_MAX ]]; then # TODO more path vars, better handling _filedir elif [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-a -v' -- "$cur" ) ) + COMPREPLY=($(compgen -W '-a -v' -- "$cur")) else - COMPREPLY=( $( compgen -W \ - '$( "$1" -a 2>/dev/null | awk "{ print \$1 }" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + '$("$1" -a 2>/dev/null | awk "{ print \$1 }")' -- "$cur")) fi } && -complete -F _getconf getconf + complete -F _getconf getconf + +# ex: filetype=sh diff --git a/completions/getent b/completions/getent index 288fae28b20..4c54a242447 100644 --- a/completions/getent +++ b/completions/getent @@ -6,16 +6,16 @@ _getent() _init_completion -s || return local i db - for (( i=1; i < cword; i++ )); do + for ((i = 1; i < cword; i++)); do case ${words[i]} in - --version|--usage|--help|-!(-*)[V?]) + --version | --usage | --help | -!(-*)[V?]) return ;; - --service|-!(-*)s) - (( i++ )) - ;; - -*) + --service | -!(-*)s) + ((i++)) ;; + -*) ;; + *) # First non-option value is the db db=${words[i]} @@ -24,40 +24,39 @@ _getent() esac done - case $db in + case ${db-} in passwd) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) return ;; group) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=($(compgen -g -- "$cur")) return ;; services) - COMPREPLY=( $( compgen -s -- "$cur" ) ) + COMPREPLY=($(compgen -s -- "$cur")) return ;; hosts) - COMPREPLY=( $( compgen -A hostname -- "$cur" ) ) + COMPREPLY=($(compgen -A hostname -- "$cur")) return ;; - protocols|networks|ahosts|ahostsv4|ahostsv6|rpc) - COMPREPLY=( $( compgen -W "$( $1 $db | \ - awk '{ print $1 }' )" -- "$cur" ) ) + protocols | networks | ahosts | ahostsv4 | ahostsv6 | rpc) + COMPREPLY=($(compgen -W "$($1 $db | + awk '{ print $1 }')" -- "$cur")) return ;; - aliases|shadow|gshadow) - COMPREPLY=( $( compgen -W "$( $1 $db | cut -d: -f1 )" \ - -- "$cur" ) ) + aliases | shadow | gshadow) + COMPREPLY=($(compgen -W "$($1 $db | cut -d: -f1)" -- "$cur")) return ;; - ethers|netgroup) + ethers | netgroup) return ;; esac case $prev in - -s|--service) + -s | --service) return ;; esac @@ -65,14 +64,14 @@ _getent() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - elif [[ -z $db ]]; then - COMPREPLY=( $( compgen -W 'passwd group hosts services protocols + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + elif [[ ! -v db ]]; then + COMPREPLY=($(compgen -W 'passwd group hosts services protocols networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc - shadow gshadow' -- "$cur" ) ) + shadow gshadow' -- "$cur")) fi } && -complete -F _getent getent + complete -F _getent getent # ex: filetype=sh diff --git a/completions/gkrellm b/completions/gkrellm index 52d2a651ae9..c38c5ae143a 100644 --- a/completions/gkrellm +++ b/completions/gkrellm @@ -6,34 +6,34 @@ _gkrellm() _init_completion || return case $prev in - -t|--theme) + -t | --theme) _filedir -d return ;; - -p|--plugin) + -p | --plugin) _filedir so return ;; - -s|--server) + -s | --server) _known_hosts_real -- "$cur" return ;; - -l|--logfile) + -l | --logfile) _filedir return ;; - -g|--geometry|-c|--config|-P|--port|-d|--debug-level) + -g | --geometry | -c | --config | -P | --port | -d | --debug-level) # Argument required but no completions available return ;; - -h|--help|-v|--version) + -h | --help | -v | --version) # All other options are noop with these return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) } && -complete -F _gkrellm gkrellm gkrellm2 + complete -F _gkrellm gkrellm gkrellm2 # ex: filetype=sh diff --git a/completions/gm b/completions/gm index 88c233c6ae6..43045f12656 100644 --- a/completions/gm +++ b/completions/gm @@ -2,8 +2,8 @@ _gm_commands() { - COMPREPLY+=( $( compgen -W '$( "$1" help | - awk "/^ +[^ ]+ +- / { print \$1 }" )' -- "$cur" ) ) + COMPREPLY+=($(compgen -W '$("$1" help | + awk "/^ +[^ ]+ +- / { print \$1 }")' -- "$cur")) } _gm() @@ -11,7 +11,7 @@ _gm() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then + if ((cword == 1)); then _gm_commands "$1" return elif [[ $cword -eq 2 && ${words[1]} == time ]]; then @@ -32,9 +32,9 @@ _gm() ;; esac - # TODO... defer some commnds to the imagemagick "gm"less completions etc? + # TODO... defer some commands to the imagemagick "gm"less completions etc? compopt -o default } && -complete -F _gm gm + complete -F _gm gm # ex: filetype=sh diff --git a/completions/gnatmake b/completions/gnatmake index 4cd24d2e3bf..5f4b96397d3 100644 --- a/completions/gnatmake +++ b/completions/gnatmake @@ -6,21 +6,21 @@ _gnatmake() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # relevant (and less relevant ;-) )options completion - COMPREPLY=( $( compgen -W '-a -c -f -i -j -k -m -M -n -o -q -s -v -z + COMPREPLY=($(compgen -W '-a -c -f -i -j -k -m -M -n -o -q -s -v -z -aL -A -aO -aI -I -I- -L -nostdinc -nostdlib -cargs -bargs -largs -fstack-check -fno-inline -g -O1 -O0 -O2 -O3 -gnata -gnatA -gnatb -gnatc -gnatd -gnatD -gnate -gnatE -gnatf -gnatF -gnatg -gnatG -gnath -gnati -gnatk -gnatl -gnatL -gnatm -gnatn -gnato -gnatO -gnatp -gnatP -gnatq -gnatR -gnats -gnatt -gnatT -gnatu -gnatU -gnatv -gnatws -gnatwe -gnatwl -gnatwu -gnatW -gnatx -gnatX -gnaty - -gnatz -gnatZ -gnat83' -- "$cur" ) ) + -gnatz -gnatZ -gnat83' -- "$cur")) else # source file completion _filedir '@(adb|ads)' fi } && -complete -F _gnatmake gnatmake + complete -F _gnatmake gnatmake # ex: filetype=sh diff --git a/completions/gnokii b/completions/gnokii index 95ccaeae725..039141aecdd 100644 --- a/completions/gnokii +++ b/completions/gnokii @@ -3,7 +3,7 @@ _gnokii_memory_type() { # TODO: reduce the number of choices - COMPREPLY=( $( compgen -W "IN OU SM ME MT" -- "$cur" ) ) + COMPREPLY=($(compgen -W "IN OU SM ME MT" -- "$cur")) } _gnokii() @@ -20,123 +20,123 @@ _gnokii() local config_file for config_file in "$XDG_CONFIG_HOME/gnokii/config" \ "$HOME/.config/gnokii/config" "$HOME/.gnokiirc" \ - "$XDG_CONFIG_DIRS/gnokii/config" /etc/gnokiirc ; do + "$XDG_CONFIG_DIRS/gnokii/config" /etc/gnokiirc; do [[ -f $config_file ]] && break done [[ ! -f $config_file ]] && return - COMPREPLY=( $( compgen -W \ - "$( command sed -n 's/^\[phone_\(.*\)\]/\1/p' $config_file )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + "$(command sed -n 's/^\[phone_\(.*\)\]/\1/p' $config_file)" \ + -- "$cur")) return ;; --help) - COMPREPLY=( $( compgen -W 'all monitor sms mms phonebook calendar + COMPREPLY=($(compgen -W 'all monitor sms mms phonebook calendar todo dial profile settings wap logo ringtone security file - other' -- "$cur" ) ) + other' -- "$cur")) return ;; - --version|--shell|ping) + --version | --shell | ping) return ;; # MONITOR --monitor) - COMPREPLY=( $( compgen -W 'delay once' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'delay once' -- "$cur")) return ;; - --getdisplaystatus|--displayoutput) + --getdisplaystatus | --displayoutput) return ;; --netmonitor) - COMPREPLY=( $( compgen -W 'reset off field devel next nr' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'reset off field devel next nr' \ + -- "$cur")) return ;; # SMS --sendsms) - # (how)TODO ? + # (how)TODO ? return ;; --savesms) - COMPREPLY=( $( compgen -W '--sender --smsc --smscno --folder - --location --sent --read --deliver --datetime' -- "$cur" ) ) + COMPREPLY=($(compgen -W '--sender --smsc --smscno --folder + --location --sent --read --deliver --datetime' -- "$cur")) return ;; - --memory-type|--memory|--getsms|--deletesms|--getmms|--deletemms|\ - --getphonebook|--deletephonebook) + --memory-type | --memory | --getsms | --deletesms | --getmms | --deletemms | \ + --getphonebook | --deletephonebook) _gnokii_memory_type return ;; - --getsmsc|--getcalendarnote|--deletecalendarnote|--gettodo|\ - --getspeeddial) + --getsmsc | --getcalendarnote | --deletecalendarnote | --gettodo | \ + --getspeeddial) # TODO: grab a specific entry ID return ;; - --setsmsc|--smsreader|--createsmsfolder|--deletealltodos|\ - --showsmsfolderstatus) + --setsmsc | --smsreader | --createsmsfolder | --deletealltodos | \ + --showsmsfolderstatus) return ;; - --deletesmsfolder|--folder) + --deletesmsfolder | --folder) # TODO: folderid return ;; --writephonebook) - COMPREPLY=( $( compgen -W '--overwrite --find-free --memory-type - --location --vcard --ldif' -- "$cur" ) ) + COMPREPLY=($(compgen -W '--overwrite --find-free --memory-type + --location --vcard --ldif' -- "$cur")) return ;; - --writecalendarnote|--writetodo) + --writecalendarnote | --writetodo) _filedir vcf return ;; # DIAL - --setspeeddial|--dialvoice|--senddtmf|--answercall|--hangup) + --setspeeddial | --dialvoice | --senddtmf | --answercall | --hangup) # TODO return ;; --divert) - COMPREPLY=( $( compgen -W '--op' -- "$cur" ) ) + COMPREPLY=($(compgen -W '--op' -- "$cur")) return ;; # PROFILE - --getprofile|--setactiveprofile) + --getprofile | --setactiveprofile) # TODO return ;; - --setprofile|--getactiveprofile) + --setprofile | --getactiveprofile) return ;; # SETTINGS --reset) - COMPREPLY=( $( compgen -W 'soft hard' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'soft hard' -- "$cur")) return ;; - --setdatetime|--setalarm) + --setdatetime | --setalarm) # TODO return ;; - --getdatetime|--getalarm) + --getdatetime | --getalarm) return ;; # WAP - --getwapbookmark|--writewapbookmark|--deletewapbookmark|\ - --getwapsetting|--writewapsetting|--activatewapsetting) + --getwapbookmark | --writewapbookmark | --deletewapbookmark | \ + --getwapsetting | --writewapsetting | --activatewapsetting) return ;; # LOGOS --sendlogo) - COMPREPLY=( $( compgen -W 'caller op picture' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'caller op picture' -- "$cur")) return ;; - --setlogo|--getlogo) - COMPREPLY=( $( compgen -W 'op startup caller dealer text' \ - -- "$cur" ) ) + --setlogo | --getlogo) + COMPREPLY=($(compgen -W 'op startup caller dealer text' \ + -- "$cur")) return ;; --viewlogo) @@ -145,91 +145,93 @@ _gnokii() ;; --entersecuritycode) - COMPREPLY=( $( compgen -W 'PIN PIN2 PUK PUK2 SEC' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'PIN PIN2 PUK PUK2 SEC' -- "$cur")) return ;; - # TODO: RINGTONES + # TODO: RINGTONES esac # second level completion - if [[ $((cword-2)) -ge 1 && ${words[cword-2]} =~ --* ]]; then - pprev=${words[cword-2]} + if [[ $((cword - 2)) -ge 1 && ${words[cword - 2]} =~ --* ]]; then + pprev=${words[cword - 2]} case $pprev in --setspeeddial) _gnokii_memory_type return ;; - --getsms|--deletesms|--getmms|--deletemms|--getphonebook|\ - --writetodo|--writecalendarnote) + --getsms | --deletesms | --getmms | --deletemms | --getphonebook | \ + --writetodo | --writecalendarnote) # TODO: start number return ;; - --gettodo|--getcalendarnote) - COMPREPLY=( $( compgen -W '{1..9} end --vCal' -- "$cur" ) ) + --gettodo | --getcalendarnote) + COMPREPLY=($(compgen -W '{1..9} end --vCal' -- "$cur")) return ;; --deletecalendarnote) - COMPREPLY=( $( compgen -W '{1..9} end' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..9} end' -- "$cur")) return ;; --divert) - COMPREPLY=( $( compgen -W 'register enable query disable - erasure' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'register enable query disable + erasure' -- "$cur")) return ;; esac fi # third level completion - if [[ $((cword-3)) -ge 1 && ${words[cword-3]} =~ --* ]]; then - tprev=${words[cword-3]} + if [[ $((cword - 3)) -ge 1 && ${words[cword - 3]} =~ --* ]]; then + tprev=${words[cword - 3]} case $tprev in - --deletesms|--deletemms) - COMPREPLY=( $( compgen -W 'end' -- "$cur" ) ) + --deletesms | --deletemms) + COMPREPLY=($(compgen -W 'end' -- "$cur")) return ;; - --getphonebook|--writetodo|--writecalendarnote) - COMPREPLY=( $( compgen -W '{1..9} end' -- "$cur" ) ) + --getphonebook | --writetodo | --writecalendarnote) + COMPREPLY=($(compgen -W '{1..9} end' -- "$cur")) return ;; - --gettodo|--getcalendarnote) - [[ ${words[cword-1]} == end ]] && \ - COMPREPLY=( $( compgen -W '--vCal' -- "$cur" ) ) + --gettodo | --getcalendarnote) + [[ ${words[cword - 1]} == end ]] && + COMPREPLY=($(compgen -W '--vCal' -- "$cur")) return ;; --divert) - COMPREPLY=( $( compgen -W '--type' -- "$cur" ) ) + COMPREPLY=($(compgen -W '--type' -- "$cur")) return + ;; esac fi # fourth level completion - if [[ $((cword-4)) -ge 1 && ${words[cword-4]} =~ --* ]]; then - fprev=${words[cword-4]} + if [[ $((cword - 4)) -ge 1 && ${words[cword - 4]} =~ --* ]]; then + fprev=${words[cword - 4]} case $fprev in --getphonebook) - COMPREPLY=( $( compgen -W '--raw --vcard --ldif' -- "$cur" ) ) + COMPREPLY=($(compgen -W '--raw --vcard --ldif' -- "$cur")) return ;; --divert) - COMPREPLY=( $( compgen -W 'all busy noans outofreach notavail' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'all busy noans outofreach notavail' \ + -- "$cur")) return + ;; esac fi # safer to use LANG=C - local all_cmd="$( LANG=C _parse_help $1 "--help all" )" + local all_cmd="$(LANG=C _parse_help $1 "--help all")" # these 2 below are allowed in combination with others - local main_cmd=$( command grep -v -- '--config\|--phone' <<<"$all_cmd" ) + local main_cmd=$(command grep -v -- '--config\|--phone' <<<"$all_cmd") # don't provide main command completions if one is # already on the command line - [[ $COMP_LINE =~ $( tr ' ' '\b|'<<<$main_cmd ) ]] && return + [[ $COMP_LINE =~ $(tr ' ' '\b|' <<<$main_cmd) ]] && return - COMPREPLY=( $( compgen -W "$all_cmd" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$all_cmd" -- "$cur")) } && -complete -F _gnokii gnokii + complete -F _gnokii gnokii # ex: filetype=sh diff --git a/completions/gnome-mplayer b/completions/gnome-mplayer index 9a250419930..32d93fc3b01 100644 --- a/completions/gnome-mplayer +++ b/completions/gnome-mplayer @@ -6,11 +6,11 @@ _gnome_mplayer() _init_completion -s || return case $prev in - -'?'|--help|--help-all|--help-gtk) + -'?' | --help | --help-all | --help-gtk) return ;; - --showcontrols|--showsubtitles|--autostart) - COMPREPLY=( $( compgen -w '0 1' -- "$cur" ) ) + --showcontrols | --showsubtitles | --autostart) + COMPREPLY=($(compgen -w '0 1' -- "$cur")) return ;; --subtitle) @@ -18,7 +18,7 @@ _gnome_mplayer() return ;; --tvdriver) - COMPREPLY=( $( compgen -W 'v4l v4l2' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'v4l v4l2' -- "$cur")) return ;; esac @@ -26,14 +26,13 @@ _gnome_mplayer() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _gnome_mplayer gnome-mplayer + complete -F _gnome_mplayer gnome-mplayer # ex: filetype=sh diff --git a/completions/gnome-screenshot b/completions/gnome-screenshot index fec77d76323..b3594d203d1 100644 --- a/completions/gnome-screenshot +++ b/completions/gnome-screenshot @@ -6,14 +6,14 @@ _gnome_screenshot() _init_completion -s || return case $prev in - --help|--help-*|--version|--delay|--display|-!(-*)[hd]) + --help | --help-* | --version | --delay | --display | -!(-*)[hd]) return ;; - --border-effect|-!(-*)e) - COMPREPLY=( $( compgen -W 'shadow border vintage none' -- "$cur" ) ) + --border-effect | -!(-*)e) + COMPREPLY=($(compgen -W 'shadow border vintage none' -- "$cur")) return ;; - --file|-!(-*)f) + --file | -!(-*)f) _filedir '@(jp?(e)|pn)g' return ;; @@ -22,10 +22,10 @@ _gnome_screenshot() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _gnome_screenshot gnome-screenshot + complete -F _gnome_screenshot gnome-screenshot # ex: filetype=sh diff --git a/completions/gpasswd b/completions/gpasswd index 2b7276574ac..f1f22003003 100644 --- a/completions/gpasswd +++ b/completions/gpasswd @@ -6,20 +6,20 @@ _gpasswd() _init_completion || return case $prev in - --add|--delete|--administrators|--members|-!(-*)[adAM]) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + --add | --delete | --administrators | --members | -!(-*)[adAM]) + COMPREPLY=($(compgen -u -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # TODO: only -A and -M can be combined - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=($(compgen -g -- "$cur")) } && -complete -F _gpasswd gpasswd + complete -F _gpasswd gpasswd # ex: filetype=sh diff --git a/completions/gpg b/completions/gpg index 143737e86f8..f0ca8845393 100644 --- a/completions/gpg +++ b/completions/gpg @@ -6,33 +6,33 @@ _gpg() _init_completion || return case $prev in - --sign|--clearsign|--decrypt-files|--load-extension|-!(-*)s) + --sign | --clearsign | --decrypt-files | --load-extension | -!(-*)s) _filedir return ;; - --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key) + --export | --sign-key | --lsign-key | --nrsign-key | --nrlsign-key | --edit-key) # return list of public keys - COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ + COMPREPLY=($(compgen -W "$($1 --list-keys 2>/dev/null | command sed -ne \ 's@^pub.*/\([^ ]*\).*$@\1@p' -ne \ - 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) + 's@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur")) return ;; - --recipient|-!(-*)r) - COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ - 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) + --recipient | -!(-*)r) + COMPREPLY=($(compgen -W "$($1 --list-keys 2>/dev/null | command sed -ne \ + 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur")) if [[ -e ~/.gnupg/gpg.conf ]]; then - COMPREPLY+=( $( compgen -W "$( command sed -ne \ + COMPREPLY+=($(compgen -W "$(command sed -ne \ 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \ - ~/.gnupg/gpg.conf )" -- "$cur" ) ) + ~/.gnupg/gpg.conf)" -- "$cur")) fi return - ;; + ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$($1 --dump-options)' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$($1 --dump-options)' -- "$cur")) fi } && -complete -F _gpg -o default gpg + complete -F _gpg -o default gpg # ex: filetype=sh diff --git a/completions/gpg2 b/completions/gpg2 index 3e73d949554..cfa402318f4 100644 --- a/completions/gpg2 +++ b/completions/gpg2 @@ -10,33 +10,33 @@ _gpg2() _filedir -d return ;; - --sign|--clearsign|--options|--decrypt|-!(-*)s) + --sign | --clearsign | --options | --decrypt | -!(-*)s) _filedir return ;; - --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key) + --export | --sign-key | --lsign-key | --nrsign-key | --nrlsign-key | --edit-key) # return list of public keys - COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ + COMPREPLY=($(compgen -W "$($1 --list-keys 2>/dev/null | command sed -ne \ 's@^pub.*/\([^ ]*\).*$@\1@p' -ne \ - 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) + 's@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur")) return ;; - --recipient|-!(-*)r) - COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | \ - command sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) + --recipient | -!(-*)r) + COMPREPLY=($(compgen -W "$($1 --list-keys 2>/dev/null | + command sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur")) if [[ -e ~/.gnupg/gpg.conf ]]; then - COMPREPLY+=( $( compgen -W "$( command sed -ne \ + COMPREPLY+=($(compgen -W "$(command sed -ne \ 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \ - ~/.gnupg/gpg.conf)" -- "$cur" ) ) + ~/.gnupg/gpg.conf)" -- "$cur")) fi - return - ;; + return + ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$($1 --dump-options)' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$($1 --dump-options)' -- "$cur")) fi } && -complete -F _gpg2 -o default gpg2 + complete -F _gpg2 -o default gpg2 # ex: filetype=sh diff --git a/completions/gpgv b/completions/gpgv index 83c81624478..29315c9c2f9 100644 --- a/completions/gpgv +++ b/completions/gpgv @@ -6,7 +6,7 @@ _gpgv() _init_completion || return case $prev in - --help|--version|--weak-digest|--*-fd|-!(-*)[?h]*) + --help | --version | --weak-digest | --*-fd | -!(-*)[?h]*) return ;; --keyring) @@ -23,15 +23,15 @@ _gpgv() _count_args "" "--@(weak-digest|*-fd|keyring|homedir)" if [[ $cur == -* && $args -eq 1 ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi - if [[ $args -gt 1 ]]; then + if ((args > 1)); then if [[ ${COMP_LINE,,} == *.@(asc|sig|sign)\ * ]]; then # Detached signature, only complete one arbitrary file arg and - - if [[ $args -eq 2 ]]; then - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + if ((args == 2)); then + COMPREPLY=($(compgen -W '-' -- "$cur")) _filedir fi else @@ -41,6 +41,6 @@ _gpgv() _filedir "@(asc|gpg|sig|sign)" fi } && -complete -F _gpgv gpgv gpgv2 + complete -F _gpgv gpgv gpgv2 # ex: filetype=sh diff --git a/completions/gphoto2 b/completions/gphoto2 index 94bf063465a..cbf84c0a3d2 100644 --- a/completions/gphoto2 +++ b/completions/gphoto2 @@ -18,37 +18,38 @@ _gphoto2() _filedir return ;; - -u|--upload-file) + -u | --upload-file) _filedir return ;; --port) - COMPREPLY=( $(compgen -W "$( $1 --list-ports 2>/dev/null | \ - awk 'NR>3 { print $1 }' )" -- "$cur") ) + COMPREPLY=($(compgen -W "$($1 --list-ports 2>/dev/null | + awk 'NR>3 { print $1 }')" -- "$cur")) __ltrim_colon_completions "$cur" return ;; --camera) local IFS=$'\n' - COMPREPLY=( $(compgen -W "$( $1 --list-cameras 2>/dev/null | \ - awk -F'"' 'NR>2 { print $2 }' )" -- "$cur") ) + COMPREPLY=($(compgen -W "$($1 --list-cameras 2>/dev/null | + awk -F'"' 'NR>2 { print $2 }')" -- "$cur")) return ;; - --get-config|--set-config|--set-config-index|--set-config-value) - COMPREPLY=( $(compgen -W "$( $1 --list-config 2>/dev/null \ - )" -- "$cur") ) + --get-config | --set-config | --set-config-index | --set-config-value) + COMPREPLY=($(compgen -W "$( + $1 --list-config 2>/dev/null + )" -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _gphoto2 gphoto2 + complete -F _gphoto2 gphoto2 # ex: filetype=sh diff --git a/completions/gprof b/completions/gprof index b9692badcd7..5a4ab2d4dfd 100644 --- a/completions/gprof +++ b/completions/gprof @@ -6,38 +6,37 @@ _gprof() _init_completion -s || return case $cur in - -A*|-C*|-J*|-p*|-P*|-q*|-Q*|-n*|-N*|-d*) + -A* | -C* | -J* | -p* | -P* | -q* | -Q* | -n* | -N* | -d*) return ;; -S*) cur=${cur:2} _filedir - COMPREPLY=( "${COMPREPLY[@]/#/-S}" ) + COMPREPLY=("${COMPREPLY[@]/#/-S}") return ;; -O*) cur=${cur:2} - COMPREPLY=( $( compgen -P -O -W 'auto bsd 4.4bsd magic prof' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -P -O -W 'auto bsd 4.4bsd magic prof' \ + -- "$cur")) return ;; esac case $prev in - -I|--directory-path) + -I | --directory-path) _filedir -d return ;; - -R|--file-ordering|--external-symbol-table) + -R | --file-ordering | --external-symbol-table) _filedir return ;; - -w|--width|-k|-m|--min-count|-h|--help|-e|-E|-f|-F) + -w | --width | -k | -m | --min-count | -h | --help | -e | -E | -f | -F) return ;; --file-format) - COMPREPLY=( $( compgen -W 'auto bsd 4.4bsd magic prof' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'auto bsd 4.4bsd magic prof' -- "$cur")) return ;; esac @@ -45,21 +44,13 @@ _gprof() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '--annotated-source --brief --exec-counts - --file-info --directory-path --no-annotated-source --print-path - --flat-profile --no-flat-profile --graph --no-graph --table-length= - --separate-files --no-exec-counts --function-ordering - --file-ordering --traditional --width= --all-lines --demangle - --no-demangle --no-static --static-call-graph - --ignore-non-functions -k --line --min-count= --time= --no-time= - --external-symbol-table= --display-unused-functions --debug --help - --file-format= --sum --version' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _gprof gprof + complete -F _gprof gprof # ex: filetype=sh diff --git a/completions/groupadd b/completions/groupadd index 0674a2f7256..5f67f2996bf 100644 --- a/completions/groupadd +++ b/completions/groupadd @@ -9,18 +9,18 @@ _groupadd() # with -g/--gid case $prev in - --gid|--key|--password|-!(-*)[gKp]) + --gid | --key | --password | -!(-*)[gKp]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _groupadd groupadd + complete -F _groupadd groupadd # ex: filetype=sh diff --git a/completions/groupdel b/completions/groupdel index 867b1741dfd..4d8ca7f726e 100644 --- a/completions/groupdel +++ b/completions/groupdel @@ -6,22 +6,22 @@ _groupdel() _init_completion || return case $prev in - -h|--help) + -h | --help) return ;; - -R|--root) + -R | --root) _filedir -d return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=($(compgen -g -- "$cur")) } && -complete -F _groupdel groupdel + complete -F _groupdel groupdel # ex: filetype=sh diff --git a/completions/groupmems b/completions/groupmems index 3bb5d8200d2..2e89a5ab40c 100644 --- a/completions/groupmems +++ b/completions/groupmems @@ -6,22 +6,22 @@ _groupmems() _init_completion || return case $prev in - -a|--add|-d|--delete) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + -a | --add | -d | --delete) + COMPREPLY=($(compgen -u -- "$cur")) return ;; - -g|--group) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + -g | --group) + COMPREPLY=($(compgen -g -- "$cur")) return ;; - -R|--root) + -R | --root) _filedir -d return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) } && -complete -F _groupmems groupmems + complete -F _groupmems groupmems # ex: filetype=sh diff --git a/completions/groupmod b/completions/groupmod index 3092adf1be2..5516d31c9bc 100644 --- a/completions/groupmod +++ b/completions/groupmod @@ -9,21 +9,21 @@ _groupmod() # with -g/--gid case $prev in - --gid|--help|--new-name|--password|-!(-*)[ghnp]) + --gid | --help | --new-name | --password | -!(-*)[ghnp]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=($(compgen -g -- "$cur")) } && -complete -F _groupmod groupmod + complete -F _groupmod groupmod # ex: filetype=sh diff --git a/completions/growisofs b/completions/growisofs index 04b29a55933..ee09fe6c7d8 100644 --- a/completions/growisofs +++ b/completions/growisofs @@ -6,16 +6,16 @@ _growisofs() _init_completion || return case $prev in - -version|-speed) + -version | -speed) return ;; - -Z|-M) + -Z | -M) compopt -o nospace _dvd_devices return ;; /?(r)dev/*) - if [[ $cur == =* ]] ; then + if [[ $cur == =* ]]; then # e.g. /dev/dvd=foo.iso, /dev/dvdrw=/dev/zero cur="${cur#=}" _filedir @@ -24,16 +24,16 @@ _growisofs() ;; esac - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # TODO: mkisofs options - COMPREPLY=( $( compgen -W '-dvd-compat -overburn -speed= -Z -M' \ - -- "$cur" ) ) - [[ ${COMPREPLY[@]} == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '-dvd-compat -overburn -speed= -Z -M' \ + -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _growisofs growisofs + complete -F _growisofs growisofs # ex: filetype=sh diff --git a/completions/grpck b/completions/grpck index c68642ea39e..a909774f2d7 100644 --- a/completions/grpck +++ b/completions/grpck @@ -6,21 +6,21 @@ _grpck() _init_completion || return case $prev in - --root|-!(-*)R) + --root | -!(-*)R) _filedir return ;; esac - if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) return fi _filedir } && -complete -F _grpck grpck + complete -F _grpck grpck # ex: filetype=sh diff --git a/completions/gssdp-discover b/completions/gssdp-discover new file mode 100644 index 00000000000..6ed678b4851 --- /dev/null +++ b/completions/gssdp-discover @@ -0,0 +1,35 @@ +# bash completion for gssdp-discover/device-sniffer -*- shell-script -*- + +_gssdp_discover() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --help | --target | --timeout | --rescan-interval | -[htnr]) + return + ;; + --interface | -i) + _available_interfaces -a + return + ;; + --message-type | -m) + [[ $1 == *gssdp-discover ]] || return + local types=$($1 --help 2>&1 | + command sed -ne 's/^.*--message-type=.*(\([^)]*\))$/\1/p') + COMPREPLY=($( + IFS+=, + compgen -W "$types" -- "$cur" + )) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + fi +} && + complete -F _gssdp_discover gssdp-discover gssdp-device-sniffer + +# ex: filetype=sh diff --git a/completions/gzip b/completions/gzip index 829c5602bc0..0144c3a33bf 100644 --- a/completions/gzip +++ b/completions/gzip @@ -6,39 +6,38 @@ _gzip() _init_completion || return case $prev in - --blocksize|--suffix|--help|--version|-!(-*)[bShV]) + --blocksize | --suffix | --help | --version | -!(-*)[bShV]) return ;; - --processes|-!(-*)p) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + --processes | -!(-*)p) + COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") {-1..-9}' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local IFS=$'\n' xspec="*.@(gz|t[ag]z)" [[ ${1##*/} == pigz ]] && xspec="*.@([gz]z|t[ag]z)" - if [[ "$prev" == --* ]]; then - [[ "$prev" == --@(decompress|list|test) ]] && xspec="!"$xspec - [[ "$prev" == --force ]] && xspec= - elif [[ "$prev" == -* ]]; then - [[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec - [[ "$prev" == -*f* ]] && xspec= + if [[ $prev == --* ]]; then + [[ $prev == --@(decompress|list|test) ]] && xspec="!"$xspec + [[ $prev == --force ]] && xspec= + elif [[ $prev == -* ]]; then + [[ $prev == -*[dlt]* ]] && xspec="!"$xspec + [[ $prev == -*f* ]] && xspec= fi _tilde "$cur" || return compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") + $(compgen -d -- "$cur")) } && -complete -F _gzip gzip pigz + complete -F _gzip gzip pigz # ex: filetype=sh diff --git a/completions/hcitool b/completions/hcitool index 38d66427d92..7c5b4afb426 100644 --- a/completions/hcitool +++ b/completions/hcitool @@ -3,28 +3,28 @@ _bluetooth_addresses() { if [[ -n ${COMP_BLUETOOTH_SCAN:-} ]]; then - COMPREPLY+=( $( compgen -W "$( hcitool scan | \ - awk '/^\t/{print $1}' )" -- "$cur" ) ) + COMPREPLY+=($(compgen -W "$(hcitool scan | + awk '/^\t/{print $1}')" -- "$cur")) fi } _bluetooth_devices() { - COMPREPLY+=( $( compgen -W "$( hcitool dev | \ - awk '/^\t/{print $1}' )" -- "$cur" ) ) + COMPREPLY+=($(compgen -W "$(hcitool dev | + awk '/^\t/{print $1}')" -- "$cur")) } _bluetooth_services() { - COMPREPLY=( $( compgen -W 'DID SP DUN LAN FAX OPUSH FTP HS HF HFAG SAP NAP + COMPREPLY=($(compgen -W 'DID SP DUN LAN FAX OPUSH FTP HS HF HFAG SAP NAP GN PANU HCRP HID CIP A2SRC A2SNK AVRCT AVRTG UDIUE UDITE SYNCML' \ - -- "$cur" ) ) + -- "$cur")) } _bluetooth_packet_types() { - COMPREPLY=( $( compgen -W 'DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3' \ + -- "$cur")) } _hcitool() @@ -38,7 +38,7 @@ _hcitool() return ;; --role) - COMPREPLY=( $( compgen -W 'm s' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'm s' -- "$cur")) return ;; --pkt-type) @@ -52,60 +52,60 @@ _hcitool() local arg _get_first_arg if [[ -z $arg ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else - COMPREPLY=( $( compgen -W 'dev inq scan name info spinq epinq cmd + COMPREPLY=($(compgen -W 'dev inq scan name info spinq epinq cmd con cc dc sr cpt rssi lq tpl afh lst auth enc key clkoff - clock' -- "$cur" ) ) + clock' -- "$cur")) fi else local args case $arg in - name|info|dc|rssi|lq|afh|auth|key|clkoff|lst) + name | info | dc | rssi | lq | afh | auth | key | clkoff | lst) _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_addresses fi ;; cc) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--role --pkt-type' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--role --pkt-type' -- "$cur")) else _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_addresses fi fi ;; sr) _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_addresses else - COMPREPLY=( $( compgen -W 'master slave' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'master slave' -- "$cur")) fi ;; cpt) _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_addresses else _bluetooth_packet_types fi ;; - tpl|enc|clock) + tpl | enc | clock) _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_addresses else - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + COMPREPLY=($(compgen -W '0 1' -- "$cur")) fi ;; esac fi } && -complete -F _hcitool hcitool + complete -F _hcitool hcitool _sdptool() { @@ -124,46 +124,46 @@ _sdptool() local arg _get_first_arg if [[ -z $arg ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else - COMPREPLY=( $( compgen -W 'search browse records add del get - setattr setseq' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'search browse records add del get + setattr setseq' -- "$cur")) fi else case $arg in search) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bdaddr --tree --raw --xml' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--bdaddr --tree --raw --xml' \ + -- "$cur")) else _bluetooth_services fi ;; - browse|records) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--tree --raw --xml' -- "$cur" ) ) + browse | records) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--tree --raw --xml' -- "$cur")) else _bluetooth_addresses fi ;; add) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--handle --channel' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--handle --channel' -- "$cur")) else _bluetooth_services fi ;; get) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bdaddr --tree --raw --xml' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--bdaddr --tree --raw --xml' \ + -- "$cur")) fi ;; esac fi } && -complete -F _sdptool sdptool + complete -F _sdptool sdptool _l2ping() { @@ -175,18 +175,18 @@ _l2ping() _bluetooth_devices return ;; - -s|-c|-t|-d) + -s | -c | -t | -d) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) else _bluetooth_addresses fi } && -complete -F _l2ping l2ping + complete -F _l2ping l2ping _rfcomm() { @@ -194,7 +194,7 @@ _rfcomm() _init_completion || return case $prev in - -f|--config) + -f | --config) _filedir return ;; @@ -208,21 +208,21 @@ _rfcomm() local arg _get_first_arg if [[ -z $arg ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else - COMPREPLY=( $( compgen -W 'show connect listen watch bind - release' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'show connect listen watch bind + release' -- "$cur")) fi else local args _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_devices else case $arg in - connect|bind) - if [[ $args -eq 3 ]]; then + connect | bind) + if ((args == 3)); then _bluetooth_addresses fi ;; @@ -230,7 +230,7 @@ _rfcomm() fi fi } && -complete -F _rfcomm rfcomm + complete -F _rfcomm rfcomm _ciptool() { @@ -248,25 +248,25 @@ _ciptool() local arg _get_first_arg if [[ -z $arg ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else - COMPREPLY=( $( compgen -W 'show search connect release loopback' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'show search connect release loopback' \ + -- "$cur")) fi else local args case $arg in - connect|release|loopback) + connect | release | loopback) _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_addresses fi ;; esac fi } && -complete -F _ciptool ciptool + complete -F _ciptool ciptool _dfutool() { @@ -274,21 +274,21 @@ _dfutool() _init_completion || return case $prev in - -d|--device) + -d | --device) _bluetooth_devices return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else local args _count_args case $args in 1) - COMPREPLY=( $( compgen -W 'verify modify upgrade archive' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'verify modify upgrade archive' \ + -- "$cur")) ;; 2) _filedir @@ -296,7 +296,7 @@ _dfutool() esac fi } && -complete -F _dfutool dfutool + complete -F _dfutool dfutool _hciconfig() { @@ -306,68 +306,69 @@ _hciconfig() local arg _get_first_arg if [[ -z $arg ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --all' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --all' -- "$cur")) else - COMPREPLY=( $( compgen -W 'up down reset rstat auth noauth encrypt + COMPREPLY=($(compgen -W 'up down reset rstat auth noauth encrypt noencrypt secmgr nosecmgr piscan noscan iscan pscan ptype name class voice iac inqmode inqdata inqtype inqparams pageparms pageto afhmode aclmtu scomtu putkey delkey commands features - version revision lm' -- "$cur" ) ) + version revision lm' -- "$cur")) fi else local args case $arg in - putkey|delkey) + putkey | delkey) _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_addresses fi ;; lm) _count_args - if [[ $args -eq 2 ]]; then - COMPREPLY=( $( compgen -W 'MASTER SLAVE NONE ACCEPT' \ - -- "$cur" ) ) + if ((args == 2)); then + COMPREPLY=($(compgen -W 'MASTER SLAVE NONE ACCEPT' \ + -- "$cur")) fi ;; ptype) _count_args - if [[ $args -eq 2 ]]; then + if ((args == 2)); then _bluetooth_packet_types fi ;; esac fi } && -complete -F _hciconfig hciconfig + complete -F _hciconfig hciconfig _hciattach() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-n -p -t -b -s -l' -- "$cur")) else local args _count_args case $args in 1) - COMPREPLY=( $( printf '%s\n' /dev/tty* ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} - ${COMPREPLY[@]#/dev/}' -- "$cur" ) ) + COMPREPLY=(/dev/tty*) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}" + "${COMPREPLY[@]#/dev/}"' -- "$cur")) ;; 2) - COMPREPLY=( $( compgen -W 'any ericsson digi xircom csr bboxes - swave bcsp 0x0105 0x080a 0x0160 0x0002' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'any ericsson digi xircom csr bboxes + swave bcsp 0x0105 0x080a 0x0160 0x0002' -- "$cur")) ;; 3) - COMPREPLY=( $( compgen -W '9600 19200 38400 57600 115200 230400 - 460800 921600' -- "$cur" ) ) + COMPREPLY=($(compgen -W '9600 19200 38400 57600 115200 230400 + 460800 921600' -- "$cur")) ;; 4) - COMPREPLY=( $( compgen -W 'flow noflow' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'flow noflow' -- "$cur")) ;; 5) _bluetooth_addresses @@ -375,6 +376,6 @@ _hciattach() esac fi } && -complete -F _hciattach hciattach + complete -F _hciattach hciattach # ex: filetype=sh diff --git a/completions/hddtemp b/completions/hddtemp index a7cbfd739e4..7b95f0eecbc 100644 --- a/completions/hddtemp +++ b/completions/hddtemp @@ -6,19 +6,19 @@ _hddtemp() _init_completion -s || return case $prev in - --file|-!(-*)f) + --file | -!(-*)f) _filedir db return ;; - --listen|-!(-*)l) + --listen | -!(-*)l) _ip_addresses return ;; - --unit|-!(-*)u) - COMPREPLY=( $( compgen -W 'C F' -- "$cur" ) ) + --unit | -!(-*)u) + COMPREPLY=($(compgen -W 'C F' -- "$cur")) return ;; - --port|--separator|--syslog|--version|--help|-!(-*)[psSvh?]) + --port | --separator | --syslog | --version | --help | -!(-*)[psSvh?]) return ;; esac @@ -26,13 +26,13 @@ _hddtemp() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) --help' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1") --help' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else cur=${cur:=/dev/} _filedir fi } && -complete -F _hddtemp hddtemp + complete -F _hddtemp hddtemp # ex: filetype=sh diff --git a/completions/hid2hci b/completions/hid2hci index 9221c4d031b..f33a49575e5 100644 --- a/completions/hid2hci +++ b/completions/hid2hci @@ -5,11 +5,11 @@ _hid2hci() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 --tohid' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --quiet -0 --tohci -1 --tohid' \ + -- "$cur")) fi } && -complete -F _hid2hci hid2hci + complete -F _hid2hci hid2hci # ex: filetype=sh diff --git a/completions/hostname b/completions/hostname index 7ca0983cb6d..00dd6a06fe3 100644 --- a/completions/hostname +++ b/completions/hostname @@ -6,18 +6,20 @@ _hostname() _init_completion || return case $prev in - --help|--version|-!(-*)[hV]) + --help | --version | -!(-*)[hV]) return ;; - --file|-!(-*)F) + --file | -!(-*)F) _filedir return ;; esac - [[ $cur == -* ]] && \ - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $cur == -* ]] && + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) } && -complete -F _hostname hostname + complete -F _hostname hostname # ex: filetype=sh diff --git a/completions/hping2 b/completions/hping2 index e0feb2b15cd..666838b1acc 100644 --- a/completions/hping2 +++ b/completions/hping2 @@ -6,30 +6,30 @@ _hping2() _init_completion || return case $prev in - --interface|-!(-*)I) + --interface | -!(-*)I) _available_interfaces return ;; - --spoof|-!(-*)a) + --spoof | -!(-*)a) _known_hosts_real -- "$cur" return ;; - --tos|-!(-*)o) - COMPREPLY=( $( compgen -W '02 04 08 10' ) ) + --tos | -!(-*)o) + COMPREPLY=($(compgen -W '02 04 08 10')) return ;; - --file|-!(-*)E) + --file | -!(-*)E) _filedir return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else _known_hosts_real -- "$cur" fi } && -complete -F _hping2 hping hping2 hping3 + complete -F _hping2 hping hping2 hping3 # ex: filetype=sh diff --git a/completions/htop b/completions/htop index ba82470a751..b4916d5bfec 100644 --- a/completions/htop +++ b/completions/htop @@ -6,15 +6,15 @@ _htop() _init_completion -s || return case "$prev" in - --sort-key|-!(-*)s) - COMPREPLY=( $( compgen -W '$( "$1" -s help )' -- "$cur" ) ) + --sort-key | -!(-*)s) + COMPREPLY=($(compgen -W '$("$1" -s help)' -- "$cur")) return ;; - --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + --user | -!(-*)u) + COMPREPLY=($(compgen -u -- "$cur")) return ;; - --delay|-!(-*)d) + --delay | -!(-*)d) # argument required but no completions available return ;; @@ -22,12 +22,12 @@ _htop() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi } && -complete -F _htop htop + complete -F _htop htop # ex: filetype=sh diff --git a/completions/htpasswd b/completions/htpasswd index bf3acb2256e..527684bf3a0 100644 --- a/completions/htpasswd +++ b/completions/htpasswd @@ -6,28 +6,31 @@ _htpasswd() _init_completion || return local i o=0 # $o is index of first non-option argument - for (( i=1; i <= cword; i++ )); do + for ((i = 1; i <= cword; i++)); do case ${words[i]} in - -*n*) return ;; - -*) ;; - *) o=$i ; break ;; + -*n*) return ;; + -*) ;; + *) + o=$i + break + ;; esac done - if [[ $o -eq 0 || $o -eq $cword ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if ((o == 0 || o == cword)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi # Password file (first non-option argument) _filedir - elif [[ $o -eq $cword-1 ]]; then + elif ((o == cword - 1)); then # Username (second non-option argument) - COMPREPLY=( $( compgen -W \ - '$( cut -d: -f1 "${words[o]}" 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + '$(cut -d: -f1 "${words[o]}" 2>/dev/null)' -- "$cur")) fi } && -complete -F _htpasswd htpasswd + complete -F _htpasswd htpasswd # ex: filetype=sh diff --git a/completions/hunspell b/completions/hunspell index 3507f5dbcf8..4e8759fd621 100644 --- a/completions/hunspell +++ b/completions/hunspell @@ -6,18 +6,21 @@ _hunspell() _init_completion || return case $prev in - --help|--version|-vv|-[hPv]) + --help | --version | -vv | -[hPv]) return ;; -d) - local IFS=$' \t\n' reset=$(shopt -p nullglob); shopt -s nullglob - local -a dicts=( /usr/share/hunspell/*.dic - /usr/local/share/hunspell/*.dic ) - dicts=( "${dicts[@]##*/}" ) - dicts=( "${dicts[@]%.dic}" ) + local IFS=$' \t\n' reset=$(shopt -p nullglob) + shopt -s nullglob + local -a dicts=(/usr/share/hunspell/*.dic + /usr/local/share/hunspell/*.dic) $reset - IFS=$'\n' - COMPREPLY=( $( compgen -W '${dicts[@]}' -- "$cur" ) ) + if ((${#dicts[@]})); then + dicts=("${dicts[@]##*/}") + dicts=("${dicts[@]%.dic}") + IFS=$'\n' + COMPREPLY=($(compgen -W '${dicts[@]}' -- "$cur")) + fi return ;; -i) @@ -31,12 +34,12 @@ _hunspell() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _filedir } && -complete -F _hunspell hunspell + complete -F _hunspell hunspell # ex: filetype=sh diff --git a/completions/iconv b/completions/iconv index 17528899884..81ae01ba672 100644 --- a/completions/iconv +++ b/completions/iconv @@ -2,8 +2,8 @@ _iconv_charsets() { - COMPREPLY+=( $( compgen -W '$( ${1:-iconv} -l | \ - command sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) ) + COMPREPLY+=($(compgen -X ... -W '$(${1:-iconv} -l | \ + command sed -e "s@/*\$@@" -e "s/[,()]//g")' -- "$cur")) } _iconv() @@ -12,15 +12,15 @@ _iconv() _init_completion -s || return case $prev in - --help|--usage|--version|--unicode-subst|--byte-subst|\ - --widechar-subst|-!(-*)[?V]) + --help | --usage | --version | --unicode-subst | --byte-subst | \ + --widechar-subst | -!(-*)[?V]) return ;; - --from-code|--to-code|-!(-*)[ft]) + --from-code | --to-code | -!(-*)[ft]) _iconv_charsets $1 return ;; - --output|-!(-*)o) + --output | -!(-*)o) _filedir return ;; @@ -28,11 +28,11 @@ _iconv() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _iconv -o default iconv + complete -F _iconv -o default iconv # ex: filetype=sh diff --git a/completions/id b/completions/id index 137a5f7eeb2..a07e51dc528 100644 --- a/completions/id +++ b/completions/id @@ -5,14 +5,14 @@ _id() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) + if [[ $cur == -* ]]; then + local opts=$(_parse_help "$1") [[ $opts ]] || opts="-G -g -u" # POSIX fallback - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$opts" -- "$cur")) else - COMPREPLY=( $( compgen -u "$cur" ) ) + COMPREPLY=($(compgen -u "$cur")) fi } && -complete -F _id id + complete -F _id id # ex: filetype=sh diff --git a/completions/idn b/completions/idn index 5ea7f5cb928..8023f8fdc27 100644 --- a/completions/idn +++ b/completions/idn @@ -6,21 +6,21 @@ _idn() _init_completion -s || return case $prev in - --help|--version|-!(-*)[hV]) + --help | --version | -!(-*)[hV]) return ;; - --profile|-!(-*)p) - COMPREPLY=( $( compgen -W 'Nameprep iSCSI Nodeprep Resourceprep - trace SASLprep' -- "$cur" ) ) + --profile | -!(-*)p) + COMPREPLY=($(compgen -W 'Nameprep iSCSI Nodeprep Resourceprep + trace SASLprep' -- "$cur")) return ;; esac if ! $split && [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _idn idn + complete -F _idn idn # ex: filetype=sh diff --git a/completions/ifstat b/completions/ifstat new file mode 100644 index 00000000000..be29cbfc076 --- /dev/null +++ b/completions/ifstat @@ -0,0 +1,69 @@ +# bash completion for ifstat(1) -*- shell-script -*- + +_ifstat() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --help | --version | --scan | --interval | -!(-*)[hvV]) + return + ;; + -!(-*)i) + # TODO comma separated + _available_interfaces -a + return + ;; + -!(-*)d) + # iproute2: no completion (scan delay) + # traditional: parse driver + if ! { + "$1" --help 2>&1 || : + } | + command grep -q -- '-d.*--scan'; then + COMPREPLY=($(compgen -W '$("$1" -v | command \ + sed -e "s/[,.]//g" -ne "s/^.*drivers://p")' -- "$cur")) + fi + return + ;; + --noupdate | -!(-*)s) + # iproute2: pass through (skip history update) + # traditional: hostnames (snmp) + if ! { + "$1" --help 2>&1 || : + } | + command grep -q -- '-s.*--noupdate'; then + _known_hosts_real -- "$cur" + return + fi + ;; + -!(-*)t) + # iproute2: no completion (interval) + # traditional: pass through (add timestamp) + ! { + "$1" --help 2>&1 || : + } | + command grep -q -- '-t.*--interval' || return + ;; + --extended | -!(-*)x) + # iproute2: parse xstat types + COMPREPLY=($(compgen -W '$("$1" -x nonexistent-xstat 2>&1 | + awk "found { print \$1 } /supported xstats:/ { found=1 }")' \ + -- "$cur")) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + return + fi +} && + complete -F _ifstat ifstat + +# ex: filetype=sh diff --git a/completions/iftop b/completions/iftop index 831e327bac1..b73f4b6b811 100644 --- a/completions/iftop +++ b/completions/iftop @@ -6,7 +6,7 @@ _iftop() _init_completion || return case $prev in - -h|-f|-F|-m) + -h | -f | -F | -m) return ;; -i) @@ -19,8 +19,8 @@ _iftop() ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) } && -complete -F _iftop iftop + complete -F _iftop iftop # ex: filetype=sh diff --git a/completions/ifup b/completions/ifup index bcc7a23fbc3..468fdb97f2d 100644 --- a/completions/ifup +++ b/completions/ifup @@ -8,10 +8,10 @@ _ifupdown() _init_completion || return case $prev in - --help|--version|--allow|--exclude|--option|-!(-*)[hVXo]) + --help | --version | --allow | --exclude | --option | -!(-*)[hVXo]) return ;; - --interfaces|-!(-*)i) + --interfaces | -!(-*)i) _filedir return ;; @@ -22,18 +22,19 @@ _ifupdown() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi local args _count_args "" "@(--allow|-i|--interfaces|--state-dir|-X|--exclude|-o)" - if [[ $args -eq 1 ]]; then + if ((args == 1)); then _configured_interfaces - COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) fi } && -complete -F _ifupdown ifup ifdown ifquery ifstatus + complete -F _ifupdown ifup ifdown ifquery ifstatus # ex: filetype=sh diff --git a/completions/influx b/completions/influx new file mode 100644 index 00000000000..e9362e7ef91 --- /dev/null +++ b/completions/influx @@ -0,0 +1,35 @@ +# bash completion for influx(8) -*- shell-script -*- + +_influx() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -version | -port | -database | -password | -username | -execute | -pps) + return + ;; + -host) + _known_hosts_real -- "$cur" + return + ;; + -format | -precision | -consistency) + local args=$($1 --help 2>&1 | awk "\$1 == \"$prev\" { print \$2 }") + COMPREPLY=($( + IFS+="\"'|" + compgen -W "$args" -- "$cur" + )) + return + ;; + -import | -path) + _filedir + return + ;; + esac + + [[ $cur == -* ]] && + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) +} && + complete -F _influx influx + +# ex: filetype=sh diff --git a/completions/info b/completions/info index 7a6d85d8723..7a179e63c30 100644 --- a/completions/info +++ b/completions/info @@ -6,13 +6,13 @@ _info() _init_completion -s || return # default completion if parameter looks like a path - if [[ "$cur" == @(*/|[.~])* ]]; then + if [[ $cur == @(*/|[.~])* ]]; then _filedir return fi case $prev in - --apropos|--index-search|--node|--help|--version|-!(-*)[knhv]) + --apropos | --index-search | --node | --help | --version | -!(-*)[knhv]) return ;; -!(-*)d) @@ -25,7 +25,7 @@ _info() _filedir -d return ;; - --dribble|--file|--output|--restore|--raw-filename|--rcfile|-!(-*)[for]) + --dribble | --file | --output | --restore | --raw-filename | --rcfile | -!(-*)[for]) _filedir return ;; @@ -34,21 +34,19 @@ _info() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local i infopath=/usr/share/info - if [[ $INFOPATH == *: ]]; then + if [[ ${INFOPATH-} == *: ]]; then infopath=${INFOPATH}${infopath} elif [[ ${INFOPATH:+set} ]]; then infopath=$INFOPATH fi - _expand || return - infopath=$infopath: if [[ -n $cur ]]; then infopath="${infopath//://$cur* }" @@ -57,18 +55,19 @@ _info() fi # redirect stderr for when path doesn't exist - COMPREPLY=( $( eval command ls "$infopath" 2>/dev/null ) ) + COMPREPLY=($(eval command ls "$infopath" 2>/dev/null)) # weed out directory path names and paths to info pages - COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) + COMPREPLY=(${COMPREPLY[@]##*/?(:)}) # weed out info dir file - for (( i=0 ; i < ${#COMPREPLY[@]} ; ++i )); do - [[ ${COMPREPLY[$i]} == dir ]] && unset "COMPREPLY[$i]" + for i in ${!COMPREPLY[*]}; do + [[ ${COMPREPLY[i]} == dir ]] && unset -v 'COMPREPLY[i]' done # strip suffix from info pages - COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|xz|lzma)} ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) + COMPREPLY=(${COMPREPLY[@]%.@(gz|bz2|xz|lzma)}) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]%.*}"' -- "${cur//\\\\/}")) } && -complete -F _info info pinfo + complete -F _info info pinfo # ex: filetype=sh diff --git a/completions/inject b/completions/inject index 20ea9b7f15c..fad73a19fc9 100644 --- a/completions/inject +++ b/completions/inject @@ -6,7 +6,7 @@ _inject() _init_completion -s || return case $prev in - -l|--listname) + -l | --listname) _xfunc list_lists _mailman_lists return ;; @@ -14,13 +14,13 @@ _inject() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listname --queue --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--listname --queue --help' -- "$cur")) else _filedir fi } && -complete -F _inject inject + complete -F _inject inject # ex: filetype=sh diff --git a/completions/inotifywait b/completions/inotifywait new file mode 100644 index 00000000000..e5608fc6432 --- /dev/null +++ b/completions/inotifywait @@ -0,0 +1,47 @@ +# bash completion for inotifywait(1) and inotifywatch(1) -*- shell-script -*- + +_inotifywait_events() +{ + # Expecting line with "Events:", followed by ones starting with one + # tab. Word following the tab is event name, others are line + # wrapped explanations. + COMPREPLY+=($(compgen -W "$($1 --help 2>/dev/null | + command sed -e '/^Events:/,/^[^'$'\t'']/!d' \ + -ne 's/^'$'\t''\([^ '$'\t'']\{1,\}\)[ '$'\t''].*/\1/p')" \ + -- "$cur")) +} + +_inotifywait() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help | --exclude | --excludei | --format | --timefmt | --timeout | -!(-*)[ht]) + return + ;; + --fromfile | --outfile | -!(-*)o) + _filedir + return + ;; + --event | -!(-*)e) + _inotifywait_events "$1" + return + ;; + --ascending | --descending) + COMPREPLY=($(compgen -W 'total' -- "$cur")) + _inotifywait_events "$1" + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + return + fi + + _filedir +} && + complete -F _inotifywait inotifywait inotifywatch + +# ex: filetype=sh diff --git a/completions/insmod b/completions/insmod index ec81c93eb23..2f756a99ca8 100644 --- a/completions/insmod +++ b/completions/insmod @@ -6,13 +6,13 @@ _insmod() _init_completion || return # do filename completion for first argument - if [[ $cword -eq 1 ]]; then - _filedir '@(?(k)o?(.gz))' + if ((cword == 1)); then + _filedir '@(?(k)o?(.[gx]z|.zst))' else # do module parameter completion - COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \ - -p ${words[1]} 2>/dev/null | cut -d: -f1 )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(PATH="$PATH:/sbin" modinfo \ + -p ${words[1]} 2>/dev/null | cut -d: -f1)" -- "$cur")) fi } && -complete -F _insmod insmod insmod.static + complete -F _insmod insmod insmod.static # ex: filetype=sh diff --git a/completions/installpkg b/completions/installpkg index f002f7754bd..7455eb10d31 100644 --- a/completions/installpkg +++ b/completions/installpkg @@ -11,7 +11,7 @@ _installpkg() return ;; --priority) - COMPREPLY=( $( compgen -W 'ADD REC OPT SKP' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ADD REC OPT SKP' -- "$cur")) return ;; --tagfile) @@ -20,14 +20,14 @@ _installpkg() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--warn --md5sum --root --infobox --terse - --menu --ask --priority --tagfile' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--warn --md5sum --root --infobox --terse + --menu --ask --priority --tagfile' -- "$cur")) return fi _filedir 't[bglx]z' } && -complete -F _installpkg installpkg + complete -F _installpkg installpkg # ex: filetype=sh diff --git a/completions/interdiff b/completions/interdiff index 5a4906bbdaf..9933d15db54 100644 --- a/completions/interdiff +++ b/completions/interdiff @@ -6,7 +6,7 @@ _interdiff() _init_completion -s || return case $prev in - --unified|--strip-match|--drop-context|-!(-*)[Upd]) + --unified | --strip-match | --drop-context | -!(-*)[Upd]) return ;; esac @@ -14,13 +14,13 @@ _interdiff() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local exts='@(?(d)patch|dif?(f))' word - for word in ${words[@]}; do + for word in "${words[@]}"; do if [[ $word == -@(z|-decompress) ]]; then exts+='?(.@(gz|bz2))' break @@ -28,6 +28,6 @@ _interdiff() done _filedir "$exts" } && -complete -F _interdiff interdiff + complete -F _interdiff interdiff # ex: filetype=sh diff --git a/completions/invoke-rc.d b/completions/invoke-rc.d index 777f6acec28..9d750691698 100644 --- a/completions/invoke-rc.d +++ b/completions/invoke-rc.d @@ -9,30 +9,33 @@ _invoke_rc_d() local sysvdir services options valid_options - [[ -d /etc/rc.d/init.d ]] && sysvdir=/etc/rc.d/init.d \ - || sysvdir=/etc/init.d + [[ -d /etc/rc.d/init.d ]] && sysvdir=/etc/rc.d/init.d || + sysvdir=/etc/init.d - services=( $( printf '%s ' $sysvdir/!(README*|*.sh|$_backup_glob) ) ) - services=( ${services[@]#$sysvdir/} ) - options=( --help --quiet --force --try-anyway --disclose-deny --query \ - --no-fallback ) + services=($sysvdir/!(README*|*.sh|$_backup_glob)) + services=(${services[@]#$sysvdir/}) + options=(--help --quiet --force --try-anyway --disclose-deny --query + --no-fallback) - if [[ ($cword -eq 1) || ("$prev" == --* ) ]]; then - valid_options=( $( \ - tr " " "\n" <<<"${words[@]} ${options[@]}" \ - | command sed -ne "/$( command sed "s/ /\\\\|/g" <<<"${options[@]}" )/p" \ - | sort | uniq -u \ - ) ) - COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- "$cur" ) ) + if [[ $cword -eq 1 || $prev == --* ]]; then + valid_options=($( + tr " " "\n" <<<"${words[*]} ${options[*]}" | + command sed -ne "/$(command sed 's/ /\\|/g' <<<"${options[*]}")/p" | + sort | uniq -u + )) + ((${#valid_options[@]})) && COMPREPLY+=("${valid_options[@]}") + ((${#services[@]})) && COMPREPLY+=("${services[@]}") + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) elif [[ -x $sysvdir/$prev ]]; then - COMPREPLY=( $( compgen -W '`command sed -e "y/|/ /" \ + COMPREPLY=($(compgen -W '`command sed -e "y/|/ /" \ -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ - $sysvdir/$prev`' -- "$cur" ) ) + $sysvdir/$prev`' -- "$cur")) else COMPREPLY=() fi } && -complete -F _invoke_rc_d invoke-rc.d + complete -F _invoke_rc_d invoke-rc.d # ex: filetype=sh diff --git a/completions/ip b/completions/ip index 00dd839da9e..93403bc2f78 100644 --- a/completions/ip +++ b/completions/ip @@ -2,9 +2,9 @@ _iproute2_etc() { - COMPREPLY+=( $( compgen -W \ - "$( awk '!/#/ { print $2 }' /etc/iproute2/$1 2>/dev/null )" \ - -- "$cur" ) ) + COMPREPLY+=($(compgen -W \ + "$(awk '!/#/ { print $2 }' /etc/iproute2/$1 2>/dev/null)" \ + -- "$cur")) } _ip() @@ -13,101 +13,103 @@ _ip() _init_completion || return case $prev in - -V|-Version|-rc|-rcvbuf) + -V | -Version | -rc | -rcvbuf) return ;; - -f|-family) - COMPREPLY=( $( compgen -W 'inet inet6 ipx dnet link' -- "$cur" ) ) + -f | -family) + COMPREPLY=($(compgen -W 'inet inet6 ipx dnet link' -- "$cur")) return ;; - -b|-batch) + -b | -batch) _filedir return ;; -force) - COMPREPLY=( $( compgen -W '-batch' -- "$cur" ) ) + COMPREPLY=($(compgen -W '-batch' -- "$cur")) return ;; esac - local subcword cmd subcmd - for (( subcword=1; subcword < ${#words[@]}-1; subcword++ )); do + local subcword cmd subcmd="" + for ((subcword = 1; subcword < ${#words[@]} - 1; subcword++)); do [[ ${words[subcword]} == -b?(atch) ]] && return - [[ -n $cmd ]] && subcmd=${words[subcword]} && break - [[ ${words[subcword]} != -* && \ - ${words[subcword-1]} != -@(f?(amily)|rc?(vbuf)) ]] && \ + [[ -v cmd ]] && subcmd=${words[subcword]} && break + [[ ${words[subcword]} != -* && + ${words[subcword - 1]} != -@(f?(amily)|rc?(vbuf)) ]] && cmd=${words[subcword]} done - if [[ -z $cmd ]]; then + if [[ ! -v cmd ]]; then case $cur in -*) local c="-Version -statistics -details -resolve -family -oneline -timestamp -batch -rcvbuf" - [[ $cword -eq 1 ]] && c+=" -force" - COMPREPLY=( $( compgen -W "$c" -- "$cur" ) ) - return + ((cword == 1)) && c+=" -force" + COMPREPLY=($(compgen -W "$c" -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W "help $( ip help 2>&1 | command sed -e \ - '/OBJECT := /,/}/!d' -e \ - 's/.*{//' -e \ - 's/}.*//' -e \ - 's/|//g' )" -- "$cur" ) ) - return + COMPREPLY=($(compgen -W "help $( + { + $1 -c=never help || $1 help + } 2>&1 | command sed -e \ + '/OBJECT := /,/}/!d' -e \ + 's/.*{//' -e \ + 's/}.*//' -e \ + 's/|//g' + )" -- "$cur")) ;; esac + return fi [[ $subcmd == help ]] && return case $cmd in - l|link) + l | link) case $subcmd in add) # TODO ;; delete) - case $(($cword-$subcword)) in + case $((cword - subcword)) in 1) _available_interfaces ;; 2) - COMPREPLY=( $( compgen -W 'type' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'type' -- "$cur")) ;; 3) - [[ $prev == type ]] && \ - COMPREPLY=( $( compgen -W 'vlan veth vcan dummy - ifb macvlan can' -- "$cur" ) ) + [[ $prev == type ]] && + COMPREPLY=($(compgen -W 'vlan veth vcan dummy + ifb macvlan can' -- "$cur")) ;; esac ;; set) - if [[ $cword-$subcword -eq 1 ]]; then + if ((cword - subcword == 1)); then _available_interfaces else case $prev in - arp|dynamic|multicast|allmulticast|promisc|\ - trailers) - COMPREPLY=( $( compgen -W 'on off' \ - -- "$cur" ) ) - ;; - txqueuelen|name|address|broadcast|mtu|netns|alias) + arp | dynamic | multicast | allmulticast | promisc | \ + trailers) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) ;; + txqueuelen | name | address | broadcast | mtu | netns | alias) ;; + *) local c="arp dynamic multicast allmulticast promisc trailers txqueuelen name address broadcast mtu netns alias" [[ $prev != @(up|down) ]] && c+=" up down" - COMPREPLY=( $( compgen -W "$c" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$c" -- "$cur")) ;; esac fi ;; show) - if [[ $cword -eq $subcword+1 ]]; then + if ((cword == subcword + 1)); then _available_interfaces - COMPREPLY+=( $( compgen -W 'dev group up' -- "$cur" ) ) + COMPREPLY+=($(compgen -W 'dev group up' -- "$cur")) elif [[ $prev == dev ]]; then _available_interfaces elif [[ $prev == group ]]; then @@ -115,16 +117,16 @@ _ip() fi ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add delete set show' \ - -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help add delete set show' \ + -- "$cur")) ;; esac ;; - a|addr|address) + a | addr | address) case $subcmd in - add|change|replace) + add | change | replace) if [[ $prev == dev ]]; then _available_interfaces elif [[ $prev == scope ]]; then @@ -142,12 +144,12 @@ _ip() : # TODO fi ;; - show|flush) - if [[ $cword -eq $subcword+1 ]]; then + show | flush) + if ((cword == subcword + 1)); then _available_interfaces - COMPREPLY+=( $( compgen -W 'dev scope to label dynamic + COMPREPLY+=($(compgen -W 'dev scope to label dynamic permanent tentative deprecated dadfailed temporary - primary secondary up' -- "$cur" ) ) + primary secondary up' -- "$cur")) elif [[ $prev == dev ]]; then _available_interfaces elif [[ $prev == scope ]]; then @@ -155,16 +157,16 @@ _ip() fi ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add change replace del - show flush' -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help add change replace del + show flush' -- "$cur")) ;; esac ;; addrlabel) case $subcmd in - list|add|del|flush) + list | add | del | flush) if [[ $prev == dev ]]; then _available_interfaces else @@ -172,16 +174,16 @@ _ip() fi ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help list add del flush' \ - -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help list add del flush' \ + -- "$cur")) ;; esac ;; - route) + r | route) case $subcmd in - list|flush) + list | flush) if [[ $prev == proto ]]; then _iproute2_etc rt_protos else @@ -191,44 +193,84 @@ _ip() get) # TODO ;; - add|del|change|append|replace|monitor) - # TODO + a | add | d | del | change | append | r | replace | monitor) + if [[ $prev == via ]]; then + COMPREPLY=($(compgen -W "$( + { + $1 -c=never r 2>/dev/null || $1 r + } | command sed -ne \ + 's/.*via \([0-9.]*\).*/\1/p' + )" -- "$cur")) + elif [[ $prev == "$subcmd" ]]; then + COMPREPLY=($(compgen -W "table default $({ + $1 -c=never r 2>/dev/null || $1 r + } | cut -d ' ' -f 1)" -- "$cur")) + elif [[ $prev == dev ]]; then + _available_interfaces -a + elif [[ $prev == table ]]; then + COMPREPLY=($(compgen -W 'local main default' -- "$cur")) + else + COMPREPLY=($(compgen -W 'via dev weight' -- "$cur")) + fi ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help list flush get add del - change append replace monitor' -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help list flush get add del + change append replace monitor' -- "$cur")) ;; esac ;; rule) case $subcmd in - add|del) - # TODO + add | del | list | lst) + case $prev in + from | to | tos | dsfield | fwmark | uidrange | ipproto | sport | \ + dport | priority | protocol | suppress_prefixlength | \ + suppress_ifgroup | realms | nat | goto) ;; + + iif | oif) + _available_interfaces -a + ;; + table | lookup) + COMPREPLY=($(compgen -W 'local main default' -- "$cur")) + ;; + *) + COMPREPLY=($(compgen -W 'from to tos dsfield fwmark + uidrange ipproto sport dport priority table lookup + protocol suppress_prefixlength suppress_ifgroup realms + nat goto iif oif not' -- "$cur")) + ;; + esac ;; - flush|show|list|lst) + flush | save) + if [[ $prev == protocol ]]; then + : + else + COMPREPLY=($(compgen -W 'protocol' -- "$cur")) + fi ;; + restore | show) ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help list add del flush' \ - -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help add del list flush save + restore show' -- "$cur")) ;; esac ;; neigh) case $subcmd in - add|del|change|replace) + add | del | change | replace) # TODO ;; - show|flush) + show | flush) # TODO ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add del change replace - show flush' -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help add del change replace + show flush' -- "$cur")) ;; esac ;; @@ -242,45 +284,46 @@ _ip() # TODO ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help change show' \ - -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help change show' \ + -- "$cur")) ;; esac ;; tunnel) case $subcmd in - show) - ;; - add|change|del|prl|6rd) + show) ;; + + add | change | del | prl | 6rd) # TODO ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add change del show prl - 6rd' -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help add change del show prl + 6rd' -- "$cur")) ;; esac ;; maddr) case $subcmd in - add|del) + add | del) # TODO ;; show) if [[ $cword -eq $subcword+1 || $prev == dev ]]; then _available_interfaces - [[ $prev != dev ]] && \ - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} dev' \ - -- "$cur" ) ) + if [[ $prev != dev ]]; then + COMPREPLY+=(dev) + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) + fi fi ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add del show' \ - -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help add del show' \ + -- "$cur")) ;; esac ;; @@ -291,8 +334,8 @@ _ip() # TODO ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help show' -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help show' -- "$cur")) ;; esac ;; @@ -301,26 +344,49 @@ _ip() case $subcmd in all) ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help all' -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help all' -- "$cur")) + ;; + esac + ;; + + netns) + case $subcmd in + list | monitor) ;; + + add | identify | list-id) + # TODO + ;; + delete | exec | pids | set) + [[ $prev == "$subcmd" ]] && + COMPREPLY=($(compgen -W "$( + { + $1 -c=never netns list 2>/dev/null || $1 netns list + } | awk '{print $1}' + )" -- "$cur")) + ;; + *) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'help add delete exec + identify list list-id monitor pids set' -- "$cur")) ;; esac ;; xfrm) case $subcmd in - state|policy|monitor) + state | policy | monitor) # TODO ;; *) - [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'state policy monitor' \ - -- "$cur" ) ) + ((cword == subcword)) && + COMPREPLY=($(compgen -W 'state policy monitor' \ + -- "$cur")) ;; esac ;; esac } && -complete -F _ip ip + complete -F _ip ip # ex: filetype=sh diff --git a/completions/ipcalc b/completions/ipcalc new file mode 100644 index 00000000000..5603c26cea0 --- /dev/null +++ b/completions/ipcalc @@ -0,0 +1,25 @@ +# ipcalc(1) completion -*- shell-script -*- + +_ipcalc() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help | --version | --split | -[hs]) + return + ;; + esac + + # --split takes 3 args + local i + for i in {1..3}; do + [[ ${words[cword - i]} == -@(-split|s) ]] && return + done + + [[ $cur != -* ]] || + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) +} && + complete -F _ipcalc ipcalc + +# ex: filetype=sh diff --git a/completions/iperf b/completions/iperf index b66cdb8db56..6347fe00f2b 100644 --- a/completions/iperf +++ b/completions/iperf @@ -6,35 +6,40 @@ _iperf() _init_completion -s -n : || return case $prev in - --help|--version|--interval|--len|--port|--window|--mss|--bandwidth|\ - --num|--time|--listenport|--parallel|--ttl|--linux-congestion|\ - -!(-*)[hvilpwMbntLPTZ]) + --help | --version | --interval | --len | --port | --window | --mss | --bandwidth | \ + --num | --time | --listenport | --parallel | --ttl | --linux-congestion | --omit | \ + --congestion | --bytes | --blockcount | --cport | --set-mss | --flowlabel | \ + --title | --tos | --affinity | -!(-*)[hvilpwMbntLPTZCkOSA]) return ;; - --format|-!(-*)f) - COMPREPLY=( $( compgen -W 'k m g K M G' -- "$cur" ) ) + --format | -!(-*)f) + COMPREPLY=($(compgen -W 'k m g K M G' -- "$cur")) return ;; - --output|--fileinput|-!(-*)[oF]) + --output | --fileinput | -!(-*)[oF]) _filedir return ;; - --bind|-!(-*)B) + --bind | -!(-*)B) _available_interfaces -a _ip_addresses -a __ltrim_colon_completions "$cur" return ;; - --client|-!(-*)c) + --client | -!(-*)c) _known_hosts_real -- "$cur" return ;; - --reportexclude|-!(-*)x) - COMPREPLY=( $( compgen -W 'C D M S V' -- "$cur" ) ) + --reportexclude | -!(-*)x) + COMPREPLY=($(compgen -W 'C D M S V' -- "$cur")) return ;; - --reportstyle|-!(-*)y) - COMPREPLY=( $( compgen -W 'C' -- "$cur" ) ) + --reportstyle | -!(-*)y) + COMPREPLY=($(compgen -W 'C' -- "$cur")) + return + ;; + --logfile) + _filedir log return ;; esac @@ -43,22 +48,22 @@ _iperf() # Filter mode specific options local i filter=cat - for i in ${words[@]}; do + for i in "${words[@]}"; do case $i in - -s|--server) + -s | --server) filter='command sed -e /^Client.specific/,/^\(Server.specific.*\)\?$/d' ;; - -c|--client) + -c | --client) filter='command sed -e /^Server.specific/,/^\(Client.specific.*\)\?$/d' ;; esac done [[ $filter != cat ]] && filter+=' -e /--client/d -e /--server/d' - COMPREPLY=( $( compgen -W \ - '$( "$1" --help 2>&1 | $filter | _parse_help - )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W \ + '$("$1" --help 2>&1 | $filter | _parse_help -)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _iperf iperf iperf3 + complete -F _iperf iperf iperf3 # ex: filetype=sh diff --git a/completions/ipmitool b/completions/ipmitool index 4a9c50249de..920287dd568 100644 --- a/completions/ipmitool +++ b/completions/ipmitool @@ -2,8 +2,8 @@ _ipmitool_singleline_help() { - COMPREPLY=( $( compgen -W "$( $1 $2 2>&1 | \ - command sed -ne 's/[,\r]//g' -e 's/^.*[Cc]ommands://p' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 $2 2>&1 | + command sed -ne 's/[,\r]//g' -e 's/^.*[Cc]ommands://p')" -- "$cur")) } _ipmitool() @@ -16,17 +16,18 @@ _ipmitool() return ;; -*d) - COMPREPLY=( $( compgen -W "$( \ + COMPREPLY=($(compgen -W "$( command ls -d /dev/ipmi* /dev/ipmi/* /dev/ipmidev/* \ - 2>/dev/null | command sed -ne 's/^[^0-9]*\([0-9]\{1,\}\)/\1/p' )" \ - -- "$cur" ) ) + 2>/dev/null | command sed -ne 's/^[^0-9]*\([0-9]\{1,\}\)/\1/p' + )" \ + -- "$cur")) return ;; -*I) - COMPREPLY=( $( compgen -W "$( $1 -h 2>&1 | \ + COMPREPLY=($(compgen -W "$($1 -h 2>&1 | command sed -e '/^Interfaces:/,/^[[:space:]]*$/!d' \ - -ne 's/^[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*/\1/p' )" \ - -- "$cur" ) ) + -ne 's/^[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*/\1/p')" \ + -- "$cur")) return ;; -*H) @@ -38,45 +39,45 @@ _ipmitool() return ;; -*C) - COMPREPLY=( $( compgen -W '{0..14}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..14}' -- "$cur")) return ;; -*L) - COMPREPLY=( $( compgen -W 'CALLBACK USER OPERATOR ADMINISTRATOR' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'CALLBACK USER OPERATOR ADMINISTRATOR' \ + -- "$cur")) return ;; -*A) - COMPREPLY=( $( compgen -W 'NONE PASSWORD MD2 MD5 OEM' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'NONE PASSWORD MD2 MD5 OEM' -- "$cur")) return ;; -*o) - COMPREPLY=( $( compgen -W "$( $1 -o list 2>&1 | \ - awk '/^[ \t]+/ { print $1 }' ) list" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 -o list 2>&1 | + awk '/^[ \t]+/ { print $1 }') list" -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h)' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) return fi # Find out command and subcommand - local cmds=( raw i2c spd lan chassis power event mc sdr sensor fru gendev + local cmds=(raw i2c spd lan chassis power event mc sdr sensor fru gendev sel pef sol tsol isol user channel session sunoem kontronoem picmg fwum firewall shell exec set hpm ekanalyzer) local i c cmd subcmd - for (( i=1; i < ${#words[@]}-1; i++ )); do - [[ -n $cmd ]] && subcmd=${words[i]} && break - for c in ${cmds[@]}; do - [[ ${words[i]} == $c ]] && cmd=$c && break + for ((i = 1; i < ${#words[@]} - 1; i++)); do + [[ -v cmd ]] && subcmd=${words[i]} && break + for c in "${cmds[@]}"; do + [[ ${words[i]} == "$c" ]] && cmd=$c && break done done - if [[ -z $cmd ]]; then - COMPREPLY=( $( compgen -W '${cmds[@]}' -- "$cur" ) ) + if [[ ! -v cmd ]]; then + COMPREPLY=($(compgen -W '${cmds[@]}' -- "$cur")) return fi @@ -84,43 +85,43 @@ _ipmitool() case $cmd in - shell) - ;; + shell) ;; - exec) + \ + exec) _filedir ;; - chassis|power|kontronoem|fwum) + chassis | power | kontronoem | fwum) _ipmitool_singleline_help $1 $cmd ;; lan) case $subcmd in - print|set) - ;; + print | set) ;; + alert) - [[ $prev == alert ]] && \ - COMPREPLY=( $( compgen -W 'print set' -- "$cur" ) ) + [[ $prev == alert ]] && + COMPREPLY=($(compgen -W 'print set' -- "$cur")) ;; stats) - [[ $prev == stats ]] && \ - COMPREPLY=( $( compgen -W 'print set' -- "$cur" ) ) + [[ $prev == stats ]] && + COMPREPLY=($(compgen -W 'print set' -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W 'print set alert stats' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'print set alert stats' \ + -- "$cur")) ;; esac ;; sdr) case $subcmd in - get|info|type|list|entity) - ;; + get | info | type | list | entity) ;; + elist) - COMPREPLY=( $( compgen -W 'all full compact event mclog fru - generic' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'all full compact event mclog fru + generic' -- "$cur")) ;; dump) _filedir @@ -128,8 +129,7 @@ _ipmitool() fill) case $prev in fill) - COMPREPLY=( $( compgen -W 'sensors file' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'sensors file' -- "$cur")) ;; file) _filedir @@ -137,64 +137,63 @@ _ipmitool() esac ;; *) - COMPREPLY=( $( compgen -W 'get info type list elist entity - dump fill' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'get info type list elist entity + dump fill' -- "$cur")) ;; esac ;; sensor) case $subcmd in - list|get|thresh) - ;; + list | get | thresh) ;; + *) - COMPREPLY=( $( compgen -W 'list get thresh' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'list get thresh' -- "$cur")) ;; esac ;; sel) case $subcmd in - info|clear|list|elist|delete) - ;; - add|save|writeraw|readraw) + info | clear | list | elist | delete) ;; + + add | save | writeraw | readraw) _filedir ;; time) - [[ $prev == time ]] && \ - COMPREPLY=( $( compgen -W 'get set' -- "$cur" ) ) + [[ $prev == time ]] && + COMPREPLY=($(compgen -W 'get set' -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W 'info clear list elist delete add - get save writeraw readraw time' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'info clear list elist delete add + get save writeraw readraw time' -- "$cur")) ;; esac ;; user) case $subcmd in - summary|list|disable|enable|priv|test) - ;; + summary | list | disable | enable | priv | test) ;; + set) - [[ $prev == set ]] && \ - COMPREPLY=( $( compgen -W 'name password' -- "$cur" ) ) + [[ $prev == set ]] && + COMPREPLY=($(compgen -W 'name password' -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W 'summary list set disable enable - priv test' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'summary list set disable enable + priv test' -- "$cur")) ;; esac ;; set) - [[ $prev == set ]] && \ - COMPREPLY=( $( compgen -W 'hostname username password privlvl - authtype localaddr targetaddr port csv verbose' \ - -- "$cur" ) ) + [[ $prev == set ]] && + COMPREPLY=($(compgen -W 'hostname username password privlvl + authtype localaddr targetaddr port csv verbose' -- "$cur")) ;; esac } && -complete -F _ipmitool ipmitool + complete -F _ipmitool ipmitool # ex: filetype=sh diff --git a/completions/ipsec b/completions/ipsec index 357d50551b7..49977bb5df0 100644 --- a/completions/ipsec +++ b/completions/ipsec @@ -8,9 +8,10 @@ _ipsec_connections() local keyword name while read -r keyword name; do if [[ $keyword == [#]* ]]; then continue; fi - [[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=( "$name" ) + [[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=("$name") done - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) } _ipsec_freeswan() @@ -18,32 +19,31 @@ _ipsec_freeswan() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual + if ((cword == 1)); then + COMPREPLY=($(compgen -W 'auto barf eroute klipsdebug look manual pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp - tncfg whack' -- "$cur" ) ) + tncfg whack' -- "$cur")) return fi case ${words[1]} in auto) - COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete + COMPREPLY=($(compgen -W '--asynchronous --up --add --delete --replace --down --route --unroute --ready --status - --rereadsecrets' -- "$cur" ) ) + --rereadsecrets' -- "$cur")) ;; manual) - COMPREPLY=( $( compgen -W '--up --down --route --unroute --union' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '--up --down --route --unroute --union' \ + -- "$cur")) ;; ranbits) - COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '--quick --continuous --bytes' -- "$cur")) ;; setup) - COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) ) - ;; - *) + COMPREPLY=($(compgen -W '--start --stop --restart' -- "$cur")) ;; + *) ;; + esac } @@ -52,8 +52,8 @@ _ipsec_strongswan() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'down irdumm leases listaacerts listacerts + if ((cword == 1)); then + COMPREPLY=($(compgen -W 'down irdumm leases listaacerts listacerts listalgs listall listcacerts listcainfos listcards listcerts listcrls listgroups listocsp listocspcerts listpubkeys openac pki pluto pool purgecerts purgecrls purgeike purgeocsp ready reload @@ -61,37 +61,37 @@ _ipsec_strongswan() rereadgroups rereadocspcerts rereadsecrets restart route scdecrypt scencrypt scepclient secrets start starter status statusall stop stroke unroute uci up update version whack --confdir --copyright - --directory --help --version --versioncode' -- "$cur" ) ) + --directory --help --version --versioncode' -- "$cur")) return fi case ${words[1]} in - down|route|status|statusall|unroute|up) - local confdir=$( ipsec --confdir ) - _ipsec_connections < "$confdir/ipsec.conf" + down | route | status | statusall | unroute | up) + local confdir=$(ipsec --confdir) + _ipsec_connections <"$confdir/ipsec.conf" ;; list*) - COMPREPLY=( $( compgen -W '--utc' -- "$cur" ) ) + COMPREPLY=($(compgen -W '--utc' -- "$cur")) ;; - restart|start) - COMPREPLY=( $( compgen -W '--attach-gdb --auto-update --debug - --debug-all --debug-more --nofork' -- "$cur" ) ) + restart | start) + COMPREPLY=($(compgen -W '--attach-gdb --auto-update --debug + --debug-all --debug-more --nofork' -- "$cur")) ;; pki) - COMPREPLY=( $( compgen -W '--gen --issue --keyid --print --pub - --req --self --signcrl --verify' -- "$cur" ) ) - ;; - pool) + COMPREPLY=($(compgen -W '--gen --issue --keyid --print --pub + --req --self --signcrl --verify' -- "$cur")) ;; + pool) ;; + irdumm) _filedir 'rb' ;; - *) - ;; + *) ;; + esac } -case "$( ipsec --version 2>/dev/null )" in +case "$(ipsec --version 2>/dev/null)" in *strongSwan*) complete -F _ipsec_strongswan ipsec ;; diff --git a/completions/iptables b/completions/iptables index 5ef81037bf6..ffb905b8da5 100644 --- a/completions/iptables +++ b/completions/iptables @@ -7,50 +7,45 @@ _iptables() local table chain='s/^Chain \([^ ]\{1,\}\).*$/\1/p' - if [[ ${words[@]} == *-t\ *filter* ]]; then - table="-t filter" - elif [[ ${words[@]} == *-t\ *nat* ]]; then - table="-t nat" - elif [[ ${words[@]} == *-t\ *mangle* ]]; then - table="-t mangle" - fi + [[ ${words[*]} =~ [[:space:]]-(t|-table=?)[[:space:]]*([^[:space:]]+) ]] && + table="-t ${BASH_REMATCH[2]}" case $prev in - -*[AIDRPFXLZ]) - COMPREPLY=( $( compgen -W '`"$1" $table -nL 2>/dev/null | \ - command sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur" ) ) - ;; - -*t) - COMPREPLY=( $( compgen -W 'nat filter mangle' -- "$cur" ) ) - ;; - -j) - if [[ "$table" == "-t filter" || -z "$table" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT + -*[AIDRPFXLZ]) + COMPREPLY=($(compgen -W '`"$1" $table -nL 2>/dev/null | \ + command sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur")) + ;; + -*t) + COMPREPLY=($(compgen -W 'nat filter mangle' -- "$cur")) + ;; + -j) + if [[ $table == "-t filter" || -z $table ]]; then + COMPREPLY=($(compgen -W 'ACCEPT DROP LOG ULOG REJECT `"$1" $table -nL 2>/dev/null | command sed -ne "$chain" \ -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ - "$cur" ) ) - elif [[ $table == "-t nat" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT MIRROR SNAT + "$cur")) + elif [[ $table == "-t nat" ]]; then + COMPREPLY=($(compgen -W 'ACCEPT DROP LOG ULOG REJECT MIRROR SNAT DNAT MASQUERADE `"$1" $table -nL 2>/dev/null | \ command sed -ne "$chain" -e "s/OUTPUT|PREROUTING|POSTROUTING//"`' \ - -- "$cur" ) ) - elif [[ $table == "-t mangle" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT MARK TOS + -- "$cur")) + elif [[ $table == "-t mangle" ]]; then + COMPREPLY=($(compgen -W 'ACCEPT DROP LOG ULOG REJECT MARK TOS `"$1" $table -nL 2>/dev/null | command sed -ne "$chain" \ -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ - "$cur" ) ) - fi - ;; - *) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( "$1" --help 2>&1 | - command sed -e "s/^\[\!\]//" | _parse_help - )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - fi - ;; + "$cur")) + fi + ;; + *) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$("$1" --help 2>&1 | + command sed -e "s/^\[\!\]//" | _parse_help -)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + fi + ;; esac } && -complete -F _iptables iptables + complete -F _iptables iptables # ex: filetype=sh diff --git a/completions/ipv6calc b/completions/ipv6calc index ef8f4372afb..c452c155e12 100644 --- a/completions/ipv6calc +++ b/completions/ipv6calc @@ -6,38 +6,33 @@ _ipv6calc() _init_completion -s || return case "$prev" in - --debug|-!(-*)d) + --debug | -!(-*)d) return ;; - --in|--out|--action|-!(-*)[IOA]) + --in | --out | --action | -!(-*)[IOA]) # With ipv6calc < 0.73.0, -m does nothing here, so use sed instead. - COMPREPLY=( $( compgen -W "$( $1 "$prev" -h 2>&1 | \ - command sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 "$prev" -h 2>&1 | + command sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p')" \ + -- "$cur")) return ;; - --db-geoip|--db-ip2location-ipv4|--db-ip2location-ipv6) + --db-geoip | --db-ip2location-ipv4 | --db-ip2location-ipv6) _filedir return ;; - --printstart|--printend) + --printstart | --printend) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --debug --quiet --in --out --action - --examples --showinfo --show_types --machine_readable --db-geoip - --db-geoip-default --db-ip2location-ipv4 --db-ip2location-ipv6 - --lowercase --uppercase --printprefix --printsuffix --maskprefix - --masksuffix --printstart --printend --printcompressed - --printuncompressed --printfulluncompressed --printmirrored' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$("$1" -h 2>&1 | + command sed -e "s/[][]//g" | _parse_help -)' -- "$cur")) fi } && -complete -F _ipv6calc ipv6calc + complete -F _ipv6calc ipv6calc # ex: filetype=sh diff --git a/completions/iscsiadm b/completions/iscsiadm index fdaebe77888..7786ddcd958 100644 --- a/completions/iscsiadm +++ b/completions/iscsiadm @@ -6,21 +6,21 @@ _iscsiadm() _init_completion -s || return case $prev in - --mode|-!(-*)m) - COMPREPLY=( $( compgen -W 'discovery node session iface fw host' \ - -- "$cur" ) ) + --mode | -!(-*)m) + COMPREPLY=($(compgen -W 'discovery node session iface fw host' \ + -- "$cur")) return ;; - --op|-!(-*)o) - COMPREPLY=( $( compgen -W 'new delete update show' -- "$cur" ) ) + --op | -!(-*)o) + COMPREPLY=($(compgen -W 'new delete update show' -- "$cur")) return ;; - --type|-!(-*)t) - COMPREPLY=( $( compgen -W 'sendtargets st slp isns fw' -- "$cur" ) ) + --type | -!(-*)t) + COMPREPLY=($(compgen -W 'sendtargets st slp isns fw' -- "$cur")) return ;; - --loginall|--logoutall|-!(-*)[LU]) - COMPREPLY=( $( compgen -W 'all manual automatic' -- "$cur" ) ) + --loginall | --logoutall | -!(-*)[LU]) + COMPREPLY=($(compgen -W 'all manual automatic' -- "$cur")) return ;; esac @@ -28,7 +28,7 @@ _iscsiadm() $split && return local options - if [[ $cword -gt 1 ]] ; then + if ((cword > 1)); then case ${words[2]} in discovery) @@ -59,8 +59,8 @@ _iscsiadm() options='--mode' fi - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) } && -complete -F _iscsiadm iscsiadm + complete -F _iscsiadm iscsiadm # ex: filetype=sh diff --git a/completions/isort b/completions/isort index 127e3d106cd..2a84e257587 100644 --- a/completions/isort +++ b/completions/isort @@ -6,36 +6,36 @@ _isort() _init_completion || return case $prev in - --help|--add-import|--builtin|--future|--from-first|-ff|\ - --force-grid-wrap|-fgw|--indent|--lines|--lines-after-imports|-lai|\ - --lines-between-types|-lbt|--line-ending|-le|--no-lines-before|-nlb|\ - --dont-skip|-ns|--thirdparty|--project|--remove-import|--skip|\ - --skip-glob|-sg|--settings-path|-sp|--top|--virtual-env|--line-width|\ - --wrap-length|-wl|-[habfiloprstw]) + --help | --add-import | --builtin | --future | --from-first | -ff | \ + --force-grid-wrap | -fgw | --indent | --lines | --lines-after-imports | -lai | \ + --lines-between-types | -lbt | --line-ending | -le | --no-lines-before | -nlb | \ + --dont-skip | -ns | --thirdparty | --project | --remove-import | --skip | \ + --skip-glob | -sg | --settings-path | -sp | --top | --virtual-env | --line-width | \ + --wrap-length | -wl | -[habfiloprstw]) return ;; - --jobs|-j) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + --jobs | -j) + COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) return ;; - --multi-line|-m) - COMPREPLY=( $( compgen -W '{0..5}' -- "$cur" ) ) + --multi-line | -m) + COMPREPLY=($(compgen -W '{0..5}' -- "$cur")) return ;; - --section-default|-sd) - COMPREPLY=( $( compgen -W 'FUTURE STDLIB THIRDPARTY FIRSTPARTY - LOCALFOLDER' -- "$cur" ) ) + --section-default | -sd) + COMPREPLY=($(compgen -W 'FUTURE STDLIB THIRDPARTY FIRSTPARTY + LOCALFOLDER' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _filedir '@(py|pyi)' } && -complete -F _isort isort + complete -F _isort isort # ex: filetype=sh diff --git a/completions/isql b/completions/isql index 862a9304244..4258c519d86 100644 --- a/completions/isql +++ b/completions/isql @@ -6,9 +6,9 @@ _isql() local cur prev words cword _init_completion || return - [[ -f $ODBCINI ]] \ - && COMPREPLY=( $( command grep "\[$cur" "$ODBCINI" | tr -d \[\] ) ) + [[ -f $ODBCINI ]] && + COMPREPLY=($(command grep "\[$cur" "$ODBCINI" | tr -d \[\])) } && -complete -F _isql isql + complete -F _isql isql # ex: filetype=sh diff --git a/completions/iwconfig b/completions/iwconfig index 114081ddfae..aa8fbf395d6 100644 --- a/completions/iwconfig +++ b/completions/iwconfig @@ -7,84 +7,84 @@ _iwconfig() case $prev in mode) - COMPREPLY=( $( compgen -W 'managed ad-hoc master repeater secondary - monitor' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'managed ad-hoc master repeater secondary + monitor' -- "$cur")) return ;; essid) - COMPREPLY=( $( compgen -W 'on off any' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on off any' -- "$cur")) if [[ -n ${COMP_IWLIST_SCAN:-} ]]; then - COMPREPLY+=( $( compgen -W \ - "$( iwlist ${words[1]} scan | \ - awk -F'\"' '/ESSID/ {print $2}' )" -- "$cur" ) ) + COMPREPLY+=($(compgen -W \ + "$(iwlist ${words[1]} scan | + awk -F'\"' '/ESSID/ {print $2}')" -- "$cur")) fi return ;; nwid) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) return ;; channel) - COMPREPLY=( $( compgen -W "$( iwlist ${words[1]} channel | \ - awk '/^[ \t]*Channel/ {print $2}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(iwlist ${words[1]} channel | + awk '/^[ \t]*Channel/ {print $2}')" -- "$cur")) return ;; freq) - COMPREPLY=( $( compgen -W "$( iwlist ${words[1]} channel | \ - awk '/^[ \t]*Channel/ {print $4"G"}')" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(iwlist ${words[1]} channel | + awk '/^[ \t]*Channel/ {print $4"G"}')" -- "$cur")) return ;; ap) - COMPREPLY=( $( compgen -W 'on off any' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on off any' -- "$cur")) if [[ -n ${COMP_IWLIST_SCAN:-} ]]; then - COMPREPLY+=( $( compgen -W \ - "$( iwlist ${words[1]} scan | \ - awk -F ': ' '/Address/ {print $2}' )" -- "$cur" ) ) + COMPREPLY+=($(compgen -W \ + "$(iwlist ${words[1]} scan | + awk -F ': ' '/Address/ {print $2}')" -- "$cur")) fi return ;; rate) - COMPREPLY=( $( compgen -W 'auto fixed' -- "$cur" ) ) - COMPREPLY+=( $( compgen -W \ - "$( iwlist ${words[1]} rate | \ - awk '/^[ \t]*[0-9]/ {print $1"M"}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W 'auto fixed' -- "$cur")) + COMPREPLY+=($(compgen -W \ + "$(iwlist ${words[1]} rate | + awk '/^[ \t]*[0-9]/ {print $1"M"}')" -- "$cur")) return ;; - rts|frag) - COMPREPLY=( $( compgen -W 'auto fixed off' -- "$cur" ) ) + rts | frag) + COMPREPLY=($(compgen -W 'auto fixed off' -- "$cur")) return ;; - key|enc) - COMPREPLY=( $( compgen -W 'off on open restricted' -- "$cur" ) ) + key | enc) + COMPREPLY=($(compgen -W 'off on open restricted' -- "$cur")) return ;; power) - COMPREPLY=( $( compgen -W 'period timeout off on' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'period timeout off on' -- "$cur")) return ;; txpower) - COMPREPLY=( $( compgen -W 'off on auto' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'off on auto' -- "$cur")) return ;; retry) - COMPREPLY=( $( compgen -W 'limit lifetime' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'limit lifetime' -- "$cur")) return ;; esac - if [[ $cword -eq 1 ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --version' -- "$cur")) else _available_interfaces -w fi else - COMPREPLY=( $( compgen -W 'essid nwid mode freq channel sens mode ap - nick rate rts frag enc key power txpower commit' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'essid nwid mode freq channel sens mode ap + nick rate rts frag enc key power txpower commit' -- "$cur")) fi } && -complete -F _iwconfig iwconfig + complete -F _iwconfig iwconfig # ex: filetype=sh diff --git a/completions/iwlist b/completions/iwlist index b27dbe8bf9a..16aa39c908a 100644 --- a/completions/iwlist +++ b/completions/iwlist @@ -5,18 +5,18 @@ _iwlist() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --version' -- "$cur")) else _available_interfaces -w fi else - COMPREPLY=( $( compgen -W 'scan scanning freq frequency channel rate + COMPREPLY=($(compgen -W 'scan scanning freq frequency channel rate bit bitrate key enc encryption power txpower retry ap accesspoint - peers event' -- "$cur" ) ) + peers event' -- "$cur")) fi } && -complete -F _iwlist iwlist + complete -F _iwlist iwlist # ex: filetype=sh diff --git a/completions/iwpriv b/completions/iwpriv index c7f8209eb24..4e382463d5e 100644 --- a/completions/iwpriv +++ b/completions/iwpriv @@ -7,25 +7,25 @@ _iwpriv() case $prev in roam) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) return ;; port) - COMPREPLY=( $( compgen -W 'ad-hoc managed' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ad-hoc managed' -- "$cur")) return ;; esac - if [[ $cword -eq 1 ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --version' -- "$cur")) else _available_interfaces -w fi else - COMPREPLY=( $( compgen -W '--all roam port' -- "$cur" ) ) + COMPREPLY=($(compgen -W '--all roam port' -- "$cur")) fi } && -complete -F _iwpriv iwpriv + complete -F _iwpriv iwpriv # ex: filetype=sh diff --git a/completions/iwspy b/completions/iwspy index 1cf3a283675..38b7868ed22 100644 --- a/completions/iwspy +++ b/completions/iwspy @@ -5,16 +5,16 @@ _iwspy() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--help --version' -- "$cur")) else _available_interfaces -w fi else - COMPREPLY=( $( compgen -W 'setthr getthr off' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'setthr getthr off' -- "$cur")) fi } && -complete -F _iwspy iwspy + complete -F _iwspy iwspy # ex: filetype=sh diff --git a/completions/jar b/completions/jar index b7de930f8ad..22894917969 100644 --- a/completions/jar +++ b/completions/jar @@ -5,8 +5,8 @@ _jar() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -W 'c t x u' -- "$cur")) return fi @@ -22,6 +22,6 @@ _jar() ;; esac } && -complete -F _jar jar + complete -F _jar jar # ex: filetype=sh diff --git a/completions/jarsigner b/completions/jarsigner index 2441bd1a6ca..ccd5b4f5c96 100644 --- a/completions/jarsigner +++ b/completions/jarsigner @@ -7,51 +7,51 @@ _jarsigner() case $prev in -keystore) - COMPREPLY=( $( compgen -W 'NONE' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'NONE' -- "$cur")) _filedir '@(jks|ks|p12|pfx)' return ;; - -storepass|-keypass|-sigfile|-digestalg|-sigalg|-tsacert|-tsapolicyid|\ - -tsadigestalg|-altsigner|-altsignerpath|-providerName|-providerClass|\ - -providerArg) + -storepass | -keypass | -sigfile | -digestalg | -sigalg | -tsacert | -tsapolicyid | \ + -tsadigestalg | -altsigner | -altsignerpath | -providerName | -providerClass | \ + -providerArg) return ;; - -certchain|-sigfile|-tsa) + -certchain | -tsa) _filedir return ;; -storetype) - COMPREPLY=( $( compgen -W 'JKS PKCS11 PKCS12' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'JKS PKCS11 PKCS12' -- "$cur")) return ;; -signedjar) - _filedir jar + _filedir '@(jar|apk)' return ;; esac # Check if a jar was already given. local i jar=false - for (( i=0; i < ${#words[@]}-1; i++ )) ; do - if [[ "${words[i]}" == *.jar && \ - "${words[i-1]}" != -signedjar ]] ; then + for ((i = 1; i < ${#words[@]} - 1; i++)); do + if [[ ${words[i]} == *.@(jar|apk) && + ${words[i - 1]} != -signedjar ]]; then jar=true break fi done - if ! $jar ; then - if [[ "$cur" == -* ]] ; then + if ! $jar; then + if [[ $cur == -* ]]; then # Documented as "should not be used": -internalsf, -sectionsonly - COMPREPLY=( $( compgen -W '-keystore -storepass -storetype + COMPREPLY=($(compgen -W '-keystore -storepass -storetype -keypass -sigfile -signedjar -digestalg -sigalg -verify -verbose -certs -tsa -tsacert -altsigner -altsignerpath -protected -providerName -providerClass -providerArg' \ - -- "$cur" ) ) + -- "$cur")) fi - _filedir jar + _filedir '@(jar|apk)' fi } && -complete -F _jarsigner jarsigner + complete -F _jarsigner jarsigner # ex: filetype=sh diff --git a/completions/java b/completions/java index e8d81fb454e..d0f70ae6a6c 100644 --- a/completions/java +++ b/completions/java @@ -13,15 +13,15 @@ _java_find_classpath() local i # search first in current options - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == -@(cp|classpath) ]]; then - classpath=${words[i+1]} + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -@(cp|classpath) ]]; then + classpath=${words[i + 1]} break fi done # default to environment - [[ -z $classpath ]] && classpath=$CLASSPATH + [[ ! -v classpath ]] && classpath=${CLASSPATH-} # default to current directory [[ -z $classpath ]] && classpath=. @@ -33,15 +33,15 @@ _java_find_sourcepath() local i # search first in current options - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == -sourcepath ]]; then - sourcepath=${words[i+1]} + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -sourcepath ]]; then + sourcepath=${words[i + 1]} break fi done # default to classpath - if [[ -z $sourcepath ]]; then + if [[ ! -v sourcepath ]]; then local classpath _java_find_classpath sourcepath=$classpath @@ -60,22 +60,27 @@ _java_classes() cur=${cur//.//} # parse each classpath element for classes for i in ${classpath//:/ }; do - if [[ "$i" == *.@(jar|zip) && -r $i ]]; then + if [[ $i == *.@(jar|zip) && -r $i ]]; then if type zipinfo &>/dev/null; then - COMPREPLY+=( $( zipinfo -1 "$i" "$cur*" 2>/dev/null | \ - command grep '^[^$]*\.class$' ) ) - else - COMPREPLY+=( $( jar tf "$i" "$cur" | \ - command grep '^[^$]*\.class$' ) ) + COMPREPLY+=($(zipinfo -1 "$i" "$cur*" 2>/dev/null | + command grep '^[^$]*\.class$')) + elif type unzip &>/dev/null; then + # Last column, between entries consisting entirely of dashes + COMPREPLY+=($(unzip -lq "$i" "$cur*" 2>/dev/null | + awk '$NF ~ /^-+$/ { flag=!flag; next }; + flag && $NF ~ /^[^$]*\.class/ { print $NF }')) + elif type jar &>/dev/null; then + COMPREPLY+=($(jar tf "$i" "$cur" | + command grep '^[^$]*\.class$')) fi elif [[ -d $i ]]; then COMPREPLY+=( - $( compgen -d -- "$i/$cur" | command sed -e "s|^$i/\(.*\)|\1.|" ) - $( compgen -f -X '!*.class' -- "$i/$cur" | \ - command sed -e '/\$/d' -e "s|^$i/||" ) + $(compgen -d -- "$i/$cur" | command sed -e "s|^$i/\(.*\)|\1.|") + $(compgen -f -X '!*.class' -- "$i/$cur" | + command sed -e '/\$/d' -e "s|^$i/||") ) - [[ $COMPREPLY == *.class ]] || compopt -o nospace + [[ ${COMPREPLY-} == *.class ]] || compopt -o nospace # FIXME: if we have foo.class and foo/, the completion # returns "foo/"... how to give precedence to files @@ -83,10 +88,12 @@ _java_classes() fi done - # remove class extension - COMPREPLY=( ${COMPREPLY[@]%.class} ) - # convert path syntax to package syntax - COMPREPLY=( ${COMPREPLY[@]//\//.} ) + if ((${#COMPREPLY[@]} != 0)); then + # remove class extension + COMPREPLY=(${COMPREPLY[@]%.class}) + # convert path syntax to package syntax + COMPREPLY=(${COMPREPLY[@]//\//.}) + fi } # available packages completion @@ -102,16 +109,18 @@ _java_packages() # parse each sourcepath element for packages for i in ${sourcepath//:/ }; do if [[ -d $i ]]; then - COMPREPLY+=( $( command ls -F -d $i/$cur* 2>/dev/null | \ - command sed -e 's|^'$i'/||' ) ) + COMPREPLY+=($(command ls -F -d $i/$cur* 2>/dev/null | + command sed -e 's|^'$i'/||')) fi done - # keep only packages - COMPREPLY=( $( tr " " "\n" <<<"${COMPREPLY[@]}" | command grep "/$" ) ) - # remove packages extension - COMPREPLY=( ${COMPREPLY[@]%/} ) - # convert path syntax to package syntax - cur=${COMPREPLY[@]//\//.} + if ((${#COMPREPLY[@]} != 0)); then + # keep only packages + COMPREPLY=($(tr " " "\n" <<<"${COMPREPLY[@]}" | command grep "/$")) + # remove packages extension + COMPREPLY=(${COMPREPLY[@]%/}) + # convert path syntax to package syntax + cur="${COMPREPLY[*]//\//.}" + fi } # java completion @@ -123,9 +132,9 @@ _java() local i - for ((i=1; i < $cword; i++)); do - case ${words[$i]} in - -cp|-classpath) + for ((i = 1; i < cword; i++)); do + case ${words[i]} in + -cp | -classpath) ((i++)) # skip the classpath string. ;; -*) @@ -142,7 +151,7 @@ _java() case $cur in # standard option completions -verbose:*) - COMPREPLY=( $( compgen -W 'class gc jni' -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W 'class gc jni' -- "${cur#*:}")) return ;; -javaagent:*) @@ -166,56 +175,56 @@ _java() return ;; -Xcheck:*) - COMPREPLY=( $( compgen -W 'jni' -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W 'jni' -- "${cur#*:}")) return ;; -Xgc:*) - COMPREPLY=( $( compgen -W 'singlecon gencon singlepar genpar' \ - -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W 'singlecon gencon singlepar genpar' \ + -- "${cur#*:}")) return ;; -Xgcprio:*) - COMPREPLY=( $( compgen -W 'throughput pausetime deterministic' \ - -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W 'throughput pausetime deterministic' \ + -- "${cur#*:}")) return ;; - -Xloggc:*|-Xverboselog:*) + -Xloggc:* | -Xverboselog:*) cur=${cur#*:} _filedir return ;; -Xshare:*) - COMPREPLY=( $( compgen -W 'auto off on' -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W 'auto off on' -- "${cur#*:}")) return ;; -Xverbose:*) - COMPREPLY=( $( compgen -W 'memory load jni cpuinfo codegen opt - gcpause gcreport' -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W 'memory load jni cpuinfo codegen opt + gcpause gcreport' -- "${cur#*:}")) return ;; -Xverify:*) - COMPREPLY=( $( compgen -W 'all none remote' -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -W 'all none remote' -- "${cur#*:}")) return ;; # the rest that we have no completions for - -D*|-*:*) + -D* | -*:*) return ;; esac case $prev in - -cp|-classpath) + -cp | -classpath) _java_path return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - [[ $cur == -X* ]] && \ - COMPREPLY+=( $( compgen -W '$( _parse_help "$1" -X )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + [[ $cur == -X* ]] && + COMPREPLY+=($(compgen -W '$(_parse_help "$1" -X)' -- "$cur")) else - if [[ "$prev" == -jar ]]; then + if [[ $prev == -jar ]]; then # jar file completion _filedir '[jw]ar' else @@ -224,11 +233,11 @@ _java() fi fi - [[ $COMPREPLY == -*[:=] ]] && compopt -o nospace + [[ ${COMPREPLY-} == -*[:=] ]] && compopt -o nospace __ltrim_colon_completions "$cur" } && -complete -F _java java + complete -F _java java _javadoc() { @@ -236,42 +245,38 @@ _javadoc() _init_completion || return case $prev in - -overview|-helpfile) + -overview | -helpfile) _filedir '?(x)htm?(l)' return ;; - -doclet|-exclude|-subpackages|-source|-locale|-encoding|-windowtitle|\ - -doctitle|-header|-footer|-top|-bottom|-group|-noqualifier|-tag|\ - -charset|-sourcetab|-docencoding) + -doclet | -exclude | -subpackages | -source | -locale | -encoding | -windowtitle | \ + -doctitle | -header | -footer | -top | -bottom | -group | -noqualifier | -tag | \ + -charset | -sourcetab | -docencoding) return ;; -stylesheetfile) _filedir css return ;; - -d|-link|-linkoffline) + -d | -link | -linkoffline) _filedir -d return ;; - -classpath|-cp|-bootclasspath|-docletpath|-sourcepath|-extdirs|\ - -excludedocfilessubdir) + -classpath | -cp | -bootclasspath | -docletpath | -sourcepath | -extdirs | \ + -excludedocfilessubdir) _java_path return ;; - -helpfile) - _filedir - return - ;; esac # -linkoffline takes two arguments - if [[ $cword -gt 2 && ${words[$cword-2]} == -linkoffline ]]; then + if [[ $cword -gt 2 && ${words[cword - 2]} == -linkoffline ]]; then _filedir -d return fi - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) else # source files completion _filedir java @@ -279,7 +284,7 @@ _javadoc() _java_packages fi } && -complete -F _javadoc javadoc + complete -F _javadoc javadoc _javac() { @@ -291,38 +296,38 @@ _javac() _filedir -d return ;; - -cp|-classpath|-bootclasspath|-sourcepath|-extdirs) + -cp | -classpath | -bootclasspath | -sourcepath | -extdirs) _java_path return ;; esac - if [[ $cur == -+([a-zA-z0-9-_]):* ]]; then + if [[ $cur == -+([a-zA-Z0-9-_]):* ]]; then # Parse required options from -foo:{bar,quux,baz} local helpopt=-help [[ $cur == -X* ]] && helpopt=-X # For some reason there may be -g:none AND -g:{lines,source,vars}; # convert the none case to the curly brace format so it parses like # the others. - local opts=$( "$1" $helpopt 2>&1 | command sed -e 's/-g:none/-g:{none}/' -ne \ - "s/^[[:space:]]*${cur%%:*}:{\([^}]\{1,\}\)}.*/\1/p" ) - COMPREPLY=( $( compgen -W "${opts//,/ }" -- "${cur#*:}" ) ) + local opts=$("$1" $helpopt 2>&1 | command sed -e 's/-g:none/-g:{none}/' -ne \ + "s/^[[:space:]]*${cur%%:*}:{\([^}]\{1,\}\)}.*/\1/p") + COMPREPLY=($(compgen -W "${opts//,/ }" -- "${cur#*:}")) return fi - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - [[ $cur == -X* ]] && \ - COMPREPLY+=( $( compgen -W '$( _parse_help "$1" -X )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + [[ $cur == -X* ]] && + COMPREPLY+=($(compgen -W '$(_parse_help "$1" -X)' -- "$cur")) else # source files completion _filedir java fi - [[ $COMPREPLY == -*[:=] ]] && compopt -o nospace + [[ ${COMPREPLY-} == -*[:=] ]] && compopt -o nospace __ltrim_colon_completions "$cur" } && -complete -F _javac javac + complete -F _javac javac # ex: filetype=sh diff --git a/completions/javaws b/completions/javaws index 7d6e22c8835..f42a1e55ef4 100644 --- a/completions/javaws +++ b/completions/javaws @@ -6,14 +6,14 @@ _javaws() _init_completion -n = || return case $prev in - -help|-license|-about|-viewer|-arg|-param|-property|-update|-umask) + -help | -license | -about | -viewer | -arg | -param | -property | -update | -umask) return ;; - -basedir|-codebase) + -basedir | -codebase) _filedir -d return ;; - -uninstall|-import) + -uninstall | -import) _filedir jnlp return ;; @@ -22,13 +22,13 @@ _javaws() if [[ $cur == *= ]]; then return elif [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" -help ) " -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W "$(_parse_help "$1" -help) " -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir jnlp } && -complete -F _javaws javaws + complete -F _javaws javaws # ex: filetype=sh diff --git a/completions/jpegoptim b/completions/jpegoptim index 748a47e4c71..c36697217f4 100644 --- a/completions/jpegoptim +++ b/completions/jpegoptim @@ -6,19 +6,19 @@ _jpegoptim() _init_completion -s || return case $prev in - --help|--version|-!(-*)[hV]*) + --help | --version | -!(-*)[hV]*) return ;; - --dest|-!(-*)d) + --dest | -!(-*)d) _filedir -d return ;; - --max|--threshold|-!(-*)[mT]) - COMPREPLY=( $( compgen -W '{0..100}' -- "$cur" ) ) + --max | --threshold | -!(-*)[mT]) + COMPREPLY=($(compgen -W '{0..100}' -- "$cur")) return ;; - --size|-!(-*)S) - COMPREPLY=( $( compgen -W '{1..99}%' -- "$cur" ) ) + --size | -!(-*)S) + COMPREPLY=($(compgen -W '{1..99}%' -- "$cur")) return ;; esac @@ -26,13 +26,13 @@ _jpegoptim() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir 'jp?(e)g' } && -complete -F _jpegoptim jpegoptim + complete -F _jpegoptim jpegoptim # ex: filetype=sh diff --git a/completions/jps b/completions/jps index e46c9f1667e..a451eec1bf7 100644 --- a/completions/jps +++ b/completions/jps @@ -6,7 +6,7 @@ _jps() _init_completion || return case $prev in - -J*|-help) + -J* | -help) return ;; esac @@ -14,12 +14,12 @@ _jps() if [[ $cur == -* ]]; then # Not using _parse_usage because output has [-help] which does not # mean -h, -e, -l, -p... - COMPREPLY=( $( compgen -W "-q -m -l -v -V -J -help" -- "$cur" ) ) - [[ $COMPREPLY == -J* ]] && compopt -o nospace + COMPREPLY=($(compgen -W "-q -m -l -v -V -J -help" -- "$cur")) + [[ ${COMPREPLY-} == -J* ]] && compopt -o nospace else _known_hosts_real -- "$cur" fi } && -complete -F _jps jps + complete -F _jps jps # ex: filetype=sh diff --git a/completions/jq b/completions/jq index 6857089da3e..3ffbeb28e6e 100644 --- a/completions/jq +++ b/completions/jq @@ -6,14 +6,14 @@ _jq() _init_completion || return case $prev in - --help|--version|--arg|--argjson|--slurpfile|--argfile) + --help | --version | --arg | --argjson | --slurpfile | --argfile) return ;; --indent) - COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..8}' -- "$cur")) return ;; - --from-file|--run-tests|-!(-*)f) + --from-file | --run-tests | -!(-*)f) _filedir return ;; @@ -23,32 +23,56 @@ _jq() ;; esac - (( cword > 2 )) && \ - case ${words[cword-2]} in - --arg|--argjson) - return - ;; - --slurpfile|--argfile) - _filedir json - return - ;; - esac + ((cword > 2)) && + case ${words[cword - 2]} in + --arg | --argjson) + return + ;; + --slurpfile | --argfile) + _filedir json + return + ;; + esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + # Get jq's --help output and see whether it mentions --help + # jq's --help only shows some of its command-line options; some are not + # even listed in the man page! + local help_output=$("$1" --help 2>/dev/null) + + if [[ $help_output == *--help* ]]; then + # If the output of --help seems complete, use it + COMPREPLY=($(compgen -W \ + '$(printf "%s" "$help_output" | _parse_help -)' -- "$cur")) + else + # Otherwise, use a hard-coded list of known flags, some of which do + # not appear in the output of --help as of jq 1.6. + COMPREPLY=($(compgen -W '--version --seq --stream --slurp + --raw-input --null-input --compact-output --tab --indent + --color-output -monochrome-output --ascii-output --unbuffered + --sort-keys --raw-output --join-output --from-file --exit-status + --arg --argjson --slurpfile --rawfile --argfile --args + --jsonargs --run-tests --help' -- "$cur")) + fi return fi + local word + for word in "${words[@]}"; do + [[ $word != --?(json)args ]] || return + done + local args # TODO: DTRT with args taking 2 options - _count_args "" "@(--arg|--arg?(json|file)|--?(slurp|from-)file|--indent|--run-tests|-!(-*)[fL])" + # -f|--from-file are not counted here because they supply the filter + _count_args "" "@(--arg|--arg?(json|file)|--slurpfile|--indent|--run-tests|-!(-*)L)" # 1st arg is filter - [[ $args -eq 1 ]] && return + ((args == 1)) && return # 2... are input files _filedir json } && -complete -F _jq jq + complete -F _jq jq # ex: filetype=sh diff --git a/completions/jshint b/completions/jshint index ea9bbeb5ec5..3622cecfd87 100644 --- a/completions/jshint +++ b/completions/jshint @@ -6,19 +6,19 @@ _jshint() _init_completion -s || return case $prev in - -v|--version|-h|--help|--exclude|--filename|-e|--extra-ext) + -v | --version | -h | --help | --exclude | --filename | -e | --extra-ext) return ;; - -c|--config) + -c | --config) _filedir return ;; --reporter) - COMPREPLY=( $( compgen -W "jslint checkstyle unix" -- "$cur" ) ) + COMPREPLY=($(compgen -W "jslint checkstyle unix" -- "$cur")) return ;; --extract) - COMPREPLY=( $( compgen -W "auto always never" -- "$cur" ) ) + COMPREPLY=($(compgen -W "auto always never" -- "$cur")) return ;; esac @@ -26,13 +26,13 @@ _jshint() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir js } && -complete -F _jshint jshint + complete -F _jshint jshint # ex: filetype=sh diff --git a/completions/json_xs b/completions/json_xs index 187eaf040a7..c93ba864832 100644 --- a/completions/json_xs +++ b/completions/json_xs @@ -7,15 +7,15 @@ _json_xs() case $prev in -*f) - COMPREPLY=( $( compgen -W 'json cbor storable storable-file bencode - clzf eval yaml string none' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'json cbor storable storable-file bencode + clzf eval yaml string none' -- "$cur")) return ;; -*t) - COMPREPLY=( $( compgen -W 'json json-utf-8 json-pretty + COMPREPLY=($(compgen -W 'json json-utf-8 json-pretty json-utf-16le json-utf-16be json-utf-32le json-utf-32be cbor storable storable-file bencode clzf yaml dump dumper - string none' -- "$cur" ) ) + string none' -- "$cur")) return ;; -*e) @@ -24,8 +24,8 @@ _json_xs() esac [[ $cur == -* ]] && - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -f' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1") -f' -- "$cur")) } && -complete -F _json_xs json_xs + complete -F _json_xs json_xs # ex: filetype=sh diff --git a/completions/jsonschema b/completions/jsonschema new file mode 100644 index 00000000000..8a36ed364e4 --- /dev/null +++ b/completions/jsonschema @@ -0,0 +1,30 @@ +# bash completion for jsonschema -*- shell-script -*- + +_jsonschema() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help | --error-format | --validator | -[hFV]) + return + ;; + --instance | -i) + _filedir json + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + return + fi + + local args + _count_args "" "-*" + ((args == 1)) || return + _filedir '@(json|schema)' +} && + complete -F _jsonschema jsonschema + +# ex: filetype=sh diff --git a/completions/k3b b/completions/k3b index 2cbcbb1bcb3..87d26cdc9cc 100644 --- a/completions/k3b +++ b/completions/k3b @@ -6,23 +6,23 @@ _k3b() _init_completion || return case $prev in - --help*|--author|-v|--version|--license|--lang) + --help* | --author | -v | --version | --license | --lang) return ;; - --datacd|--audiocd|--videocd|--mixedcd|--emovixcd|--videodvd) + --datacd | --audiocd | --videocd | --mixedcd | --emovixcd | --videodvd) _filedir return ;; - --copydvd|--formatdvd|--videodvdrip) + --copydvd | --formatdvd | --videodvdrip) _dvd_devices return ;; - --copycd|--erasecd|--cddarip|--videocdrip) + --copycd | --erasecd | --cddarip | --videocdrip) _cd_devices _dvd_devices return ;; - --cdimage|--image) + --cdimage | --image) _filedir '@(cue|iso|toc)' return ;; @@ -31,18 +31,18 @@ _k3b() return ;; --ao) - COMPREPLY=( $( compgen -W 'alsa arts' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'alsa arts' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W "$(_parse_help "$1")" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _filedir fi } && -complete -F _k3b k3b + complete -F _k3b k3b # ex: filetype=sh diff --git a/completions/kcov b/completions/kcov index 5d067778158..672967afa02 100644 --- a/completions/kcov +++ b/completions/kcov @@ -6,21 +6,21 @@ _kcov() _init_completion -s -n : || return case "$prev" in - --pid|-p) + --pid | -p) _pids return ;; - --sort-type|-s) - COMPREPLY=( $( compgen -W 'filename percent reverse lines - uncovered' -- "$cur" ) ) + --sort-type | -s) + COMPREPLY=($(compgen -W 'filename percent reverse lines + uncovered' -- "$cur")) return ;; - --include-path|--exclude-path) + --include-path | --exclude-path) _filedir return ;; --replace-src-path) - if [[ "$cur" == ?*:* ]]; then + if [[ $cur == ?*:* ]]; then cur="${cur##*:}" _filedir else @@ -29,21 +29,21 @@ _kcov() fi return ;; - --limits|-l) - if [[ "$cur" == ?*,* ]]; then + --limits | -l) + if [[ $cur == ?*,* ]]; then prev="${cur%,*}" cur="${cur##*,}" - COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) ) - [[ ${#COMPREPLY[@]} -eq 1 ]] && \ - COMPREPLY=( ${COMPREPLY/#/$prev,} ) + COMPREPLY=($(compgen -W "{0..100}" -- "$cur")) + ((${#COMPREPLY[@]} == 1)) && + COMPREPLY=(${COMPREPLY/#/$prev,}) else - COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) ) - [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/%/,} ) + COMPREPLY=($(compgen -W "{0..100}" -- "$cur")) + ((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/%/,}) compopt -o nospace fi return ;; - --title|-t|--include-pattern|--exclude-pattern|--path-strip-level) + --title | -t | --include-pattern | --exclude-pattern | --path-strip-level) # argument required but no completions available return ;; @@ -51,14 +51,14 @@ _kcov() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _kcov kcov + complete -F _kcov kcov # ex: filetype=sh diff --git a/completions/kill b/completions/kill index ac179cd996a..1853861edce 100644 --- a/completions/kill +++ b/completions/kill @@ -15,15 +15,16 @@ _kill() ;; esac - if [[ $cword -eq 1 && "$cur" == -* ]]; then + if [[ $cword -eq 1 && $cur == -* ]]; then # return list of available signals _signals - - COMPREPLY+=( $( compgen -W "-s -l" -- "$cur" ) ) + COMPREPLY+=($(compgen -W "-s -l" -- "$cur")) else - # return list of available PIDs + # return list of available PIDs and jobs _pids + COMPREPLY+=($(compgen -j -P % -- "${cur#%}")) fi } && -complete -F _kill kill + complete -F _kill kill # ex: filetype=sh diff --git a/completions/killall b/completions/killall index fc7929b7405..c7c0b0fc371 100644 --- a/completions/killall +++ b/completions/killall @@ -8,14 +8,14 @@ _killall() _init_completion -s || return case $prev in - --context|--older-than|--younger-than|--version|-!(-*)@([Zoy]|V*)) + --context | --older-than | --younger-than | --version | -!(-*)@([Zoy]|V*)) return ;; - --signal|-!(-*)s) + --signal | -!(-*)s) _signals return ;; - --user|-!(-*)u) + --user | -!(-*)u) _allowed_users return ;; @@ -24,13 +24,13 @@ _killall() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $cword -eq 1 ]] && _signals - + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + ((cword == 1)) && _signals - return fi _pnames } && -complete -F _killall killall + complete -F _killall killall # ex: filetype=sh diff --git a/completions/kldload b/completions/kldload index 0442e95e800..f5111584c0b 100644 --- a/completions/kldload +++ b/completions/kldload @@ -11,11 +11,11 @@ _kldload() [[ -d $moddir ]] || moddir=/boot/kernel/ compopt -o filenames - COMPREPLY=( $( compgen -f "$moddir$cur" ) ) - COMPREPLY=( ${COMPREPLY[@]#$moddir} ) - COMPREPLY=( ${COMPREPLY[@]%.ko} ) + COMPREPLY=($(compgen -f "$moddir$cur")) + COMPREPLY=(${COMPREPLY[@]#$moddir}) + COMPREPLY=(${COMPREPLY[@]%.ko}) } && -complete -F _kldload kldload + complete -F _kldload kldload # ex: filetype=sh diff --git a/completions/kldunload b/completions/kldunload index 52634c1e102..2e12282c844 100644 --- a/completions/kldunload +++ b/completions/kldunload @@ -7,9 +7,9 @@ _kldunload() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W '$(kldstat)' -X 'kernel' -X '!*.ko' -- "$cur" ) ) - COMPREPLY=( ${COMPREPLY[@]%.ko} ) + COMPREPLY=($(compgen -W '$(kldstat)' -X 'kernel' -X '!*.ko' -- "$cur")) + COMPREPLY=(${COMPREPLY[@]%.ko}) } && -complete -F _kldunload kldunload + complete -F _kldunload kldunload # ex: filetype=sh diff --git a/completions/koji b/completions/koji index 2e75ed709ee..8efef9a7fae 100644 --- a/completions/koji +++ b/completions/koji @@ -2,8 +2,8 @@ _koji_search() { - COMPREPLY+=( $( compgen -W \ - '$( "$1" -q search $2 "$cur*" 2>/dev/null )' -- "$cur" ) ) + COMPREPLY+=($(compgen -W \ + '$("$1" -q search $2 "$cur*" 2>/dev/null)' -- "$cur")) } _koji_build() @@ -23,14 +23,13 @@ _koji_user() _koji_tag() { - COMPREPLY+=( $( compgen -W '$( "$1" -q list-tags 2>/dev/null )' \ - -- "$cur" ) ) + COMPREPLY+=($(compgen -W '$("$1" -q list-tags 2>/dev/null)' -- "$cur")) } _koji_target() { - COMPREPLY+=( $( compgen -W '$( "$1" -q list-targets 2>/dev/null | - awk "{ print \$1 }" )' -- "$cur" ) ) + COMPREPLY+=($(compgen -W '$("$1" -q list-targets 2>/dev/null | + awk "{ print \$1 }")' -- "$cur")) } _koji() @@ -39,7 +38,7 @@ _koji() _init_completion -s || return local commandix command - for (( commandix=1; commandix < cword; commandix++ )); do + for ((commandix = 1; commandix < cword; commandix++)); do if [[ ${words[commandix]} != -* ]]; then command=${words[commandix]} break @@ -47,20 +46,19 @@ _koji() done case $prev in - --help|--help-commands|-!(-*)h*) + --help | --help-commands | -!(-*)h*) return ;; - --config|--keytab|-!(-*)[co]) + --config | --keytab | -!(-*)[co]) _filedir return ;; - --runas|--user|--editor|--by) + --runas | --user | --editor | --by) _koji_user "$1" return ;; --authtype) - COMPREPLY=( $( compgen -W 'noauth ssl password kerberos' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'noauth ssl password kerberos' -- "$cur")) return ;; --topdir) @@ -68,15 +66,15 @@ _koji() return ;; --type) - case $command in - latest-pkg|list-tagged) - COMPREPLY=( $( compgen -W 'maven' -- "$cur" ) ) + case ${command-} in + latest-pkg | list-tagged) + COMPREPLY=($(compgen -W 'maven' -- "$cur")) ;; esac return ;; --name) - case $command in + case ${command-} in list-targets) _koji_target "$1" ;; @@ -87,7 +85,7 @@ _koji() _koji_user "$1" return ;; - --tag|--latestfrom) + --tag | --latestfrom) _koji_tag "$1" return ;; @@ -107,22 +105,22 @@ _koji() $split && return - if [[ $command ]]; then + if [[ -v command ]]; then if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( _parse_help "$1" "$command --help" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W \ + '$(_parse_help "$1" "$command --help")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi # How many'th non-option arg (1-based) for $command are we completing? local i nth=1 - for (( i=commandix+1; i < cword; i++ )); do - [[ ${words[i]} == -* ]] || (( nth++ )) + for ((i = commandix + 1; i < cword; i++)); do + [[ ${words[i]} == -* ]] || ((nth++)) done case $command in - build|maven-build|win-build) + build | maven-build | win-build) case $nth in 1) _koji_target "$1" @@ -162,7 +160,7 @@ _koji() latest-by-tag) _koji_package "$1" ;; - latest-pkg|list-groups|list-tag-inheritance|show-groups) + latest-pkg | list-groups | list-tag-inheritance | show-groups) case $nth in 1) _koji_tag "$1" @@ -188,7 +186,7 @@ _koji() ;; move-pkg) case $nth in - 1|2) + 1 | 2) _koji_tag "$1" ;; *) @@ -199,12 +197,12 @@ _koji() search) case $nth in 1) - COMPREPLY=( $( compgen -W 'package build tag target - user host rpm' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'package build tag target + user host rpm' -- "$cur")) ;; esac ;; - tag-pkg|untag-pkg) + tag-pkg | untag-pkg) case $nth in 1) _koji_tag "$1" @@ -220,7 +218,7 @@ _koji() wait-repo) case $nth in 1) - for (( i=commandix+1; i < cword; i++ )); do + for ((i = commandix + 1; i < cword; i++)); do if [[ ${words[i]} == --target ]]; then _koji_target "$1" return @@ -235,13 +233,13 @@ _koji() fi if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - elif [[ ! $command ]]; then - COMPREPLY=( $( compgen -W '$( "$1" --help-commands 2>/dev/null | \ - awk "/^( +|\t)/ { print \$1 }" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + elif [[ ! -v command ]]; then + COMPREPLY=($(compgen -W '$("$1" --help-commands 2>/dev/null | \ + awk "/^( +|\t)/ { print \$1 }")' -- "$cur")) fi } && -complete -F _koji koji arm-koji ppc-koji s390-koji sparc-koji + complete -F _koji koji arm-koji ppc-koji s390-koji sparc-koji # ex: filetype=sh diff --git a/completions/ktutil b/completions/ktutil index 2baa1c6cb81..6030a474fec 100644 --- a/completions/ktutil +++ b/completions/ktutil @@ -2,21 +2,21 @@ _heimdal_principals() { - COMPREPLY=( $( compgen -W "$( kadmin -l dump 2>/dev/null | \ - awk '{print $1}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(kadmin -l dump 2>/dev/null | + awk '{print $1}')" -- "$cur")) } _heimdal_realms() { - COMPREPLY=( $( compgen -W "( kadmin -l dump 2>/dev/null | \ - awk '{print $1}' | awk -F@ '{print $2}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(kadmin -l dump 2>/dev/null | + awk '{print $1}' | awk -F@ '{print $2}')" -- "$cur")) } _heimdal_encodings() { - COMPREPLY=( $( compgen -W 'des-cbc-mcrc des-cbc-md4 des-cbc-md5 + COMPREPLY=($(compgen -W 'des-cbc-mcrc des-cbc-md4 des-cbc-md5 des3-cbc-sha1 arcfour-hmac-md5 aes128-cts-hmac-sha1-96 - aes256-cts-hmac-sha1-96' -- "$cur" ) ) + aes256-cts-hmac-sha1-96' -- "$cur")) } _ktutil() @@ -27,23 +27,23 @@ _ktutil() local command commands i options case $prev in - -p|--principal) + -p | --principal) _heimdal_principals return ;; - -e|--enctype) + -e | --enctype) _heimdal_encodings return ;; - -a|--admin-server) + -a | --admin-server) _known_hosts_real -- "$cur" return ;; - -r|--realm) + -r | --realm) _heimdal_realms return ;; - -s|-k|--srvtab|--keytab) + -s | -k | --srvtab | --keytab) _filedir return ;; @@ -54,13 +54,13 @@ _ktutil() commands='add change copy get list remove rename purge srvconvert srv2keytab srvcreate key2srvtab' - for (( i=1; i < cword; i++ )); do + for ((i = 1; i < cword; i++)); do case ${words[i]} in - -k|--keytab) - i=$(($i+1)) - ;; - -*) + -k | --keytab) + ((i++)) ;; + -*) ;; + *) command=${words[i]} break @@ -68,15 +68,15 @@ _ktutil() esac done - if [[ "$cur" == -* ]]; then - case $command in + if [[ $cur == -* ]]; then + case ${command-} in add) options='-p --principal -V -e --enctype -w --password -r --random -s --no-salt -h --hex' - ;; + ;; change) options='-r --realm -a --admin-server -s --server-port' - ;; + ;; get) options='-p --principal -e --enctype -r --realm -a --admin-server -s server --server-port' @@ -90,16 +90,16 @@ _ktutil() purge) options='--age' ;; - srv2keytab|key2srvtab) + srv2keytab | key2srvtab) options='-s --srvtab' ;; *) options='-k --keytab -v --verbose --version -v --help' ;; esac - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) else - case $command in + case ${command-} in copy) _filedir ;; @@ -110,11 +110,11 @@ _ktutil() _heimdal_principals ;; *) - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$commands" -- "$cur")) ;; esac fi } && -complete -F _ktutil ktutil + complete -F _ktutil ktutil # ex: filetype=sh diff --git a/completions/larch b/completions/larch index 5b7ebd148d9..7ed9ca20767 100644 --- a/completions/larch +++ b/completions/larch @@ -6,8 +6,8 @@ _larch() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 || "$prev" == -* ]]; then - COMPREPLY=( $( compgen -W ' \ + if [[ $cword -eq 1 || $prev == -* ]]; then + COMPREPLY=($(compgen -W ' \ my-id my-default-archive register-archive whereis-archive archives \ init-tree tree-root tree-version set-tree-version inventory \ tagging-method tree-lint missing-tags add delete \ @@ -30,10 +30,10 @@ _larch() distribution-name notify my-notifier mail-new-categories \ mail-new-branches mail-new-versions mail-new-revisions \ notify-library notify-browser push-new-revisions sendmail-mailx' \ - "$cur" ) ) + "$cur")) fi } && -complete -F _larch -o default larch + complete -F _larch -o default larch # ex: filetype=sh diff --git a/completions/lastlog b/completions/lastlog index 83e232b0eec..214a174d590 100644 --- a/completions/lastlog +++ b/completions/lastlog @@ -6,20 +6,20 @@ _lastlog() _init_completion -s || return case $prev in - --before|--help|--time|-!(-*)@([bt]|h*)) + --before | --help | --time | -!(-*)@([bt]|h*)) return ;; - --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + --user | -!(-*)u) + COMPREPLY=($(compgen -u -- "$cur")) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _lastlog lastlog + complete -F _lastlog lastlog # ex: filetype=sh diff --git a/completions/ldapsearch b/completions/ldapsearch index 66c0e03c56f..6dc415e66e1 100644 --- a/completions/ldapsearch +++ b/completions/ldapsearch @@ -2,12 +2,12 @@ _ldap_uris() { - COMPREPLY=( $( compgen -W 'ldap:// ldaps://' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ldap:// ldaps://' -- "$cur")) } _ldap_protocols() { - COMPREPLY=( $( compgen -W '2 3' -- "$cur" ) ) + COMPREPLY=($(compgen -W '2 3' -- "$cur")) } _ldapsearch() @@ -33,12 +33,11 @@ _ldapsearch() return ;; -*s) - COMPREPLY=( $( compgen -W 'base one sub children' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'base one sub children' -- "$cur")) return ;; -*a) - COMPREPLY=( $( compgen -W 'never always search find' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'never always search find' -- "$cur")) return ;; -*P) @@ -47,11 +46,11 @@ _ldapsearch() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur")) fi } && -complete -F _ldapsearch ldapsearch + complete -F _ldapsearch ldapsearch _ldapaddmodify() { @@ -77,11 +76,11 @@ _ldapaddmodify() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur")) fi } && -complete -F _ldapaddmodify ldapadd ldapmodify + complete -F _ldapaddmodify ldapadd ldapmodify _ldapdelete() { @@ -107,11 +106,11 @@ _ldapdelete() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur")) fi } && -complete -F _ldapdelete ldapdelete + complete -F _ldapdelete ldapdelete _ldapcompare() { @@ -137,11 +136,11 @@ _ldapcompare() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur")) fi } && -complete -F _ldapcompare ldapcompare + complete -F _ldapcompare ldapcompare _ldapmodrdn() { @@ -167,11 +166,11 @@ _ldapmodrdn() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -ZZ -MM' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") -ZZ -MM' -- "$cur")) fi } && -complete -F _ldapmodrdn ldapmodrdn + complete -F _ldapmodrdn ldapmodrdn _ldapwhoami() { @@ -197,11 +196,11 @@ _ldapwhoami() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur")) fi } && -complete -F _ldapwhoami ldapwhoami + complete -F _ldapwhoami ldapwhoami _ldappasswd() { @@ -223,10 +222,10 @@ _ldappasswd() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur")) fi } && -complete -F _ldappasswd ldappasswd + complete -F _ldappasswd ldappasswd # ex: filetype=sh diff --git a/completions/ldapvi b/completions/ldapvi index 0fc3a67f967..cb01ac8dd6d 100644 --- a/completions/ldapvi +++ b/completions/ldapvi @@ -6,46 +6,46 @@ _ldapvi() _init_completion || return case $prev in - --host|-!(-*)h) + --host | -!(-*)h) _known_hosts_real -- "$cur" return ;; - --sasl-mech|-!(-*)Y) - COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 - PLAIN ANONYMOUS' -- "$cur" ) ) + --sasl-mech | -!(-*)Y) + COMPREPLY=($(compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 + PLAIN ANONYMOUS' -- "$cur")) return ;; --bind) - COMPREPLY=( $( compgen -W 'simple sasl' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'simple sasl' -- "$cur")) return ;; --bind-dialog) - COMPREPLY=( $( compgen -W 'never auto always' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'never auto always' -- "$cur")) return ;; --scope) - COMPREPLY=( $( compgen -W 'base one sub' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'base one sub' -- "$cur")) return ;; --deref) - COMPREPLY=( $( compgen -W 'never searching finding always' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'never searching finding always' \ + -- "$cur")) return ;; --encoding) - COMPREPLY=( $( compgen -W 'ASCII UTF-8 binary' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ASCII UTF-8 binary' -- "$cur")) return ;; --tls) - COMPREPLY=( $( compgen -W 'never allow try strict' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'never allow try strict' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _ldapvi ldapvi + complete -F _ldapvi ldapvi # ex: filetype=sh diff --git a/completions/lftp b/completions/lftp index 674a5bfdd6b..72dedb42886 100644 --- a/completions/lftp +++ b/completions/lftp @@ -10,20 +10,19 @@ _lftp() _filedir return ;; - --help|--version|-!(-*)[chveups]) + --help | --version | -!(-*)[chveups]) return ;; esac - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi - COMPREPLY=( $( compgen -W \ - '$( cut -f 1 -s ~/.lftp/bookmarks ${XDG_DATA_HOME:-$HOME/.local/share}/lftp/bookmarks 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$("$1" -c "bookmark list" 2>/dev/null)' -- "$cur")) _known_hosts_real -- "$cur" } && -complete -F _lftp lftp + complete -F _lftp lftp # ex: filetype=sh diff --git a/completions/lftpget b/completions/lftpget index 8f1d4a2f906..d21622eb5b7 100644 --- a/completions/lftpget +++ b/completions/lftpget @@ -5,10 +5,10 @@ _lftpget() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-c -d -v' -- "$cur")) fi } && -complete -F _lftpget lftpget + complete -F _lftpget lftpget # ex: filetype=sh diff --git a/completions/lilo b/completions/lilo index 1ccca35c834..af8539aa95d 100644 --- a/completions/lilo +++ b/completions/lilo @@ -2,8 +2,9 @@ _lilo_labels() { - COMPREPLY=( $( compgen -W "$( awk -F'=' '/label/ {print $2}' \ - /etc/lilo.conf | command sed -e 's/\"//g' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(awk -F= '$1 ~ /^[ \t]*label$/ {print $2}' \ + ${1:-/etc/lilo.conf} 2>/dev/null | command sed -e 's/\"//g')" \ + -- "$cur")) } _lilo() @@ -12,7 +13,7 @@ _lilo() _init_completion || return case $prev in - -C|-i|-m|-s|-S) + -C | -i | -m | -s | -S) _filedir return ;; @@ -20,12 +21,19 @@ _lilo() _filedir -d return ;; - -I|-D|-R) + -I | -D | -R) # label completion - _lilo_labels + local i conf + for i in "${!words[@]}"; do + if [[ ${words[i]} == -C ]]; then + conf=${words[i + 1]} + break + fi + done + _lilo_labels $conf return ;; - -A|-b|-M|-u|-U) + -A | -b | -M | -u | -U) # device completion cur=${cur:=/dev/} _filedir @@ -33,18 +41,26 @@ _lilo() ;; -T) # topic completion - COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= table= - video' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'help ChRul EBDA geom geom= table= + video' -- "$cur")) + return + ;; + -B) + _filedir bmp + return + ;; + -E) + _filedir '@(bmp|dat)' return ;; esac - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # relevant options completion - COMPREPLY=( $( compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m -M -p -P - -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur" ) ) + COMPREPLY=($(compgen -W '-A -B -b -c -C -d -E -f -g -i -I -l -L -m -M + -p -P -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur")) fi } && -complete -F _lilo lilo + complete -F _lilo lilo # ex: filetype=sh diff --git a/completions/links b/completions/links index 8bbc68f9254..e0c28e21339 100644 --- a/completions/links +++ b/completions/links @@ -6,20 +6,20 @@ _links() _init_completion -n : || return case $prev in - -html-t-text-color|-html-t-link-color) - COMPREPLY=( $( compgen -W '{0..15}' -- "$cur" ) ) + -html-t-text-color | -html-t-link-color) + COMPREPLY=($(compgen -W '{0..15}' -- "$cur")) return ;; - -http.fake-firefox|-html-[gt]-ignore-document-color) - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + -http.fake-firefox | -html-[gt]-ignore-document-color) + COMPREPLY=($(compgen -W '0 1' -- "$cur")) return ;; - --help|-help|-mode|-display|-source|-dump|-width|-max-connections|\ - -max-connections-to-host|-retries|-receive-timeout|\ - -unrestartable-receive-timeout|-*-size|-*-proxy|\ - -append-text-to-dns-lookups|-ssl.client-cert-passwd|-http.fake-*|\ - -http.extra-header|-ftp.anonymous-passwd|-*-color|-*-gamma|\ - -bfu-aspect|-html-image-scale|-html-margin) + --help | -help | -mode | -display | -source | -dump | -width | -max-connections | \ + -max-connections-to-host | -retries | -receive-timeout | \ + -unrestartable-receive-timeout | -*-size | -*-proxy | \ + -append-text-to-dns-lookups | -ssl.client-cert-passwd | -http.fake-* | \ + -http.extra-header | -ftp.anonymous-passwd | -*-color | -*-gamma | \ + -bfu-aspect | -html-image-scale | -html-margin) return ;; -lookup) @@ -27,13 +27,13 @@ _links() return ;; -driver) - local drivers=$( "$1" -driver foo 2>&1 | - command sed -ne '$!d' -e '/^[a-z0-9, ]\{1,\}$/s/,/ /gp' ) + local drivers=$("$1" -driver foo 2>&1 | + command sed -ne '$!d' -e '/^[a-z0-9, ]\{1,\}$/s/,/ /gp') [[ $drivers ]] || drivers='x svgalib fb directfb pmshell atheos' - COMPREPLY=( $( compgen -W "$drivers" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$drivers" -- "$cur")) return ;; - -codepage|-bookmarks-codepage|-http-assume-codepage) + -codepage | -bookmarks-codepage | -http-assume-codepage) _xfunc iconv _iconv_charsets return ;; @@ -50,19 +50,19 @@ _links() __ltrim_colon_completions "$cur" return ;; - -async-dns|-download-utime|-aggressive-cache|-only-proxies|\ - -http-bugs.*|-http.do-not-track|-ftp.use-*|-ftp.fast|-ftp.set-iptos|\ - -smb.allow-hyperlinks-to-smb|-save-url-history|-dither-letters|\ - -dither-images|-overwrite-instead-of-scroll|-html-*) - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + -async-dns | -download-utime | -aggressive-cache | -only-proxies | \ + -http-bugs.* | -http.do-not-track | -ftp.use-* | -ftp.fast | -ftp.set-iptos | \ + -smb.allow-hyperlinks-to-smb | -save-url-history | -dither-letters | \ + -dither-images | -overwrite-instead-of-scroll | -html-*) + COMPREPLY=($(compgen -W '0 1' -- "$cur")) return ;; - -address-preference|-http.referer) - COMPREPLY=( $( compgen -W '{0..4}' -- "$cur" ) ) + -address-preference | -http.referer) + COMPREPLY=($(compgen -W '{0..4}' -- "$cur")) return ;; - -ssl-certificates|-display-optimize|-gamma-correction) - COMPREPLY=( $( compgen -W '{0..2}' -- "$cur" ) ) + -ssl-certificates | -display-optimize | -gamma-correction) + COMPREPLY=($(compgen -W '{0..2}' -- "$cur")) return ;; -ssl.client-cert-key) @@ -80,21 +80,21 @@ _links() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" | - command grep -vF -- "->" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1" | + command grep -vF -- "->")' -- "$cur")) return fi local dir for dir in .links .links2; do if [[ -r ~/$dir/links.his ]]; then - COMPREPLY+=( $( compgen -W '$( cat ~/$dir/links.his )' -- "$cur" ) ) + COMPREPLY+=($(compgen -W '$(cat ~/$dir/links.his)' -- "$cur")) __ltrim_colon_completions "$cur" fi done _filedir '@(htm|html)' } && -complete -F _links links links2 + complete -F _links links links2 # ex: filetype=sh diff --git a/completions/lintian b/completions/lintian index e62a62654ff..9343832523f 100644 --- a/completions/lintian +++ b/completions/lintian @@ -4,19 +4,19 @@ _lintian_tags() { local match search tags - tags=$( awk '/^Tag/ { print $2 }' /usr/share/lintian/checks/*.desc ) - if [[ "$cur" == *, ]]; then + tags=$(awk '/^Tag/ { print $2 }' /usr/share/lintian/checks/*.desc) + if [[ $cur == *, ]]; then search=${cur//,/ } for item in $search; do - match=$( command grep -nE "^Tag: $item$" \ - /usr/share/lintian/checks/*.desc | cut -d: -f1 ) - tags=$( command sed -e "s/\<$item\>//g" <<<$tags ) + match=$(command grep -nE "^Tag: $item$" \ + /usr/share/lintian/checks/*.desc | cut -d: -f1) + tags=$(command sed -e "s/\<$item\>//g" <<<$tags) done - COMPREPLY+=( $(compgen -W "$tags") ) - elif [[ "$cur" == *,* ]]; then - COMPREPLY+=( $(compgen -P "${cur%,*}," -W "$tags" -- "${cur##*,}") ) + COMPREPLY+=($(compgen -W "$tags")) + elif [[ $cur == *,* ]]; then + COMPREPLY+=($(compgen -P "${cur%,*}," -W "$tags" -- "${cur##*,}")) else - COMPREPLY+=( $(compgen -W "$tags" -- "$cur") ) + COMPREPLY+=($(compgen -W "$tags" -- "$cur")) fi } @@ -24,23 +24,23 @@ _lintian_checks() { local match search todisable checks - checks=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' \ - /usr/share/lintian/checks/*.desc ) - if [[ "$cur" == *, ]]; then + checks=$(awk '/^(Check-Script|Abbrev)/ { print $2 }' \ + /usr/share/lintian/checks/*.desc) + if [[ $cur == *, ]]; then search=${cur//,/ } for item in $search; do - match=$( command grep -nE "^(Check-Script|Abbrev): $item$" \ - /usr/share/lintian/checks/*.desc | cut -d: -f1 ) - todisable=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' $match ) + match=$(command grep -nE "^(Check-Script|Abbrev): $item$" \ + /usr/share/lintian/checks/*.desc | cut -d: -f1) + todisable=$(awk '/^(Check-Script|Abbrev)/ { print $2 }' $match) for name in $todisable; do - checks=$( command sed -e "s/\<$name\>//g" <<<$checks ) + checks=$(command sed -e "s/\<$name\>//g" <<<$checks) done done - COMPREPLY+=( $(compgen -W "$checks") ) - elif [[ "$cur" == *,* ]]; then - COMPREPLY+=( $(compgen -P "${cur%,*}," -W "$checks" -- "${cur##*,}") ) + COMPREPLY+=($(compgen -W "$checks")) + elif [[ $cur == *,* ]]; then + COMPREPLY+=($(compgen -P "${cur%,*}," -W "$checks" -- "${cur##*,}")) else - COMPREPLY+=( $(compgen -W "$checks" -- "$cur") ) + COMPREPLY+=($(compgen -W "$checks" -- "$cur")) fi } @@ -48,20 +48,20 @@ _lintian_infos() { local match search infos - infos=$( awk '/^Collector/ { print $2 }' \ - /usr/share/lintian/collection/*.desc ) - if [[ "$cur" == *, ]]; then + infos=$(awk '/^Collector/ { print $2 }' \ + /usr/share/lintian/collection/*.desc) + if [[ $cur == *, ]]; then search=${cur//,/ } for item in $search; do - match=$( command grep -nE "^Collector: $item$" \ - /usr/share/lintian/collection/*.desc | cut -d: -f1 ) - infos=$( command sed -e "s/\<$item\>//g" <<<$infos ) + match=$(command grep -nE "^Collector: $item$" \ + /usr/share/lintian/collection/*.desc | cut -d: -f1) + infos=$(command sed -e "s/\<$item\>//g" <<<$infos) done - COMPREPLY+=( $(compgen -W "$infos") ) - elif [[ "$cur" == *,* ]]; then - COMPREPLY+=( $(compgen -P "${cur%,*}," -W "$infos" -- "${cur##*,}") ) + COMPREPLY+=($(compgen -W "$infos")) + elif [[ $cur == *,* ]]; then + COMPREPLY+=($(compgen -P "${cur%,*}," -W "$infos" -- "${cur##*,}")) else - COMPREPLY+=( $(compgen -W "$infos" -- "$cur") ) + COMPREPLY+=($(compgen -W "$infos" -- "$cur")) fi } @@ -70,8 +70,7 @@ _lintian() local cur prev words cword _init_completion || return - local action lint_actions general_opts behaviour_opts \ - configuration_opts selection_opts + local lint_actions general_opts behaviour_opts configuration_opts lint_actions="--setup-lab --remove-lab --check --check-part --tags --tags-from-file --ftp-master-rejects --dont-check-part --unpack @@ -83,34 +82,33 @@ _lintian() --allow-root --fail-on-warnings --keep-lab" configuration_opts="--cfg --lab --archivedir --dist --area --section --arch --root" - selection_opts="--all --binary --source --udeb --packages-file" - if [[ "$prev" == -* ]]; then + if [[ $prev == -* ]]; then case $prev in - -C|--check-part|-X|--dont-check-part) + -C | --check-part | -X | --dont-check-part) _lintian_checks ;; - -T|--tags|--suppress-tags) + -T | --tags | --suppress-tags) _lintian_tags ;; - --tags-from-file|--suppress-tags-from-file|--cfg|-p|\ - --packages-file) + --tags-from-file | --suppress-tags-from-file | --cfg | -p | \ + --packages-file) _filedir ;; - --lab|--archivedir|--dist|--root) + --lab | --archivedir | --dist | --root) _filedir -d ;; --color) COMPREPLY=($(compgen -W "never always auto html" -- "$cur")) ;; - -U|--unpack-info) + -U | --unpack-info) _lintian_infos ;; - --area|--section) + --area | --section) COMPREPLY=($(compgen -W "main contrib non-free" -- "$cur")) ;; - --arch) - ;; + --arch) ;; + esac fi @@ -124,24 +122,25 @@ _lintian() # --action tag,tag, # Only few actions permit that, re-complete them now. case "$prev" in - -C|--check-part|-X|--dont-check-part) + -C | --check-part | -X | --dont-check-part) _lintian_checks ;; - -T|--tags|--suppress-tags) + -T | --tags | --suppress-tags) _lintian_tags ;; - -U|--unpack-info) + -U | --unpack-info) _lintian_infos ;; esac ;; *) - _filedir '@(?(u)deb|changes|dsc)' + # in Ubuntu, dbgsym packages end in .ddeb, lintian >= 2.57.0 groks + _filedir '@(?(u|d)deb|changes|dsc|buildinfo)' ;; esac return 0 } && -complete -F _lintian lintian + complete -F _lintian lintian _lintian_info() { @@ -149,15 +148,22 @@ _lintian_info() _init_completion || return case "$prev" in - -t|--tags) + --help | --profile) + return + ;; + -t | --tags) _lintian_tags - return 0 + return + ;; + --include-dir) + _filedir -d + return ;; esac case "$cur" in --*) - COMPREPLY=($(compgen -W "--annotate --help --tags" -- "$cur")) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) ;; *) _filedir @@ -165,6 +171,6 @@ _lintian_info() esac return 0 } && -complete -F _lintian_info lintian-info + complete -F _lintian_info lintian-info # ex: filetype=sh diff --git a/completions/lisp b/completions/lisp index 279ffcdb03d..098567bcab3 100644 --- a/completions/lisp +++ b/completions/lisp @@ -8,15 +8,15 @@ _lisp() _init_completion || return # completing an option (may or may not be separated by a space) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-core -lib -batch -quit -edit -eval -init + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-core -lib -batch -quit -edit -eval -init -dynamic-space-size -hinit -noinit -nositeinit -load -slave' \ - -- "$cur" ) ) + -- "$cur")) else _filedir fi } && -complete -F _lisp -o default lisp + complete -F _lisp -o default lisp # ex: filetype=sh diff --git a/completions/list_admins b/completions/list_admins index 06542f91c12..57081797db0 100644 --- a/completions/list_admins +++ b/completions/list_admins @@ -5,13 +5,13 @@ _list_admins() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all-vhost --all --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--all-vhost --all --help' -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _list_admins list_admins + complete -F _list_admins list_admins # ex: filetype=sh diff --git a/completions/list_lists b/completions/list_lists index 629e4c073f8..c5b9ba71fb3 100644 --- a/completions/list_lists +++ b/completions/list_lists @@ -2,7 +2,7 @@ _mailman_lists() { - COMPREPLY=( $( compgen -W '$( list_lists -b 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(list_lists -b 2>/dev/null)' -- "$cur")) } _list_lists() @@ -10,12 +10,12 @@ _list_lists() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview --bare - --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--advertised --virtual-host-overview --bare + --help' -- "$cur")) fi } && -complete -F _list_lists list_lists + complete -F _list_lists list_lists # ex: filetype=sh diff --git a/completions/list_members b/completions/list_members index e60f61da1d4..639344c77a3 100644 --- a/completions/list_members +++ b/completions/list_members @@ -6,31 +6,31 @@ _list_members() _init_completion -s || return case $prev in - -o|--output) + -o | --output) _filedir return ;; - -d|--digest) - COMPREPLY=( $( compgen -W 'mime plain' -- "$cur" ) ) + -d | --digest) + COMPREPLY=($(compgen -W 'mime plain' -- "$cur")) return ;; - -n|--nomail) - COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \ - -- "$cur" ) ) + -n | --nomail) + COMPREPLY=($(compgen -W 'byadmin byuser bybounce unknown' \ + -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--output --regular --digest --nomail - --fullnames --preserve --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--output --regular --digest --nomail + --fullnames --preserve --help' -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _list_members list_members + complete -F _list_members list_members # ex: filetype=sh diff --git a/completions/list_owners b/completions/list_owners index 88b25bb3a49..445be0bd518 100644 --- a/completions/list_owners +++ b/completions/list_owners @@ -5,14 +5,14 @@ _list_owners() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--with-listnames --moderators --help' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--with-listnames --moderators --help' \ + -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _list_owners list_owners + complete -F _list_owners list_owners # ex: filetype=sh diff --git a/completions/locale-gen b/completions/locale-gen index d3da9fa5a37..40682013104 100644 --- a/completions/locale-gen +++ b/completions/locale-gen @@ -6,7 +6,7 @@ _locale_gen() _init_completion -s || return case $prev in - --help|-h) + --help | -h) return ;; --aliases) @@ -18,15 +18,15 @@ _locale_gen() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - COMPREPLY=( $( compgen -W \ - '$( awk "{ print \$1 }" /usr/share/i18n/SUPPORTED 2>/dev/null )' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + '$(awk "{ print \$1 }" /usr/share/i18n/SUPPORTED 2>/dev/null)' \ + -- "$cur")) } && -complete -F _locale_gen locale-gen + complete -F _locale_gen locale-gen # ex: filetype=sh diff --git a/completions/lpq b/completions/lpq index b02705af1c8..36729d22f8b 100644 --- a/completions/lpq +++ b/completions/lpq @@ -7,22 +7,22 @@ _lpq() case $prev in -P) - COMPREPLY=( $( compgen -W "$( lpstat -a 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(lpstat -a 2>/dev/null | cut -d' ' -f1)" -- "$cur")) return ;; -U) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) return ;; esac - if [[ "$cur" == - ]]; then - COMPREPLY=( $( compgen -W '-E -P -U -a -h -l' -- "$cur" ) ) + if [[ $cur == - ]]; then + COMPREPLY=($(compgen -W '-E -P -U -a -h -l' -- "$cur")) return fi _filedir } && -complete -F _lpq lpq + complete -F _lpq lpq # ex: filetype=sh diff --git a/completions/lpr b/completions/lpr index b1515bd5f4a..554f0534040 100644 --- a/completions/lpr +++ b/completions/lpr @@ -7,27 +7,27 @@ _lpr() case $prev in -P) - COMPREPLY=( $( compgen -W "$( lpstat -a 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(lpstat -a 2>/dev/null | cut -d' ' -f1)" -- "$cur")) return ;; -U) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) return ;; -o) - COMPREPLY=( $( compgen -W "media= landscape orientation-requested= sides= fitplot number-up= scaling= cpi= lpi= page-bottom= page-top= page-left= page-right=" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W "media= landscape orientation-requested= sides= fitplot number-up= scaling= cpi= lpi= page-bottom= page-top= page-left= page-right=" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; esac - if [[ "$cur" == - ]]; then - COMPREPLY=( $( compgen -W '-E -H -C -J -T -P -U -h -l -m -o -p -q -r' -- "$cur" ) ) + if [[ $cur == - ]]; then + COMPREPLY=($(compgen -W '-E -H -C -J -T -P -U -h -l -m -o -p -q -r' -- "$cur")) return fi _filedir } && -complete -F _lpr lpr + complete -F _lpr lpr # ex: filetype=sh diff --git a/completions/lrzip b/completions/lrzip index d4e929faea9..7620e242d16 100644 --- a/completions/lrzip +++ b/completions/lrzip @@ -8,36 +8,37 @@ _lrzip() local xspec="*.lrz" case $prev in - -*@([wSm]|[Vh?]*)) + --help | --version | --suffix | --maxram | --window | \ + -!(-*)@([Smw]|[h?V]*)) return ;; - -*d) + --decompress | -!(-*)d) xspec="!"$xspec ;; - -*o) + --outfile | -!(-*)o) _filedir return ;; - -*O) + --outdir | -!(-*)O) _filedir -d return ;; - -*L) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + --level | -!(-*)L) + COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) return ;; - -*N) - COMPREPLY=( $( compgen -W '{-20..19}' -- "$cur" ) ) + --nice-level | -!(-*)N) + COMPREPLY=($(compgen -W '{-20..19}' -- "$cur")) return ;; - -*p) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + --threads | -!(-*)p) + COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi @@ -45,9 +46,8 @@ _lrzip() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur")) } && -complete -F _lrzip lrzip + complete -F _lrzip lrzip # ex: filetype=sh diff --git a/completions/lsof b/completions/lsof index 329946d5af1..eb1e967da68 100644 --- a/completions/lsof +++ b/completions/lsof @@ -6,23 +6,23 @@ _lsof() _init_completion || return case $prev in - -'?'|-h|+c|-c|-d|-F|-i|+r|-r|-s|-S|-T) + -'?' | -h | +c | -c | -d | -F | -i | +r | -r | -s | -S | -T) return ;; - -A|-k|-m|+m|-o) + -A | -k | -m | +m | -o) _filedir return ;; - +d|+D) + +d | +D) _filedir -d return ;; -D) - COMPREPLY=( $( compgen -W '? b i r u' -- "$cur" ) ) + COMPREPLY=($(compgen -W '? b i r u' -- "$cur")) return ;; -f) - COMPREPLY=( $( compgen -W 'c f g G n' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'c f g G n' -- "$cur")) return ;; -g) @@ -37,20 +37,20 @@ _lsof() ;; -u) # TODO: handle ^foo exclusions, comma separated lists - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) return ;; esac - if [[ "$cur" == [-+]* ]]; then - COMPREPLY=( $( compgen -W '-h -a -A -b -c +c -C +d -d +D -D +f -f -F -g + if [[ $cur == [-+]* ]]; then + COMPREPLY=($(compgen -W '-h -a -A -b -c +c -C +d -d +D -D +f -f -F -g -i -k -l +L -L +m -m +M -M -n -N -o -O -p -P +r -r -R -s -S -T -t - -u -U -v -V +w -w -x -X -z -Z' -- "$cur" ) ) + -u -U -v -V +w -w -x -X -z -Z' -- "$cur")) return fi _filedir } && -complete -F _lsof lsof + complete -F _lsof lsof # ex: filetype=sh diff --git a/completions/lspci b/completions/lspci index 2f097e6975b..d50783c9948 100644 --- a/completions/lspci +++ b/completions/lspci @@ -18,12 +18,12 @@ _lspci() return ;; -*A) - COMPREPLY+=( $( compgen -W '$( $1 -A help | command grep -vF : )' \ - -- "$cur") ) + COMPREPLY+=($(compgen -W '$($1 -A help | command grep -vF :)' \ + -- "$cur")) return ;; -*H) - COMPREPLY+=( $( compgen -W "1 2" -- "$cur" ) ) + COMPREPLY+=($(compgen -W "1 2" -- "$cur")) return ;; -*F) @@ -33,9 +33,9 @@ _lspci() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _lspci lspci + complete -F _lspci lspci # ex: filetype=sh diff --git a/completions/lsscsi b/completions/lsscsi index b261adcb232..bcbc430a918 100644 --- a/completions/lsscsi +++ b/completions/lsscsi @@ -6,10 +6,10 @@ _lsscsi() _init_completion -s || return case $prev in - --help|--version|-!(-*)[hV]*) + --help | --version | -!(-*)[hV]*) return ;; - --sysfsroot|-!(-*)y) + --sysfsroot | -!(-*)y) _filedir -d return ;; @@ -18,10 +18,10 @@ _lsscsi() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _lsscsi lsscsi + complete -F _lsscsi lsscsi # ex: filetype=sh diff --git a/completions/lsusb b/completions/lsusb index 8d28e3dc296..63cff54cd20 100644 --- a/completions/lsusb +++ b/completions/lsusb @@ -6,15 +6,15 @@ _lsusb() _init_completion || return case $prev in - --help|--version|-!(-*)@([sD]|[hV]*)) + --help | --version | -!(-*)@([sD]|[hV]*)) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _lsusb lsusb + complete -F _lsusb lsusb # ex: filetype=sh diff --git a/completions/lua b/completions/lua index 9413319e22d..b47a88e6945 100644 --- a/completions/lua +++ b/completions/lua @@ -6,18 +6,18 @@ _lua() _init_completion || return case $prev in - -e|-l|-v|-) + -e | -l | -v | -) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(_parse_help "$1")" -- "$cur")) return fi _filedir 'l@(ua|?(ua)c)' } && -complete -F _lua lua + complete -F _lua lua{,5{,.}{0..4}} # ex: filetype=sh diff --git a/completions/luac b/completions/luac index 9c91f25a919..7f47d873ff0 100644 --- a/completions/luac +++ b/completions/luac @@ -6,7 +6,7 @@ _luac() _init_completion || return case $prev in - -v|-) + -v | -) return ;; -o) @@ -16,12 +16,12 @@ _luac() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(_parse_help "$1")" -- "$cur")) return fi _filedir lua } && -complete -F _luac luac + complete -F _luac luac{,5{,.}{0..4}} # ex: filetype=sh diff --git a/completions/luseradd b/completions/luseradd index 50f1637c0b1..4d66385bf4a 100644 --- a/completions/luseradd +++ b/completions/luseradd @@ -6,20 +6,20 @@ _luseradd() _init_completion -s || return case $prev in - --help|--usage|--gecos|--uid|--login|--plainpassword|--password|\ - --commonname|--givenname|--surname|--roomnumber|--telephonenumber|\ - --homephone|-!(-*)@([culPp]|[?]*)) + --help | --usage | --gecos | --uid | --login | --plainpassword | --password | \ + --commonname | --givenname | --surname | --roomnumber | --telephonenumber | \ + --homephone | -!(-*)@([culPp]|[?]*)) return ;; - --directory|--skeleton|-!(-*)[dk]) + --directory | --skeleton | -!(-*)[dk]) _filedir -d return ;; - --shell|-!(-*)s) + --shell | -!(-*)s) _shells return ;; - --gid|-!(-*)g) + --gid | -!(-*)g) _gids return ;; @@ -27,14 +27,14 @@ _luseradd() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - [[ ${1##*/} == luseradd ]] || COMPREPLY=( $( compgen -u -- "$cur" ) ) + [[ ${1##*/} == luseradd ]] || COMPREPLY=($(compgen -u -- "$cur")) } && -complete -F _luseradd luseradd lusermod + complete -F _luseradd luseradd lusermod # ex: filetype=sh diff --git a/completions/luserdel b/completions/luserdel index 52c0d71e806..e36bda9fa19 100644 --- a/completions/luserdel +++ b/completions/luserdel @@ -6,18 +6,18 @@ _luserdel() _init_completion || return case $prev in - --help|--usage|-!(-*)[?]*) + --help | --usage | -!(-*)[?]*) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) } && -complete -F _luserdel luserdel + complete -F _luserdel luserdel # ex: filetype=sh diff --git a/completions/lvm b/completions/lvm index 02bd8e5d7df..e374856b9b6 100644 --- a/completions/lvm +++ b/completions/lvm @@ -8,43 +8,43 @@ _lvm_filedir() _lvm_volumegroups() { - COMPREPLY=( $(compgen -W "$( vgscan 2>/dev/null | \ - command sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(vgscan 2>/dev/null | + command sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p')" -- "$cur")) } _lvm_physicalvolumes_all() { - COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \ - command sed -n -e 's|^.*PV \([^ ]*\) .*|\1|p' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(pvscan 2>/dev/null | + command sed -n -e 's|^.*PV \([^ ]*\) .*|\1|p')" -- "$cur")) } _lvm_physicalvolumes() { - COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \ - command sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(pvscan 2>/dev/null | + command sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p')" -- "$cur")) } _lvm_logicalvolumes() { - COMPREPLY=( $(compgen -W "$( lvscan 2>/dev/null | \ - command sed -n -e "s|^.*'\(.*\)'.*$|\1|p" )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(lvscan 2>/dev/null | + command sed -n -e "s|^.*'\(.*\)'.*$|\1|p")" -- "$cur")) if [[ $cur == /dev/mapper/* ]]; then _filedir local i - for i in ${!COMPREPLY[@]}; do - [[ ${COMPREPLY[i]} == */control ]] && unset 'COMPREPLY[i]' + for i in "${!COMPREPLY[@]}"; do + [[ ${COMPREPLY[i]} == */control ]] && unset -v 'COMPREPLY[i]' done fi } _lvm_units() { - COMPREPLY=( $( compgen -W 'h s b k m g t H K M G T' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'h s b k m g t H K M G T' -- "$cur")) } _lvm_sizes() { - COMPREPLY=( $( compgen -W 'k K m M g G t T' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'k K m M g G t T' -- "$cur")) } # @param $1 glob matching args known to take an argument @@ -52,13 +52,14 @@ _lvm_count_args() { args=0 local offset=1 - if [[ "${words[0]}" == lvm ]]; then + if [[ ${words[0]} == lvm ]]; then offset=2 fi - local i prev=${words[$offset-1]} - for (( i=$offset; i < cword; i++ )); do - if [[ "${words[i]}" != -* && $prev != $1 ]]; then - args=$(($args + 1)) + local i prev=${words[offset - 1]} + for ((i = offset; i < cword; i++)); do + # shellcheck disable=SC2053 + if [[ ${words[i]} != -* && $prev != $1 ]]; then + ((args++)) fi prev=${words[i]} done @@ -69,24 +70,22 @@ _lvmdiskscan() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) fi } && -complete -F _lvmdiskscan lvmdiskscan + complete -F _lvmdiskscan lvmdiskscan _pvscan() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--debug --exported --novolumegroup --help - --ignorelockingfailure --partial --short --uuid --verbose - --version' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) fi } && -complete -F _pvscan pvscan + complete -F _pvscan pvscan _pvs() { @@ -94,9 +93,9 @@ _pvs() _init_completion || return case $prev in - --options|--sort|-!(-*)[oO]) - COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid pv_size pv_free pv_used - pv_name pv_attr pv_pe_count pv_pe_alloc_count' -- "$cur" ) ) + --options | --sort | -!(-*)[oO]) + COMPREPLY=($(compgen -W 'pv_fmt pv_uuid pv_size pv_free pv_used + pv_name pv_attr pv_pe_count pv_pe_alloc_count' -- "$cur")) return ;; --units) @@ -105,13 +104,13 @@ _pvs() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_physicalvolumes_all fi } && -complete -F _pvs pvs + complete -F _pvs pvs _pvdisplay() { @@ -125,13 +124,13 @@ _pvdisplay() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_physicalvolumes_all fi } && -complete -F _pvdisplay pvdisplay + complete -F _pvdisplay pvdisplay _pvchange() { @@ -139,19 +138,19 @@ _pvchange() _init_completion || return case $prev in - --autobackup|--allocatable|-!(-*)[Ax]) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | --allocatable | -!(-*)[Ax]) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_physicalvolumes_all fi } && -complete -F _pvchange pvchange + complete -F _pvchange pvchange _pvcreate() { @@ -163,27 +162,27 @@ _pvcreate() _filedir return ;; - --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + --metadatatype | -!(-*)M) + COMPREPLY=($(compgen -W '1 2' -- "$cur")) return ;; --metadatacopies) - COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) + COMPREPLY=($(compgen -W '0 1 2' -- "$cur")) return ;; - --metadatasize|--setphysicalvolumesize) + --metadatasize | --setphysicalvolumesize) _lvm_sizes return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_filedir fi } && -complete -F _pvcreate pvcreate + complete -F _pvcreate pvcreate _pvmove() { @@ -191,48 +190,47 @@ _pvmove() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --name|-!(-*)n) + --name | -!(-*)n) _lvm_logicalvolumes return + ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--abort --autobackup --background --debug - --force --help --interval --test --verbose --version --name' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_physicalvolumes fi } && -complete -F _pvmove pvmove + complete -F _pvmove pvmove _pvremove() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_physicalvolumes_all fi } && -complete -F _pvremove pvremove + complete -F _pvremove pvremove _vgscan() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) fi } && -complete -F _vgscan vgscan + complete -F _vgscan vgscan _vgs() { @@ -240,11 +238,11 @@ _vgs() _init_completion || return case $prev in - --options|--sort|-!(-*)[oO]) - COMPREPLY=( $( compgen -W 'vg_fmt vg_uuid vg_name vg_attr vg_size + --options | --sort | -!(-*)[oO]) + COMPREPLY=($(compgen -W 'vg_fmt vg_uuid vg_name vg_attr vg_size vg_free vg_sysid vg_extent_size vg_extent_count vg_free_count max_lv max_pv pv_count lv_count snap_count vg_seqno' \ - -- "$cur" ) ) + -- "$cur")) return ;; --units) @@ -253,13 +251,13 @@ _vgs() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgs vgs + complete -F _vgs vgs _vgdisplay() { @@ -273,13 +271,13 @@ _vgdisplay() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgdisplay vgdisplay + complete -F _vgdisplay vgdisplay _vgchange() { @@ -287,22 +285,19 @@ _vgchange() _init_completion || return case $prev in - --available|--autobackup|--resizeable|-!(-*)[aAx]) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --available | --autobackup | --resizeable | -!(-*)[aAx]) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --alloc --partial --debug - --help --ignorelockingfailure --test --uuid --verbose --version - --available --resizeable --logicalvolume --addtag --deltag' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgchange vgchange + complete -F _vgchange vgchange _vgcreate() { @@ -310,48 +305,46 @@ _vgcreate() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + --metadatatype | -!(-*)M) + COMPREPLY=($(compgen -W '1 2' -- "$cur")) return ;; - --physicalextentsize|-!(-*)s) + --physicalextentsize | -!(-*)s) _lvm_sizes return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --addtag --alloc --debug --help - --maxlogicalvolumes --metadatatype --maxphysicalvolumes - --physicalextentsize --test --verbose --version' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else local args _lvm_count_args '@(-A|--autobackup|-M|--metadatatype|-s|--physicalextentsize)' - if [[ $args -eq 0 ]]; then + if ((args == 0)); then _lvm_volumegroups else _lvm_physicalvolumes_all fi fi } && -complete -F _vgcreate vgcreate + complete -F _vgcreate vgcreate _vgremove() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgremove vgremove + complete -F _vgremove vgremove _vgrename() { @@ -359,19 +352,19 @@ _vgrename() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgrename vgrename + complete -F _vgrename vgrename _vgreduce() { @@ -379,26 +372,26 @@ _vgreduce() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else local args _lvm_count_args '@(-A|--autobackup)' - if [[ $args -eq 0 ]]; then + if ((args == 0)); then _lvm_volumegroups else _lvm_physicalvolumes fi fi } && -complete -F _vgreduce vgreduce + complete -F _vgreduce vgreduce _vgextend() { @@ -406,55 +399,55 @@ _vgextend() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --size|-!(-*)L) + --size | -!(-*)L) _lvm_sizes return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else local args _lvm_count_args '@(-A|--autobackup|-L|--size)' - if [[ $args -eq 0 ]]; then + if ((args == 0)); then _lvm_volumegroups else _lvm_physicalvolumes_all fi fi } && -complete -F _vgextend vgextend + complete -F _vgextend vgextend _vgport() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgport vgimport vgexport + complete -F _vgport vgimport vgexport _vgck() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgck vgck + complete -F _vgck vgck _vgconvert() { @@ -462,12 +455,12 @@ _vgconvert() _init_completion || return case $prev in - --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + --metadatatype | -!(-*)M) + COMPREPLY=($(compgen -W '1 2' -- "$cur")) return ;; --metadatacopies) - COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) + COMPREPLY=($(compgen -W '0 1 2' -- "$cur")) return ;; --metadatasize) @@ -476,13 +469,13 @@ _vgconvert() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgconvert vgconvert + complete -F _vgconvert vgconvert _vgcfgbackup() { @@ -490,19 +483,19 @@ _vgcfgbackup() _init_completion || return case $prev in - --file|-!(-*)f) + --file | -!(-*)f) _filedir return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgcfgbackup vgcfgbackup + complete -F _vgcfgbackup vgcfgbackup _vgcfgrestore() { @@ -510,27 +503,27 @@ _vgcfgrestore() _init_completion || return case $prev in - --file|-!(-*)f) + --file | -!(-*)f) _filedir return ;; - --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + --metadatatype | -!(-*)M) + COMPREPLY=($(compgen -W '1 2' -- "$cur")) return ;; - --name|-!(-*)n) + --name | -!(-*)n) _lvm_volumegroups return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgcfgrestore vgcfgrestore + complete -F _vgcfgrestore vgcfgrestore _vgmerge() { @@ -538,19 +531,19 @@ _vgmerge() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgmerge vgmerge + complete -F _vgmerge vgmerge _vgsplit() { @@ -558,54 +551,53 @@ _vgsplit() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + --metadatatype | -!(-*)M) + COMPREPLY=($(compgen -W '1 2' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --debug --help --list - --metadatatype --test --verbose --version' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else local args _lvm_count_args '@(-A|--autobackup|-M|--metadatatype)' - if [[ $args -eq 0 || $args -eq 1 ]]; then + if ((args == 0 || args == 1)); then _lvm_volumegroups else _lvm_physicalvolumes fi fi } && -complete -F _vgsplit vgsplit + complete -F _vgsplit vgsplit _vgmknodes() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_volumegroups fi } && -complete -F _vgmknodes vgmknodes + complete -F _vgmknodes vgmknodes _lvscan() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) fi } && -complete -F _lvscan lvscan + complete -F _lvscan lvscan _lvs() { @@ -613,10 +605,10 @@ _lvs() _init_completion || return case $prev in - --options|--sort|-!(-*)[oO]) - COMPREPLY=( $( compgen -W 'lv_uuid lv_name lv_attr lv_minor lv_size + --options | --sort | -!(-*)[oO]) + COMPREPLY=($(compgen -W 'lv_uuid lv_name lv_attr lv_minor lv_size seg_count origin snap_percent segtype stripes stripesize - chunksize seg_start seg_size' -- "$cur" ) ) + chunksize seg_start seg_size' -- "$cur")) return ;; --units) @@ -625,13 +617,13 @@ _lvs() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_logicalvolumes fi } && -complete -F _lvs lvs + complete -F _lvs lvs _lvdisplay() { @@ -645,13 +637,13 @@ _lvdisplay() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_logicalvolumes fi } && -complete -F _lvdisplay lvdisplay + complete -F _lvdisplay lvdisplay _lvchange() { @@ -659,23 +651,23 @@ _lvchange() _init_completion || return case $prev in - --available|--autobackup|--contiguous|--persistent|-!(-*)[aACM]) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --available | --autobackup | --contiguous | --persistent | -!(-*)[aACM]) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --permission|-!(-*)p) - COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) + --permission | -!(-*)p) + COMPREPLY=($(compgen -W 'r rw' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_logicalvolumes fi } && -complete -F _lvchange lvchange + complete -F _lvchange lvchange _lvcreate() { @@ -683,37 +675,37 @@ _lvcreate() _init_completion || return case $prev in - --autobackup|--contiguous|--persistent|--zero|-!(-*)[ACMZ]) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | --contiguous | --persistent | --zero | -!(-*)[ACMZ]) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --size|-!(-*)L) + --size | -!(-*)L) _lvm_sizes return ;; - --permission|-!(-*)p) - COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) + --permission | -!(-*)p) + COMPREPLY=($(compgen -W 'r rw' -- "$cur")) return ;; - --name|-!(-*)n) + --name | -!(-*)n) _lvm_logicalvolumes return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else local args _lvm_count_args '@(-A|-C|-M|-Z|--autobackup|--contiguous|--persistent|--zero|-L|--size|-p|--permission|-n|--name)' - if [[ $args -eq 0 ]]; then + if ((args == 0)); then _lvm_volumegroups else _lvm_physicalvolumes fi fi } && -complete -F _lvcreate lvcreate + complete -F _lvcreate lvcreate _lvremove() { @@ -721,19 +713,19 @@ _lvremove() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_logicalvolumes fi } && -complete -F _lvremove lvremove + complete -F _lvremove lvremove _lvrename() { @@ -741,19 +733,19 @@ _lvrename() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_logicalvolumes fi } && -complete -F _lvrename lvrename + complete -F _lvrename lvrename _lvreduce() { @@ -761,23 +753,23 @@ _lvreduce() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --size|-!(-*)L) + --size | -!(-*)L) _lvm_sizes return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _lvm_logicalvolumes fi } && -complete -F _lvreduce lvreduce + complete -F _lvreduce lvreduce _lvresize() { @@ -785,29 +777,29 @@ _lvresize() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --size|-!(-*)L) + --size | -!(-*)L) _lvm_sizes return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else local args _lvm_count_args '@(-A|--autobackup|-L|--size)' - if [[ $args -eq 0 ]]; then + if ((args == 0)); then _lvm_logicalvolumes else _lvm_physicalvolumes fi fi } && -complete -F _lvresize lvresize + complete -F _lvresize lvresize _lvextend() { @@ -815,55 +807,55 @@ _lvextend() _init_completion || return case $prev in - --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + --autobackup | -!(-*)A) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - --size|-!(-*)L) + --size | -!(-*)L) _lvm_sizes return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else local args _lvm_count_args '@(-A|--autobackup|-L|--size)' - if [[ $args -eq 0 ]]; then + if ((args == 0)); then _lvm_logicalvolumes else _lvm_physicalvolumes fi fi } && -complete -F _lvextend lvextend + complete -F _lvextend lvextend _lvm() { local cur prev words cword _init_completion || return - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'dumpconfig help lvchange lvcreate lvdisplay + if ((cword == 1)); then + COMPREPLY=($(compgen -W 'dumpconfig help lvchange lvcreate lvdisplay lvextend lvmchange lvmdiskscan lvmsadc lvmsar lvreduce lvremove lvrename lvresize lvs lvscan pvchange pvcreate pvdata pvdisplay pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan - vgsplit version' -- "$cur" ) ) + vgsplit version' -- "$cur")) else case "${words[1]}" in - pvchange|pvcreate|pvdisplay|pvmove|pvremove|pvresize|pvs|pvscan|\ - vgcfgbackup|vgcfgrestore|vgchange|vgck|vgconvert|vgcreate|\ - vgdisplay|vgexport|vgextend|vgimport|vgmerge|vgmknodes|vgreduce|\ - vgremove|vgrename|vgs|vgscan|vgsplit|lvchange|lvcreate|lvdisplay|\ - lvextend|lvreduce|lvremove|lvrename|lvresize|lvscan) + pvchange | pvcreate | pvdisplay | pvmove | pvremove | pvresize | pvs | pvscan | \ + vgcfgbackup | vgcfgrestore | vgchange | vgck | vgconvert | vgcreate | \ + vgdisplay | vgexport | vgextend | vgimport | vgmerge | vgmknodes | vgreduce | \ + vgremove | vgrename | vgs | vgscan | vgsplit | lvchange | lvcreate | lvdisplay | \ + lvextend | lvreduce | lvremove | lvrename | lvresize | lvscan) _${words[1]} ;; esac fi } && -complete -F _lvm lvm + complete -F _lvm lvm # ex: filetype=sh diff --git a/completions/lz4 b/completions/lz4 index 365fef9d6b7..f297b5d8dd3 100644 --- a/completions/lz4 +++ b/completions/lz4 @@ -12,23 +12,22 @@ _lz4() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( _parse_help "$1" -h | command sed -e "/#/d" ) -B{4..7} -i{1..9}' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -X '-*#*' -W \ + '$(_parse_help "$1" -h) -B{4..7} -i{1..9}' -- "$cur")) return fi local args word xspec="*.?(t)lz4" _count_args - [[ $args -gt 2 ]] && return + ((args > 2)) && return - for word in ${words[@]}; do + for word in "${words[@]}"; do case $word in -*[dt]*) case $args in 1) xspec="!"$xspec ;; - 2) [[ $word == *t* ]] && return + 2) [[ $word == *t* ]] && return ;; esac break ;; @@ -46,9 +45,8 @@ _lz4() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur")) } && -complete -F _lz4 lz4 lz4c + complete -F _lz4 lz4 lz4c # ex: filetype=sh diff --git a/completions/lzip b/completions/lzip index 6611e26c62e..05f169c960a 100644 --- a/completions/lzip +++ b/completions/lzip @@ -8,15 +8,15 @@ _lzip() local decompress=false case $prev in - --help|--version|--member-size|--match-length|--dictionary-size|\ - --volume-size|--data-size|-!(-*)@([bmsSB]|[hV]*)) + --help | --version | --member-size | --match-length | --dictionary-size | \ + --volume-size | --data-size | -!(-*)@([bmsSB]|[hV]*)) return ;; --decompress-!(-*)d) decompress=true ;; --threads-!(-*)n) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) return ;; --output-!(-*)o) @@ -27,10 +27,9 @@ _lzip() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") {-1..-9}' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi @@ -41,9 +40,8 @@ _lzip() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "*.lz" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=($(compgen -f -X "*.lz" -- "$cur") $(compgen -d -- "$cur")) } && -complete -F _lzip clzip lzip pdlzip plzip + complete -F _lzip clzip lzip pdlzip plzip # ex: filetype=sh diff --git a/completions/lzma b/completions/lzma index 7b1df28f7fe..34fba89f8a1 100644 --- a/completions/lzma +++ b/completions/lzma @@ -8,28 +8,27 @@ _lzma() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -{1..9}' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1") -{1..9}' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local IFS=$'\n' xspec="*.@(lzma|tlz)" - if [[ "$prev" == --* ]]; then - [[ "$prev" == --@(decompress|list|test) ]] && xspec="!"$xspec - [[ "$prev" == --compress ]] && xspec= - elif [[ "$prev" == -* ]]; then - [[ "$prev" == -*[dt]* ]] && xspec="!"$xspec - [[ "$prev" == -*z* ]] && xspec= + if [[ $prev == --* ]]; then + [[ $prev == --@(decompress|list|test) ]] && xspec="!"$xspec + [[ $prev == --compress ]] && xspec= + elif [[ $prev == -* ]]; then + [[ $prev == -*[dt]* ]] && xspec="!"$xspec + [[ $prev == -*z* ]] && xspec= fi _tilde "$cur" || return compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur")) } && -complete -F _lzma lzma + complete -F _lzma lzma # ex: filetype=sh diff --git a/completions/lzop b/completions/lzop index 689a9ae4553..2642742a529 100644 --- a/completions/lzop +++ b/completions/lzop @@ -6,7 +6,7 @@ _lzop() _init_completion || return case $prev in - --output|-!(-*)o) + --output | -!(-*)o) _filedir return ;; @@ -14,32 +14,32 @@ _lzop() _filedir -d return ;; - --suffix|-!(-*)S) + --suffix | -!(-*)S) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P --fast --best --decompress --extract --test --list --ls --info --sysinfo --license --help --version --stdout --output --path --force --no-checksum --no-name --name --no-mode --no-time --suffix --keep --delete --crc32 --no-warn --ignore-warn --quiet --verbose --no-stdin --filter --checksum --no-color --mono --color' \ - -- "$cur" ) ) + -- "$cur")) return fi local xspec="*.?(t)lzo" case $prev in - --decompress|--uncompress|--extract|--list|--ls|--info|--test) + --decompress | --uncompress | --extract | --list | --ls | --info | --test) xspec="!"$xspec ;; --force) xspec= ;; - --*) - ;; + --*) ;; + -*f*) xspec= ;; @@ -52,9 +52,8 @@ _lzop() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur")) } && -complete -F _lzop lzop + complete -F _lzop lzop # ex: filetype=sh diff --git a/completions/macof b/completions/macof index dacae2fdc28..ad29f58fb2d 100644 --- a/completions/macof +++ b/completions/macof @@ -12,12 +12,11 @@ _macof() ;; esac - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) fi } && -complete -F _macof macof + complete -F _macof macof # ex: filetype=sh diff --git a/completions/mailmanctl b/completions/mailmanctl index 717df7b9a47..3bbc2f24172 100644 --- a/completions/mailmanctl +++ b/completions/mailmanctl @@ -5,14 +5,14 @@ _mailmanctl() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-restart --run-as-user - --stale-lock-cleanup --quiet --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--no-restart --run-as-user + --stale-lock-cleanup --quiet --help' -- "$cur")) else - COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'start stop restart reopen' -- "$cur")) fi } && -complete -F _mailmanctl mailmanctl + complete -F _mailmanctl mailmanctl # ex: filetype=sh diff --git a/completions/makepkg b/completions/makepkg index 4ce333b2034..23ac7848620 100644 --- a/completions/makepkg +++ b/completions/makepkg @@ -7,15 +7,16 @@ _makepkg_slackware() _init_completion || return case "$prev" in - -l|--linkadd|-c|--chown) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + -l | --linkadd | -c | --chown) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$1 | sed -e "s/^options://" | _parse_help -' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W \ + '$($1 | command sed -e "s/^options://" | _parse_help -)' \ + -- "$cur")) return fi @@ -42,6 +43,6 @@ _makepkg_bootstrap() complete -F $fname makepkg $fname } && -complete -F _makepkg_bootstrap makepkg + complete -F _makepkg_bootstrap makepkg # ex: filetype=sh diff --git a/completions/man b/completions/man index d5fa50fcbe9..94935753c25 100644 --- a/completions/man +++ b/completions/man @@ -10,29 +10,33 @@ _man() local mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))" case $prev in - --config-file|-!(-*)C) + --config-file | -!(-*)C) _filedir conf return ;; - --local-file|-!(-*)l) + --local-file | -!(-*)l) _filedir "$manext" return ;; - --manpath|-!(-*)M) + --manpath | -!(-*)M) _filedir -d return ;; - --pager|-!(-*)P) + --sections | -!(-*)[Ss]) + _comp_delimited : -W '{1..9}' + return + ;; + --pager | -!(-*)P) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) return ;; - --preprocessor|-!(-*)p) - COMPREPLY=( $( compgen -W 'e p t g r v' -- "$cur" ) ) + --preprocessor | -!(-*)p) + COMPREPLY=($(compgen -W 'e p t g r v' -- "$cur")) return ;; - --locale|--systems|--extension|--prompt|--recode|--encoding|\ - -!(-*)[LmerRE]) + --locale | --systems | --extension | --prompt | --recode | --encoding | \ + -!(-*)[LmerRE]) return ;; esac @@ -40,25 +44,36 @@ _man() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($( + compgen -W '$(_parse_help "$1" -h || _parse_usage "$1")' -- "$cur" + )) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi # file based completion if parameter looks like a path - if [[ "$cur" == @(*/|[.~])* ]]; then + if [[ $cur == @(*/|[.~])* ]]; then _filedir "$manext" return fi - local manpath=$( manpath 2>/dev/null || command man -w 2>/dev/null ) - [[ -z $manpath ]] && manpath="/usr/share/man:/usr/local/share/man" + local manpath=$(manpath 2>/dev/null || command man -w 2>/dev/null) + if [[ -z $manpath ]]; then + # Note: Both "manpath" and "man -w" may be unavailable, in + # which case we determine the man paths based on the + # environment variable MANPATH. + manpath=:${MANPATH-}: + # Note: An empty path (represented by two consecutive colons + # or a preceding/trailing colon) represents the system man + # paths. + manpath=${manpath//::/':/usr/share/man:/usr/local/share/man:'} + manpath=${manpath:1:-1} + fi # determine manual section to search local sect - [[ "$prev" == $mansect ]] && sect=$prev || sect='*' - - _expand || return + # shellcheck disable=SC2053 + [[ $prev == $mansect ]] && sect=$prev || sect='*' manpath=$manpath: if [[ -n $cur ]]; then @@ -67,26 +82,35 @@ _man() manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }" fi + local IFS=$' \t\n' reset=$(shopt -p failglob) + shopt -u failglob # redirect stderr for when path doesn't exist - COMPREPLY=( $( eval command ls "$manpath" 2>/dev/null ) ) - # weed out directory path names and paths to man pages - COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) - # strip suffix from man pages - COMPREPLY=( ${COMPREPLY[@]%$comprsuffix} ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) + COMPREPLY=($(eval command ls "$manpath" 2>/dev/null)) + $reset + + if ((${#COMPREPLY[@]} != 0)); then + # weed out directory path names and paths to man pages + COMPREPLY=(${COMPREPLY[@]##*/?(:)}) + # strip suffix from man pages + ((${#COMPREPLY[@]})) && + COMPREPLY=(${COMPREPLY[@]%$comprsuffix}) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]%.*}"' -- "${cur//\\\\/}")) + fi - if [[ "$prev" != $mansect ]]; then + # shellcheck disable=SC2053 + if [[ $prev != $mansect ]]; then # File based completion for the rest, prepending ./ if needed # (man 1.6f needs that for man pages in current dir) local i start=${#COMPREPLY[@]} _filedir "$manext" - for (( i=$start; i < ${#COMPREPLY[@]}; i++ )); do + for ((i = start; i < ${#COMPREPLY[@]}; i++)); do [[ ${COMPREPLY[i]} == */* ]] || COMPREPLY[i]=./${COMPREPLY[i]} done fi __ltrim_colon_completions "$cur" } && -complete -F _man man apropos whatis + complete -F _man man apropos whatis # ex: filetype=sh diff --git a/completions/mc b/completions/mc index 74d7e5f55e7..cf38821c1f3 100644 --- a/completions/mc +++ b/completions/mc @@ -6,25 +6,24 @@ _mc() _init_completion -s || return case $prev in - --edit|--view|--ftplog|--printwd|-!(-*)[evlP]) + --edit | --view | --ftplog | --printwd | -!(-*)[evlP]) _filedir return ;; - --help|--help-*|--version|--colors|--debuglevel|-!(-*)[hVCD]) + --help | --help-* | --version | --colors | --debuglevel | -!(-*)[hVCD]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _filedir -d fi } && -complete -F _mc mc + complete -F _mc mc # ex: filetype=sh diff --git a/completions/mcrypt b/completions/mcrypt index 6d6a898f631..0c3ab5e681c 100644 --- a/completions/mcrypt +++ b/completions/mcrypt @@ -7,61 +7,61 @@ _mcrypt() _init_completion || return case $prev in - -g|--openpgp-z) - COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) ) + -g | --openpgp-z) + COMPREPLY=($(compgen -W '{0..9}' -- "$cur")) return ;; - -o|--keymode) - COMPREPLY=( $( compgen -W '$( $1 --list-keymodes \ - 2>/dev/null )' -- "$cur" ) ) + -o | --keymode) + COMPREPLY=($(compgen -W '$($1 --list-keymodes 2>/dev/null )' \ + -- "$cur")) return ;; - -m|--mode) - COMPREPLY=( $( compgen -W "$( $1 --list 2>/dev/null | \ - cut -d: -f2- )" -- "$cur" ) ) + -m | --mode) + COMPREPLY=($(compgen -W "$($1 --list 2>/dev/null | cut -d: -f2-)" \ + -- "$cur")) return ;; - -a|--algorithm) - COMPREPLY=( $( compgen -W "$( $1 --list 2>/dev/null | \ - awk '{print $1}' )" -- "$cur" ) ) + -a | --algorithm) + COMPREPLY=($(compgen -W "$($1 --list 2>/dev/null | + awk '{print $1}')" -- "$cur")) return ;; - -h|--hash) - COMPREPLY=( $( compgen -W '$( $1 --list-hash 2>/dev/null | \ - command sed -e 1d )' -- "$cur" ) ) + -h | --hash) + COMPREPLY=($(compgen -W '$($1 --list-hash 2>/dev/null | \ + command sed -e 1d)' -- "$cur")) return ;; - -k|-s|--key|--keysize) + -k | -s | --key | --keysize) return ;; - -f|-c|--keyfile|--config) + -f | -c | --keyfile | --config) _filedir return ;; - --algorithms-directory|--modes-directory) + --algorithms-directory | --modes-directory) _filedir -d return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) elif [[ ${words[0]} == mdecrypt ]]; then _filedir nc else local i decrypt=0 - for (( i=1; i < ${#words[@]}-1; i++ )); do + for ((i = 1; i < ${#words[@]} - 1; i++)); do if [[ ${words[i]} == -@(d|-decrypt) ]]; then _filedir nc decrypt=1 break fi done - if [[ $decrypt -eq 0 ]]; then + if ((decrypt == 0)); then _filedir fi fi } && -complete -F _mcrypt mcrypt mdecrypt + complete -F _mcrypt mcrypt mdecrypt # ex: filetype=sh diff --git a/completions/mdadm b/completions/mdadm index 7c7c467b16b..37effd96fa6 100644 --- a/completions/mdadm +++ b/completions/mdadm @@ -4,13 +4,13 @@ _mdadm_raid_level() { local mode - for (( i=1; i < cword; i++ )); do + for ((i = 1; i < cword; i++)); do case ${words[i]} in - -!(-*)C*|--create) + -!(-*)C* | --create) mode=create break ;; - -!(-*)B*|--build) + -!(-*)B* | --build) mode=build break ;; @@ -19,13 +19,13 @@ _mdadm_raid_level() case $mode in create) - COMPREPLY=( $( compgen -W 'linear raid0 0 stripe raid1 1 mirror + COMPREPLY=($(compgen -W 'linear raid0 0 stripe raid1 1 mirror raid4 4 raid5 5 raid6 6 raid10 10 multipath mp faulty' \ - -- "$cur" ) ) + -- "$cur")) ;; build) - COMPREPLY=( $( compgen -W 'linear stripe raid0 0 raid1 multipath mp - faulty' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'linear stripe raid0 0 raid1 multipath mp + faulty' -- "$cur")) ;; esac } @@ -33,64 +33,63 @@ _mdadm_raid_level() _mdadm_raid_layout() { local level - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == -@(l|-level) ]]; then - level=${words[i+1]} + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -@(l|-level) ]]; then + level=${words[i + 1]} break fi done case $level in raid5) - COMPREPLY=( $( compgen -W 'left-asymmetric left-symmetric - right-asymmetric right-symmetric la ra ls rs' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'left-asymmetric left-symmetric + right-asymmetric right-symmetric la ra ls rs' -- "$cur")) ;; raid10) - COMPREPLY=( $( compgen -W 'n o p' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'n o p' -- "$cur")) ;; faulty) - COMPREPLY=( $( compgen -W 'write-transient wt read-transient rt + COMPREPLY=($(compgen -W 'write-transient wt read-transient rt write-persistent wp read-persistent rp write-all read-fixable - rf clear flush none' -- "$cur" ) ) + rf clear flush none' -- "$cur")) ;; esac } _mdadm_auto_flag() { - COMPREPLY=( $( compgen -W 'no yes md mdp part p' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'no yes md mdp part p' -- "$cur")) } _mdadm_update_flag() { - COMPREPLY=( $( compgen -W 'sparc2.2 summaries uuid name homehost resync - byteorder super-minor' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'sparc2.2 summaries uuid name homehost resync + byteorder super-minor' -- "$cur")) } - _mdadm() { local cur prev words cword split _init_completion -s || return case $prev in - --config|--bitmap|--backup-file|-!(-*)[cb]) + --config | --bitmap | --backup-file | -!(-*)[cb]) _filedir return ;; - --level|-!(-*)l) + --level | -!(-*)l) _mdadm_raid_level return ;; - --layout|--parity|-!(-*)p) + --layout | --parity | -!(-*)p) _mdadm_raid_layout return ;; - --auto|-!(-*)a) + --auto | -!(-*)a) _mdadm_auto_flag return ;; - --update|-!(-*)U) + --update | -!(-*)U) _mdadm_update_flag return ;; @@ -101,50 +100,50 @@ _mdadm() local options='--help --help-options --version --verbose --quiet --brief --force --config= --scan --metadata= --homehost=' - if [[ "$cur" == -* ]]; then - if [[ $cword -eq 1 ]] ; then - COMPREPLY=( $( compgen -W "$options --assemble --build --create - --monitor --grow" -- "$cur" ) ) + if [[ $cur == -* ]]; then + if ((cword == 1)); then + COMPREPLY=($(compgen -W "$options --assemble --build --create + --monitor --grow" -- "$cur")) else - case ${words[cword-1]} in - --assemble|-!(-*)A*) - COMPREPLY=( $( compgen -W "$options --uuid= --super-minor= + case ${words[cword - 1]} in + --assemble | -!(-*)A*) + COMPREPLY=($(compgen -W "$options --uuid= --super-minor= --name= --force --run --no-degraded --auto= --bitmap= --backup-file= --update= --auto-update-homehost" \ - -- "$cur" ) ) + -- "$cur")) ;; - --build|--create|--grow|-!(-*)[BCG]*) - COMPREPLY=( $( compgen -W "$options --raid-devices= + --build | --create | --grow | -!(-*)[BCG]*) + COMPREPLY=($(compgen -W "$options --raid-devices= --spare-devices= --size= --chunk= --rounding= --level= --layout= --parity= --bitmap= --bitmap-chunk= --write-mostly --write-behind= --assume-clean --backup-file= --name= --run --force --auto=" \ - -- "$cur" ) ) + -- "$cur")) ;; - --follow|--monitor|-!(-*)F) - COMPREPLY=( $( compgen -W "$options --mail --program + --follow | --monitor | -!(-*)F) + COMPREPLY=($(compgen -W "$options --mail --program --alert --syslog --delay --daemonise --pid-file - --oneshot --test" -- "$cur" ) ) + --oneshot --test" -- "$cur")) ;; - /dev/*|--add|--fail|--remove) - COMPREPLY=( $( compgen -W "$options --add --re-add - --remove --fail --set-faulty" -- "$cur" ) ) + /dev/* | --add | --fail | --remove) + COMPREPLY=($(compgen -W "$options --add --re-add + --remove --fail --set-faulty" -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W "$options --query --detail + COMPREPLY=($(compgen -W "$options --query --detail --examine --sparc2.2 --examine-bitmap --run --stop --readonly --readwrite --zero-superblock --test" \ - -- "$cur" ) ) + -- "$cur")) ;; esac fi - [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else cur=${cur:=/dev/} _filedir fi } && -complete -F _mdadm mdadm + complete -F _mdadm mdadm # ex: filetype=sh diff --git a/completions/mdtool b/completions/mdtool index b4f36e563f1..428e33b7745 100644 --- a/completions/mdtool +++ b/completions/mdtool @@ -7,25 +7,26 @@ _mdtool() local command i - for (( i=0; i < ${#words[@]}-1; i++ )); do + for ((i = 1; i < ${#words[@]} - 1; i++)); do if [[ ${words[i]} == @(build|generate-makefiles|setup) ]]; then command=${words[i]} + break fi done - if [[ -n "$command" ]]; then + if [[ -v command ]]; then case $command in "build") - COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \ - -S":" -- "$cur" ) ) + COMPREPLY=($(compgen -W '--f --buildfile --p --project' \ + -S":" -- "$cur")) # TODO: This does not work :( #if [[ "$prev" == *: ]]; then # case $prev in # @(--p:|--project:)) - # COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) ) + # COMPREPLY=( $(compgen -f -G "*.mdp" -- "$cur") ) # ;; # @(--f:|--buildfile:)) - # COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) ) + # COMPREPLY=( $(compgen -f -G "*.mdp" -G "*.mds" -- "$cur") ) # ;; # esac #fi @@ -33,29 +34,29 @@ _mdtool() ;; "generate-makefiles") compopt -o filenames - COMPREPLY=( $( compgen -o filenames -G"*.mds" -- "$cur" ) ) - if [[ "$prev" == *mds ]]; then - COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -o filenames -G"*.mds" -- "$cur")) + if [[ $prev == *mds ]]; then + COMPREPLY=($(compgen -W '--simple-makefiles --s --d:' \ + -- "$cur")) fi return ;; "setup") # TODO: at least return filenames after these options. - COMPREPLY=( $( compgen -W 'install i uninstall u check-install + COMPREPLY=($(compgen -W 'install i uninstall u check-install ci update up list l list-av la list-update lu rep-add ra rep-remove rr rep-update ru rep-list rl reg-update reg-build rgu info rep-build rb pack p help h dump-file' \ - -- "$cur" ) ) + -- "$cur")) return ;; esac fi - COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export - generate-makefiles gettext-update setup -q' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'gsetup build dbgen project-export + generate-makefiles gettext-update setup -q' -- "$cur")) } && -complete -F _mdtool mdtool + complete -F _mdtool mdtool # ex: filetype=sh diff --git a/completions/medusa b/completions/medusa index a9f099c112b..45129879f60 100644 --- a/completions/medusa +++ b/completions/medusa @@ -15,16 +15,16 @@ _medusa() return ;; -*M) - COMPREPLY=( $( compgen -W "$($1 -d | awk '/^ +\+/ {print $2}' \ - | command sed -e 's/\.mod$//')" ) ) + COMPREPLY=($(compgen -W "$($1 -d | awk '/^ +\+/ {print $2}' | + command sed -e 's/\.mod$//')")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _medusa medusa + complete -F _medusa medusa # ex: filetype=sh diff --git a/completions/mii-diag b/completions/mii-diag index 87f5d8d5989..c433a7a2493 100644 --- a/completions/mii-diag +++ b/completions/mii-diag @@ -6,21 +6,21 @@ _mii_diag() _init_completion -s || return case $prev in - -F|-A|--advertise|--fixed-speed) - COMPREPLY=( $( compgen -W '100baseT4 100baseTx 100baseTx-FD - 100baseTx-HD 10baseT 10baseT-FD 10baseT-HD' -- "$cur" ) ) + -F | -A | --advertise | --fixed-speed) + COMPREPLY=($(compgen -W '100baseT4 100baseTx 100baseTx-FD + 100baseTx-HD 10baseT 10baseT-FD 10baseT-HD' -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else _available_interfaces -a fi } && -complete -F _mii_diag -o default mii-diag + complete -F _mii_diag -o default mii-diag # ex: filetype=sh diff --git a/completions/mii-tool b/completions/mii-tool index a87211b3ac2..1b80202b88e 100644 --- a/completions/mii-tool +++ b/completions/mii-tool @@ -6,27 +6,27 @@ _mii_tool() _init_completion -s || return case $prev in - --force|-!(-*)F) - COMPREPLY=( $( compgen -W '100baseTx-FD 100baseTx-HD 10baseT-FD - 10baseT-HD' -- "$cur" ) ) + --force | -!(-*)F) + COMPREPLY=($(compgen -W '100baseTx-FD 100baseTx-HD 10baseT-FD + 10baseT-HD' -- "$cur")) return ;; - --advertise|-!(-*)A) - COMPREPLY=( $( compgen -W '100baseT4 100baseTx-FD 100baseTx-HD - 10baseT-FD 10baseT-HD' -- "$cur" ) ) + --advertise | -!(-*)A) + COMPREPLY=($(compgen -W '100baseT4 100baseTx-FD 100baseTx-HD + 10baseT-FD 10baseT-HD' -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _available_interfaces -a fi } && -complete -F _mii_tool -o default mii-tool + complete -F _mii_tool -o default mii-tool # ex: filetype=sh diff --git a/completions/minicom b/completions/minicom index d85317fdb9d..44894d08d06 100644 --- a/completions/minicom +++ b/completions/minicom @@ -6,35 +6,36 @@ _minicom() _init_completion -s || return case $prev in - --attrib|--color|-!(-*)[ac]) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + --attrib | --color | -!(-*)[ac]) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) return ;; - --script|--capturefile|-!(-*)[SC]) + --script | --capturefile | -!(-*)[SC]) _filedir return ;; - --ptty|-!(-*)p) - COMPREPLY=( $( printf '%s\n' /dev/tty* ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' \ - -- "$cur" ) ) + --ptty | -!(-*)p) + COMPREPLY=(/dev/tty*) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}" "${COMPREPLY[@]#/dev/}}' \ + -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi COMPREPLY=( - $( printf '%s\n' /etc/minirc.* /etc/minicom/minirc.* ~/.minirc.* \ - | command sed -e '/\*$/d' -e 's/^.*minirc\.//' \ - | command grep "^${cur}" ) ) + $(printf '%s\n' /etc/minirc.* /etc/minicom/minirc.* ~/.minirc.* | + command sed -e '/\*$/d' -e 's/^.*minirc\.//' | + command grep "^${cur}")) } && -complete -F _minicom -o default minicom + complete -F _minicom -o default minicom # ex: filetype=sh diff --git a/completions/mkinitrd b/completions/mkinitrd index f0efb294574..bcb7e075173 100644 --- a/completions/mkinitrd +++ b/completions/mkinitrd @@ -6,11 +6,11 @@ _mkinitrd() _init_completion -s || return case $prev in - --preload|--with|--builtin) + --preload | --with | --builtin) _modules return ;; - --fstab|--dsdt) + --fstab | --dsdt) _filedir return ;; @@ -22,14 +22,14 @@ _mkinitrd() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version --help -v -f --preload \ + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--version --help -v -f --preload \ --force-scsi-probe --omit-scsi-modules \ --omit-ide-modules --image-version --force-raid-probe \ --omit-raid-modules --with= --force-lvm-probe \ --omit-lvm-modules --builtin --omit-dmraid --net-dev \ - --fstab --nocompress --dsdt --bootchart' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + --fstab --nocompress --dsdt --bootchart' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else local args _count_args @@ -45,6 +45,6 @@ _mkinitrd() fi } && -complete -F _mkinitrd mkinitrd + complete -F _mkinitrd mkinitrd # ex: filetype=sh diff --git a/completions/mktemp b/completions/mktemp index 6ee6c23f193..e063810da83 100644 --- a/completions/mktemp +++ b/completions/mktemp @@ -6,10 +6,10 @@ _mktemp() _init_completion -s || return case "$prev" in - --help|--version|--suffix) + --help | --version | --suffix) return ;; - --tmpdir|-!(-*)p) + --tmpdir | -!(-*)p) _filedir -d return ;; @@ -17,13 +17,13 @@ _mktemp() $split && return - if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) + if [[ $cur == -* ]]; then + local opts=$(_parse_help "$1") [[ $opts ]] || opts="-d -u -q -p -t" # non-GNU fallback - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W "$opts" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _mktemp mktemp + complete -F _mktemp mktemp # ex: filetype=sh diff --git a/completions/mmsitepass b/completions/mmsitepass index db1cbf74520..49daae619c1 100644 --- a/completions/mmsitepass +++ b/completions/mmsitepass @@ -5,11 +5,11 @@ _mmsitepass() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--listcreator --help' -- "$cur")) fi } && -complete -F _mmsitepass mmsitepass + complete -F _mmsitepass mmsitepass # ex: filetype=sh diff --git a/completions/modinfo b/completions/modinfo index a1f62e4d38f..4d4d835c4ab 100644 --- a/completions/modinfo +++ b/completions/modinfo @@ -6,43 +6,48 @@ _modinfo() _init_completion -s || return case "$prev" in - --field|-!(-*)F) - COMPREPLY=( $( compgen -W 'alias author depends description - filename firmware license parm srcversion staging vermagic - version' -- "${cur,,}" ) ) + --field | -!(-*)F) + COMPREPLY=($(compgen -W 'alias author depends description + filename firmware intree license name parm release_date + retpoline sig_hashalgo sig_key signat signer softdep srcversion + staging vermagic version' -- "${cur,,}")) return ;; - --set-version|-!(-*)k) + --set-version | -!(-*)k) _kernel_versions return ;; + --basedir | -!(-*)b) + _filedir -d + return + ;; esac $split && return - if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local i version=$(uname -r) - for (( i=${#words[@]}-1; i>0; i-- )); do + for ((i = ${#words[@]} - 1; i > 0; i--)); do if [[ ${words[i]} == -@(!(-*)k*|-set-version) ]]; then - version=${words[i+1]} + version=${words[i + 1]} break fi done # do filename completion if we're giving a path to a module - if [[ "$cur" == @(*/|[.~])* ]]; then - _filedir '@(?(k)o?(.gz))' + if [[ $cur == @(*/|[.~])* ]]; then + _filedir '@(?(k)o?(.[gx]z|.zst))' else _modules $version fi } && -complete -F _modinfo modinfo + complete -F _modinfo modinfo # ex: filetype=sh diff --git a/completions/modprobe b/completions/modprobe index db23240cb18..799ea197453 100644 --- a/completions/modprobe +++ b/completions/modprobe @@ -6,18 +6,18 @@ _modprobe() _init_completion -s || return case "$prev" in - --help|--version|-!(-*)[hV]) + --help | --version | -!(-*)[hV]) return ;; - --config|-!(-*)C) + --config | -!(-*)C) _filedir return ;; - --dirname|--type|-!(-*)[dt]) + --dirname | --type | -!(-*)[dt]) _filedir -d return ;; - --set-version|-!(-*)S) + --set-version | -!(-*)S) _kernel_versions return ;; @@ -25,44 +25,44 @@ _modprobe() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - if [[ ! $COMPREPLY ]]; then - COMPREPLY=( $( compgen -W '-a --all -b --use-blacklist -C --config + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + if [[ ! ${COMPREPLY-} ]]; then + COMPREPLY=($(compgen -W '-a --all -b --use-blacklist -C --config -c --showconfig --dump-modversions -d --dirname --first-time --force-vermagic --force-modversion -f --force -i --ignore-install --ignore-remove -l --list -n --dry-run -q --quiet -R --resolve-alias -r --remove -S --set-version --show-depends -s --syslog -t --type -V --version -v - --verbose' -- "$cur" ) ) + --verbose' -- "$cur")) fi - [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - local i mode=insert module= version=$(uname -r) - for (( i=1; i < $cword; i++ )); do + local i mode=insert module="" version=$(uname -r) + for ((i = 1; i < cword; i++)); do case "${words[i]}" in - --remove|-!(-*)r*) + --remove | -!(-*)r*) mode=remove ;; - --list|-!(-*)l*) + --list | -!(-*)l*) mode=list ;; --dump-modversions) - mode=file + mode="file" ;; - --set-version|-!(-*)S) - version=${words[i+1]} # -S is not $prev and not $cur + --set-version | -!(-*)S) + version=${words[i + 1]} # -S is not $prev and not $cur ;; - --config|--dirname|--type|-!(-*)[Cdt]) + --config | --dirname | --type | -!(-*)[Cdt]) ((i++)) # skip option and its argument ;; -*) # skip all other options ;; *) - [ -z "$module" ] && module=${words[i]} + [[ -z $module ]] && module=${words[i]} ;; esac done @@ -79,33 +79,45 @@ _modprobe() ;; insert) # do filename completion if we're giving a path to a module - if [[ "$cur" == @(*/|[.~])* ]]; then - _filedir '@(?(k)o?(.gz))' - elif [[ -n "$module" ]]; then + if [[ $cur == @(*/|[.~])* ]]; then + _filedir '@(?(k)o?(.[gx]z|.zst))' + elif [[ -n $module ]]; then # do module parameter completion - COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \ - -p "$module" 2>/dev/null | \ - awk -F: '!/^[ \t]/ { print $1 }' )" -- "$cur" ) ) + if [[ $cur == *=* ]]; then + prev=${cur%%=*} + cur=${cur#*=} + if PATH="$PATH:/sbin" modinfo -p "$module" 2>/dev/null | + command grep -q "^$prev:.*(bool)"; then + local choices="on off" + [[ $cur ]] && choices="1 0 y Y n N on off" + COMPREPLY=($(compgen -W "$choices" -- "$cur")) + fi + else + COMPREPLY=($(compgen -S = -W "$(PATH="$PATH:/sbin" \ + modinfo -p "$module" 2>/dev/null | + awk -F: '!/^[ \t]/ { print $1 }')" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + fi else _modules $version - if [[ $COMPREPLY ]]; then + if [[ ${COMPREPLY-} ]]; then # filter out already installed modules - local -a mods=( "${COMPREPLY[@]}" ) + local -a mods=("${COMPREPLY[@]}") _installed_modules "$cur" - for i in ${!mods[@]}; do - for module in ${COMPREPLY[@]}; do - if [[ ${mods[i]} == $module ]]; then - unset 'mods[i]' + for i in "${!mods[@]}"; do + for module in "${COMPREPLY[@]}"; do + if [[ ${mods[i]} == "$module" ]]; then + unset -v 'mods[i]' break fi done done - COMPREPLY=( "${mods[@]}" ) + COMPREPLY=("${mods[@]}") fi fi ;; esac } && -complete -F _modprobe modprobe + complete -F _modprobe modprobe # ex: filetype=sh diff --git a/completions/monodevelop b/completions/monodevelop index 13685dfb506..1c5b5ba4263 100644 --- a/completions/monodevelop +++ b/completions/monodevelop @@ -7,13 +7,13 @@ _monodevelop() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _filedir fi } && -complete -F _monodevelop monodevelop + complete -F _monodevelop monodevelop # ex: filetype=sh diff --git a/completions/mplayer b/completions/mplayer index 24ae787fef9..d0d2a2de2bc 100644 --- a/completions/mplayer +++ b/completions/mplayer @@ -3,9 +3,9 @@ _mplayer_options_list() { cur=${cur%\\} - COMPREPLY=( $( compgen -W "$( $1 -noconfig all $2 help 2>/dev/null | \ - command sed -e '/^Available/,/^$/!d' -e '/^Available/d' | awk '{print $1}' | \ - command sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 -noconfig all $2 help 2>/dev/null | + command sed -e '/^Available/,/^$/!d' -e '/^Available/d' | awk '{print $1}' | + command sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//')" -- "$cur")) } _mplayer() @@ -16,8 +16,8 @@ _mplayer() local cmd=${words[0]} i j k=0 case $prev in - -[av][cfo]|-[av]fm|-vop|-fstype|-demuxer|-o[av]c|-of|-profile| \ - -audio-demuxer|-sub-demuxer) + -[av][cfo] | -[av]fm | -vop | -fstype | -demuxer | -o[av]c | -of | -profile | \ + -audio-demuxer | -sub-demuxer) _mplayer_options_list $cmd $prev return ;; @@ -25,43 +25,45 @@ _mplayer() _mplayer_options_list $cmd -profile return ;; - -audiofile|-audio-file) + -audiofile | -audio-file) _filedir '@(mp3|mpg|og[ag]|w?(a)v|mid|flac|mka|ac3|ape)' return ;; - -font|-subfont) + -font | -subfont) if [[ $prev == -font ]]; then _filedir '@(desc|ttf)' else _filedir ttf fi local IFS=$'\n' - COMPREPLY+=( $( compgen -W '$( fc-list 2>/dev/null )' -- "$cur" ) ) + COMPREPLY+=($(compgen -W '$(fc-list 2>/dev/null)' -- "$cur")) return ;; - -sub|-sub-file) + -sub | -sub-file) _filedir '@(srt|sub|txt|utf|rar|mpsub|smi|js|ssa|ass)' return ;; -vobsub) _filedir '@(idx|ifo|sub)' local IFS=$'\n' - COMPREPLY=( $( for i in "${COMPREPLY[@]}"; do - if [[ -f $i && -r $i ]]; then - printf '%s\n' ${i%.*} - else - printf '%s\n' $i - fi - done ) ) + COMPREPLY=($(for i in "${COMPREPLY[@]}"; do + if [[ -f $i && -r $i ]]; then + printf '%s\n' ${i%.*} + else + printf '%s\n' $i + fi + done)) return ;; - -subcp|-msgcharset) + -subcp | -msgcharset) local cp - cp=( $( iconv --list 2>/dev/null | command sed -e "s@//@@;" 2>/dev/null ) ) - if [[ "$cur" == "${cur,,}" ]]; then - COMPREPLY=( $( compgen -W '${cp[@],,}' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W '${cp[@]^^}' -- "$cur" ) ) + cp=($(iconv --list 2>/dev/null | command sed -e "s@//@@;" 2>/dev/null)) + if ((${#cp[@]})); then + if [[ $cur == "${cur,,}" ]]; then + COMPREPLY=($(compgen -W '${cp[@],,}' -- "$cur")) + else + COMPREPLY=($(compgen -W '${cp[@]^^}' -- "$cur")) + fi fi return ;; @@ -84,11 +86,10 @@ _mplayer() fi local IFS=$'\n' - for i in ~/.mplayer/skins ${dirs[@]}; do + for i in ~/.mplayer/skins "${dirs[@]}"; do if [[ -d $i && -r $i ]]; then - for j in $( compgen -d -- $i/$cur ); do - COMPREPLY[$k]=${j#$i/} - k=$((++k)) + for j in $(compgen -d -- $i/$cur); do + COMPREPLY[k++]=${j#"$i/"} done fi done @@ -108,53 +109,52 @@ _mplayer() _filedir -d return ;; - -mixer|-dvdauth|-fb|-zrdev) + -mixer | -dvdauth | -fb | -zrdev) cur=${cur:=/dev/} _filedir return ;; - -edl|-edlout|-lircconf|-menu-cfg|-playlist|-csslib|-dumpfile| \ - -subfile|-vobsub|-aofile|-fbmodeconfig|-include|-o|-dvdkey| \ - -passlogfile) + -edl | -edlout | -lircconf | -menu-cfg | -playlist | -csslib | -dumpfile | \ + -subfile | -aofile | -fbmodeconfig | -include | -o | -dvdkey | -passlogfile) _filedir return ;; - -autoq|-autosync|-loop|-menu-root|-speed|-sstep|-aid|-alang| \ - -bandwidth|-bluray-angle|-bluray-chapter|-cache|-chapter|-dvd-speed| \ - -dvdangle|-fps|-frames|-mc|-passwd|-user|-sb|-srate|-ss|-vcd| \ - -vi|-vid|-vivo|-ffactor|-sid|-slang|-spualign|-spuaa|-spugauss| \ - -vobsubid|-delay|-bpp|-brightness|-contrast|-dfbopts|-display| \ - -fbmode|-geometry|-guiwid|-hue|-icelayer|-screen[wh]|-wid| \ - -monitor-dotclock|-monitor-[hv]freq|-panscan| \ - -saturation|-xineramascreen|-zrcrop|-zrnorm|-zrquality| \ - -zr[xy]doff|-zr[vh]dec|-pp|-x|-y|-xy|-z|-stereo| \ - -audio-density|-audio-delay|-audio-preload|-endpos|-osdlevel| \ - -ffourcc|-sws|-skiplimit|-format|-ofps|-aadriver| \ - -aaosdcolor|-aasubcolor|-vobsubout|-vobsuboutid|-vobsuboutindex| \ - -sub-bg-alpha|-sub-bg-color|-subdelay|-subfps|-subpos| \ - -subalign|-subwidth|-subfont-blur|-subfont-outline| \ - -subfont-autoscale|-subfont-encoding|-subfont-osd-scale| \ - -subfont-text-scale) + -autoq | -autosync | -loop | -menu-root | -speed | -sstep | -aid | -alang | \ + -bandwidth | -bluray-angle | -bluray-chapter | -cache | -chapter | -dvd-speed | \ + -dvdangle | -fps | -frames | -mc | -passwd | -user | -sb | -srate | -ss | -vcd | \ + -vi | -vid | -vivo | -ffactor | -sid | -slang | -spualign | -spuaa | -spugauss | \ + -vobsubid | -delay | -bpp | -brightness | -contrast | -dfbopts | -display | \ + -fbmode | -geometry | -guiwid | -hue | -icelayer | -screen[wh] | -wid | \ + -monitor-dotclock | -monitor-[hv]freq | -panscan | \ + -saturation | -xineramascreen | -zrcrop | -zrnorm | -zrquality | \ + -zr[xy]doff | -zr[vh]dec | -pp | -x | -y | -xy | -z | -stereo | \ + -audio-density | -audio-delay | -audio-preload | -endpos | -osdlevel | \ + -ffourcc | -sws | -skiplimit | -format | -ofps | -aadriver | \ + -aaosdcolor | -aasubcolor | -vobsubout | -vobsuboutid | -vobsuboutindex | \ + -sub-bg-alpha | -sub-bg-color | -subdelay | -subfps | -subpos | \ + -subalign | -subwidth | -subfont-blur | -subfont-outline | \ + -subfont-autoscale | -subfont-encoding | -subfont-osd-scale | \ + -subfont-text-scale) return ;; -channels) - COMPREPLY=( $( compgen -W '2 4 6 8' -- "$cur" ) ) + COMPREPLY=($(compgen -W '2 4 6 8' -- "$cur")) return ;; - -aspect|-monitoraspect) - COMPREPLY=( $( compgen -W '1:1 3:2 4:3 5:4 14:9 14:10 16:9 16:10 - 2.35:1' -- "$cur" ) ) + -aspect | -monitoraspect) + COMPREPLY=($(compgen -W '1:1 3:2 4:3 5:4 14:9 14:10 16:9 16:10 + 2.35:1' -- "$cur")) __ltrim_colon_completions "$cur" return ;; -lavdopts) - COMPREPLY=( $( compgen -W 'bitexact bug= debug= ec= er= fast gray + COMPREPLY=($(compgen -W 'bitexact bug= debug= ec= er= fast gray idct= lowres= sb= st= skiploopfilter= skipidct= skipframe= - threads= vismv= vstats' -- "$cur" ) ) + threads= vismv= vstats' -- "$cur")) return ;; -lavcopts) - COMPREPLY=( $( compgen -W 'vcodec= vqmin= vqscale= vqmax= mbqmin= + COMPREPLY=($(compgen -W 'vcodec= vqmin= vqscale= vqmax= mbqmin= mbqmax= vqdiff= vmax_b_frames= vme= vhq v4mv keyint= vb_strategy= vpass= aspect= vbitrate= vratetol= vrc_maxrate= vrc_minrate= vrc_buf_size= vb_qfactor= vi_qfactor= vb_qoffset= @@ -163,121 +163,120 @@ _mplayer() vpsize= gray vfdct= idct= lumi_mask= dark_mask= tcplx_mask= scplx_mask= naq ildct format= pred qpel precmp= cmp= subcmp= predia= dia= trell last_pred= preme= subq= psnr mpeg_quant aic - umv' -- "$cur" ) ) + umv' -- "$cur")) return ;; -ssf) - COMPREPLY=( $( compgen -W 'lgb= cgb= ls= cs= chs= cvs=' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'lgb= cgb= ls= cs= chs= cvs=' -- "$cur")) return ;; -jpeg) - COMPREPLY=( $( compgen -W 'noprogressive progressive nobaseline - baseline optimize= smooth= quality= outdir=' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'noprogressive progressive nobaseline + baseline optimize= smooth= quality= outdir=' -- "$cur")) return ;; -xvidopts) - COMPREPLY=( $( compgen -W 'dr2 nodr2' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'dr2 nodr2' -- "$cur")) return ;; -xvidencopts) - COMPREPLY=( $( compgen -W 'pass= bitrate= fixed_quant= me_quality= + COMPREPLY=($(compgen -W 'pass= bitrate= fixed_quant= me_quality= 4mv rc_reaction_delay_factor= rc_averaging_period= rc_buffer= quant_range= min_key_interval= max_key_interval= mpeg_quant mod_quant lumi_mask hintedme hintfile debug keyframe_boost= - kfthreshold= kfreduction=' -- "$cur" ) ) + kfthreshold= kfreduction=' -- "$cur")) return ;; -divx4opts) - COMPREPLY=( $( compgen -W 'br= key= deinterlace q= min_quant= + COMPREPLY=($(compgen -W 'br= key= deinterlace q= min_quant= max_quant= rc_period= rc_reaction_period= crispness= - rc_reaction_ratio= pass= vbrpass= help' -- "$cur" ) ) + rc_reaction_ratio= pass= vbrpass= help' -- "$cur")) return ;; -info) - COMPREPLY=( $( compgen -W 'name= artist= genre= subject= - copyright= srcform= comment= help' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'name= artist= genre= subject= + copyright= srcform= comment= help' -- "$cur")) return ;; -lameopts) - COMPREPLY=( $( compgen -W 'vbr= abr cbr br= q= aq= ratio= vol= - mode= padding= fast preset= help' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'vbr= abr cbr br= q= aq= ratio= vol= + mode= padding= fast preset= help' -- "$cur")) return ;; -rawaudio) - COMPREPLY=( $( compgen -W 'on channels= rate= samplesize= format=' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on channels= rate= samplesize= format=' \ + -- "$cur")) return ;; -rawvideo) - COMPREPLY=( $( compgen -W 'on fps= sqcif qcif cif 4cif pal ntsc w= - h= y420 yv12 yuy2 y8 format= size=' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on fps= sqcif qcif cif 4cif pal ntsc w= + h= y420 yv12 yuy2 y8 format= size=' -- "$cur")) return ;; -aop) - COMPREPLY=( $( compgen -W 'list= delay= format= fout= volume= mul= - softclip' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'list= delay= format= fout= volume= mul= + softclip' -- "$cur")) return ;; -dxr2) - COMPREPLY=( $( compgen -W 'ar-mode= iec958-encoded iec958-decoded + COMPREPLY=($(compgen -W 'ar-mode= iec958-encoded iec958-decoded mute ucode= 75ire bw color interlaced macrovision= norm= square-pixel ccir601-pixel cr-left= cr-right= cr-top= cr-bot= ck-rmin= ck-gmin= ck-bmin= ck-rmax= ck-gmax= ck-bmax= ck-r= ck-g= ck-b= ignore-cache= ol-osd= olh-cor= olw-cor= olx-cor= - oly-cor= overlay overlay-ratio= update-cache' -- "$cur" ) ) + oly-cor= overlay overlay-ratio= update-cache' -- "$cur")) return ;; -tv) - COMPREPLY=( $( compgen -W 'on noaudio driver= device= input= freq= + COMPREPLY=($(compgen -W 'on noaudio driver= device= input= freq= outfmt= width= height= buffersize= norm= channel= chanlist= audiorate= forceaudio alsa amode= forcechan= adevice= audioid= volume= bass= treble= balance= fps= channels= immediatemode=' \ - -- "$cur" ) ) + -- "$cur")) return ;; -mf) - COMPREPLY=( $( compgen -W 'on w= h= fps= type=' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on w= h= fps= type=' -- "$cur")) return ;; -cdda) - COMPREPLY=( $( compgen -W 'speed= paranoia= generic-dev= + COMPREPLY=($(compgen -W 'speed= paranoia= generic-dev= sector-size= overlap= toc-bias toc-offset= skip noskip' \ - -- "$cur" ) ) + -- "$cur")) return ;; -input) - COMPREPLY=( $( compgen -W 'conf= ar-delay ar-rate keylist cmdlist - js-dev file' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'conf= ar-delay ar-rate keylist cmdlist + js-dev file' -- "$cur")) return ;; -af-adv) - COMPREPLY=( $( compgen -W 'force= list=' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'force= list=' -- "$cur")) return ;; -noconfig) - COMPREPLY=( $( compgen -W 'all gui system user' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'all gui system user' -- "$cur")) return ;; -*) # Assume arg is required for everything else except options # for which -list-options says Type is Flag or Print. - $cmd -noconfig all -list-options 2>/dev/null \ - | while read -r i j k; do - if [[ $i == ${prev#-} ]]; then - [[ ${j,,} != @(flag|print) ]] && return 1 - break - fi - done || return + $cmd -noconfig all -list-options 2>/dev/null | + while read -r i j k; do + if [[ $i == "${prev#-}" ]]; then + [[ ${j,,} != @(flag|print) ]] && return 1 + break + fi + done || return ;; esac case $cur in -*) - COMPREPLY=( $( compgen -W '$( $cmd -noconfig all -list-options 2>/dev/null | \ - command sed -ne '1,/^[[:space:]]*Name/d' \ + COMPREPLY=($(compgen -W '$($cmd -noconfig all -list-options 2>/dev/null | \ + command sed -ne "1,/^[[:space:]]*Name/d" \ -e "s/^[[:space:]]*/-/" -e "s/[[:space:]:].*//" \ - -e "/^-\(Total\|.*\*\)\{0,1\}$/!p" )' -- "$cur" ) ) + -e "/^-\(Total\|.*\*\)\{0,1\}$/!p")' -- "$cur")) ;; *) _filedir '@(m?(j)p?(e)g|M?(J)P?(E)G|wm[av]|WM[AV]|avi|AVI|asf|ASF|vob|VOB|bin|BIN|dat|DAT|vcd|VCD|ps|PS|pes|PES|fl[iv]|FL[IV]|fxm|FXM|viv|VIV|rm?(j)|RM?(J)|ra?(m)|RA?(M)|yuv|YUV|mov|MOV|qt|QT|mp[234]|MP[234]|m?(p)4[av]|M?(P)4[AV]|og[gmavx]|OG[GMAVX]|w?(a)v|W?(A)V|dump|DUMP|mk[av]|MK[AV]|aac|AAC|m2v|M2V|dv|DV|rmvb|RMVB|mid|MID|t[ps]|T[PS]|3g[p2]|3gpp?(2)|mpc|MPC|flac|FLAC|vro|VRO|divx|DIVX|aif?(f)|AIF?(F)|m2t?(s)|M2T?(S)|mts|MTS|vdr|VDR|xvid|XVID|ape|APE|gif|GIF|nut|NUT|bik|BIK|web[am]|WEB[AM]|amr|AMR|awb|AWB|iso|ISO|opus|OPUS|m[eo]d|M[EO]D|xm|XM|it|IT|s[t3]m|S[T3]M|mtm|MTM|w64|W64)?(.@(crdownload|part))' @@ -285,6 +284,6 @@ _mplayer() esac } && -complete -F _mplayer mplayer mplayer2 mencoder gmplayer kplayer + complete -F _mplayer mplayer mplayer2 mencoder gmplayer kplayer # ex: filetype=sh diff --git a/completions/mr b/completions/mr index 8693b38124d..930e3c960ee 100644 --- a/completions/mr +++ b/completions/mr @@ -1,6 +1,7 @@ # mr completion -*- shell-script -*- -_mr() { +_mr() +{ local cur prev words cword _init_completion || return @@ -8,7 +9,11 @@ _mr() { help="$(PERLDOC_PAGER=cat PERLDOC=-otext "${1}" help 2>/dev/null)" - commands="$(awk '/\[options\]/ { print $3 }' <<<"${help}")" + commands="$( + printf %s "$help" | while read -r _ options cmd _; do + [[ $options != "[options]" ]] || printf "%s\n" "$cmd" + done + )" # Split [online|offline] and remove `action` placeholder. commands="${commands//@(action|[\[\|\]])/$'\n'}" # Add standard aliases. @@ -17,7 +22,7 @@ _mr() { # Determine if user has entered an `mr` command. Used to block top-level # (option and command) completions. local cmd i - for (( i=0; i < ${#words[@]}-1; i++ )); do + for ((i = 1; i < ${#words[@]} - 1; i++)); do if [[ $commands == *"${words[i]}"* ]]; then cmd="${words[i]}" break @@ -25,30 +30,30 @@ _mr() { done # Complete options for specific commands. - if [[ -n $cmd ]]; then + if [[ -v cmd ]]; then case $cmd in bootstrap) _filedir # Also complete stdin (-) as a potential bootstrap source. - if [[ -z "${cur}" || $cur == - ]] && [[ $prev != - ]]; then - COMPREPLY+=( - ) + if [[ -z ${cur} || $cur == - ]] && [[ $prev != - ]]; then + COMPREPLY+=(-) fi return ;; clean) - if [[ "${cur}" == -* ]]; then - COMPREPLY=( $( compgen -W '-f' -- "${cur}" ) ) + if [[ ${cur} == -* ]]; then + COMPREPLY=($(compgen -W '-f' -- "${cur}")) fi return ;; - commit|ci|record) - if [[ "${cur}" == -* ]]; then - COMPREPLY=( $( compgen -W '-m' -- "${cur}" ) ) + commit | ci | record) + if [[ ${cur} == -* ]]; then + COMPREPLY=($(compgen -W '-m' -- "${cur}")) fi return ;; run) - COMPREPLY=( $( compgen -c -- "${cur}" ) ) + COMPREPLY=($(compgen -c -- "${cur}")) return ;; *) @@ -60,27 +65,27 @@ _mr() { # Complete top-level options and commands. case $prev in - --config|-!(-*)c) + --config | -!(-*)c) _filedir return ;; - --directory|-!(-*)d) + --directory | -!(-*)d) _filedir -d return ;; esac if [[ $cur == -* ]]; then - options="$(_parse_help - <<<"${help}")" + options="$(printf '%s\n' "$help" | _parse_help -)" # Remove short options (all have compatible long options). options="${options//-[a-z]$'\n'/}" # Remove deprecated options. options="${options//--path/}" - COMPREPLY=( $( compgen -W "${options}" -- "${cur}" ) ) + COMPREPLY=($(compgen -W "${options}" -- "${cur}")) else - COMPREPLY=( $( compgen -W "${commands}" -- "${cur}" ) ) + COMPREPLY=($(compgen -W "${commands}" -- "${cur}")) fi } && -complete -F _mr mr + complete -F _mr mr # ex: filetype=sh diff --git a/completions/msynctool b/completions/msynctool index 3eae1dfad9e..4de37f5b099 100644 --- a/completions/msynctool +++ b/completions/msynctool @@ -7,36 +7,36 @@ _msynctool() case $words in --configure) - COMPREPLY=( $( compgen -W "$($1 --showgroup \ + COMPREPLY=($(compgen -W "$($1 --showgroup \ $prev | awk '/^Member/ {print $2}' | command sed \ - -e 's/:$//' )" -- "$cur" ) ) + -e 's/:$//')" -- "$cur")) return ;; --addmember) - COMPREPLY=( $( compgen -W '$($1 --listplugins \ - | command sed -e '1d' )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$($1 --listplugins \ + | command sed -e 1d)' -- "$cur")) return ;; esac case $prev in - --configure|--addgroup|--delgroup|--showgroup|--sync|--addmember) - COMPREPLY=( $( compgen -W '$($1 --listgroups \ - | command sed -e '1d' )' -- "$cur" ) ) + --configure | --addgroup | --delgroup | --showgroup | --sync | --addmember) + COMPREPLY=($(compgen -W '$($1 --listgroups \ + | command sed -e 1d)' -- "$cur")) return ;; - --showformats|--filter-objtype|--slow-sync) - COMPREPLY=( $( compgen -W '$($1 --listobjects \ - | command sed -e '1d' )' -- "$cur" ) ) + --showformats | --filter-objtype | --slow-sync) + COMPREPLY=($(compgen -W '$($1 --listobjects \ + | command sed -e 1d)' -- "$cur")) return ;; esac - COMPREPLY=( $( compgen -W '--listgroups --listplugins --listobjects + COMPREPLY=($(compgen -W '--listgroups --listplugins --listobjects --showformats --showgroup --sync --filter-objtype --slow-sync --wait --multi --addgroup --delgroup --addmember --configure --manual - --configdir --conflict' -- "$cur" ) ) + --configdir --conflict' -- "$cur")) } && -complete -F _msynctool msynctool + complete -F _msynctool msynctool # ex: filetype=sh diff --git a/completions/mtx b/completions/mtx index c52c6173e65..b5c270bd9f5 100644 --- a/completions/mtx +++ b/completions/mtx @@ -11,22 +11,22 @@ _mtx() options="-f nobarcode invert noattach --version inquiry noattach \ inventory status load unload eepos first last next" - tapes=$(mtx status 2>/dev/null | \ + tapes=$(mtx status 2>/dev/null | awk '/Storage Element [0-9]+:Full/ { printf "%s ", $3 }') - tapes=${tapes//:Full} + tapes=${tapes//:Full/} - drives=$(mtx status 2>/dev/null | \ + drives=$(mtx status 2>/dev/null | awk '/Data Transfer Element [0-9]+:(Full|Empty)/ { printf "%s ", $4 }') - drives=${drives//:Full} - drives=${drives//:Empty} + drives=${drives//:Full/} + drives=${drives//:Empty/} - if [[ $cword -gt 1 ]]; then + if ((cword > 1)); then case $prev in load) - COMPREPLY=( $( compgen -W "$tapes" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$tapes" -- "$cur")) ;; - unload|first|last|next) - COMPREPLY=( $( compgen -W "$drives" -- "$cur" ) ) + unload | first | last | next) + COMPREPLY=($(compgen -W "$drives" -- "$cur")) ;; -f) true @@ -36,9 +36,9 @@ _mtx() ;; esac else - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) fi } && -complete -F _mtx mtx + complete -F _mtx mtx # ex: filetype=sh diff --git a/completions/munin-node-configure b/completions/munin-node-configure index a202172779b..39d8d64bf39 100644 --- a/completions/munin-node-configure +++ b/completions/munin-node-configure @@ -10,7 +10,7 @@ _munin_node_configure() _filedir return ;; - --servicedir|--libdir) + --servicedir | --libdir) _filedir -d return ;; @@ -19,15 +19,15 @@ _munin_node_configure() return ;; --snmpversion) - COMPREPLY=( $( compgen -W '1 2c 3' -- "$cur" ) ) + COMPREPLY=($(compgen -W '1 2c 3' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _munin_node_configure munin-node-configure + complete -F _munin_node_configure munin-node-configure # ex: filetype=sh diff --git a/completions/munin-run b/completions/munin-run index 72228522a3b..97e526aae12 100644 --- a/completions/munin-run +++ b/completions/munin-run @@ -6,23 +6,23 @@ _munin_run() _init_completion || return case $prev in - --config|--sconffile) + --config | --sconffile) _filedir return ;; - --servicedir|--sconfdir) + --servicedir | --sconfdir) _filedir -d return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else - COMPREPLY=( $( compgen -W \ - '$( command ls /etc/munin/plugins 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + '$(command ls /etc/munin/plugins 2>/dev/null)' -- "$cur")) fi } && -complete -F _munin_run munin-run + complete -F _munin_run munin-run # ex: filetype=sh diff --git a/completions/munin-update b/completions/munin-update index ef8bf5b52cb..8766eaee2eb 100644 --- a/completions/munin-update +++ b/completions/munin-update @@ -16,12 +16,12 @@ _munin_update() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--force-root --noforce-root --service --host + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--force-root --noforce-root --service --host --config --help --debug --nodebug --fork --nofork --stdout - --nostdout --timeout' -- "$cur" ) ) + --nostdout --timeout' -- "$cur")) fi } && -complete -F _munin_update munin-update + complete -F _munin_update munin-update # ex: filetype=sh diff --git a/completions/munindoc b/completions/munindoc index f603d87b6a1..5c7644a6918 100644 --- a/completions/munindoc +++ b/completions/munindoc @@ -5,9 +5,9 @@ _munindoc() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W \ - '$( command ls /usr/share/munin/plugins 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + '$(command ls /usr/share/munin/plugins 2>/dev/null)' -- "$cur")) } && -complete -F _munindoc munindoc + complete -F _munindoc munindoc # ex: filetype=sh diff --git a/completions/mussh b/completions/mussh index 185f9d30952..c2f7a52200b 100644 --- a/completions/mussh +++ b/completions/mussh @@ -6,47 +6,47 @@ _mussh() _init_completion || return case $prev in - --help|-V|-m|-t) + --help | -V | -m | -t) return ;; -d) - COMPREPLY=( $( compgen -W '{0..2}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..2}' -- "$cur")) return ;; -v) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) return ;; - -i|-H|-C) + -i | -H | -C) _filedir return ;; - -o|-po) + -o | -po) _xfunc ssh _ssh_options return ;; - -l|-L) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + -l | -L) + COMPREPLY=($(compgen -u -- "$cur")) return ;; -s) _shells return ;; - -p|-h) + -p | -h) [[ $cur == *@* ]] && _user_at_host || _known_hosts_real -a -- "$cur" return ;; -c) compopt -o filenames - COMPREPLY+=( $( compgen -c -- "$cur" ) ) + COMPREPLY+=($(compgen -c -- "$cur")) return ;; esac - [[ $cur != -* ]] || \ - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $cur != -* ]] || + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) } && -complete -F _mussh mussh + complete -F _mussh mussh # ex: filetype=sh diff --git a/completions/mutt b/completions/mutt index c16b5871c69..35b749b8be7 100644 --- a/completions/mutt +++ b/completions/mutt @@ -9,19 +9,18 @@ _muttaddr() _muttaliases "$1" _muttquery "$1" - COMPREPLY+=( $( compgen -u -- "$1" ) ) + COMPREPLY+=($(compgen -u -- "$1")) } - # Find muttrc to use # @output muttrc filename _muttrc() { # Search COMP_WORDS for '-F muttrc' or '-Fmuttrc' argument set -- "${words[@]}" - while [[ $# -gt 0 ]]; do + while (($# > 0)); do if [[ $1 == -F* ]]; then - if [[ ${#1} -gt 2 ]]; then + if ((${#1} > 2)); then muttrc="$(dequote "${1:2}")" else shift @@ -32,17 +31,16 @@ _muttrc() shift done - if [[ -z $muttrc ]]; then + if [[ ! -v muttrc ]]; then if [[ -f ~/.${muttcmd}rc ]]; then - muttrc="~/.${muttcmd}rc" + muttrc=\~/.${muttcmd}rc elif [[ -f ~/.${muttcmd}/${muttcmd}rc ]]; then - muttrc="~/.${muttcmd}/${muttcmd}rc" + muttrc=\~/.${muttcmd}/${muttcmd}rc fi fi - printf "%s" "$muttrc" + printf "%s" "${muttrc-}" } - # Recursively build list of sourced config files # @param $1 List of config files found so far # @param $2 Config file to process @@ -54,11 +52,11 @@ _muttconffiles() sofar=" $1 " shift - while [[ "$1" ]]; do - newconffiles=( $(command sed -n 's|^source[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' $(eval printf %s $1) ) ) - for file in "${newconffiles[@]}"; do + while [[ ${1-} ]]; do + newconffiles=($(command sed -n 's|^source[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' "$(eval printf %s $1)")) + for file in ${newconffiles+"${newconffiles[@]}"}; do __expand_tilde_by_ref file - [[ ! -f "$file" || $sofar == *\ $file\ * ]] && continue + [[ ! -f $file || $sofar == *\ $file\ * ]] && continue sofar+=" $file" sofar=" $(eval _muttconffiles \"$sofar\" $file) " done @@ -67,7 +65,6 @@ _muttconffiles() printf '%s\n' $sofar } - # @param $1 (cur) Current word to complete _muttaliases() { @@ -77,32 +74,31 @@ _muttaliases() muttrc=$(_muttrc) [[ -z $muttrc ]] && return - conffiles=( $(eval _muttconffiles $muttrc $muttrc) ) - aliases=( $( command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \ - $(eval echo "${conffiles[@]}") ) ) - COMPREPLY+=( $( compgen -W "${aliases[*]}" -- "$cur" ) ) + conffiles=($(eval _muttconffiles $muttrc $muttrc)) + # shellcheck disable=SC2046 + aliases=("$(command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \ + "${conffiles[@]}")") + COMPREPLY+=($(compgen -W "${aliases[*]}" -- "$cur")) } - # @param $1 (cur) Current word to complete _muttquery() { local cur=$1 querycmd muttcmd=${words[0]} local -a queryresults - querycmd="$( $muttcmd -Q query_command 2>/dev/null | command sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'$cur'|' )" - if [[ -z "$cur" || -z "$querycmd" ]]; then + querycmd="$($muttcmd -Q query_command 2>/dev/null | command sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'$cur'|')" + if [[ -z $cur || -z $querycmd ]]; then queryresults=() else __expand_tilde_by_ref querycmd - queryresults=( $( $querycmd | \ - command sed -n '2,$s|^\([^[:space:]]\{1,\}\).*|\1|p' ) ) + queryresults=($($querycmd | + command sed -n '2,$s|^\([^[:space:]]\{1,\}\).*|\1|p')) fi - COMPREPLY+=( $( compgen -W "${queryresults[*]}" -- "$cur" ) ) + COMPREPLY+=($(compgen -W "${queryresults[*]}" -- "$cur")) } - # @param $1 (cur) Current word to complete _muttfiledir() { @@ -110,56 +106,55 @@ _muttfiledir() muttrc=$(_muttrc) if [[ $cur == [=+]* ]]; then - folder="$( $muttcmd -F "$muttrc" -Q folder 2>/dev/null | command sed -e 's|^folder=\"\(.*\)\"$|\1|' )" + folder="$($muttcmd -F "$muttrc" -Q folder 2>/dev/null | command sed -e 's|^folder=\"\(.*\)\"$|\1|')" : folder:=~/Mail # Match any file in $folder beginning with $cur # (minus the leading '=' sign). compopt -o filenames - COMPREPLY=( $( compgen -f -- "$folder/${cur:1}" ) ) - COMPREPLY=( ${COMPREPLY[@]#$folder/} ) + COMPREPLY=($(compgen -f -- "$folder/${cur:1}")) + COMPREPLY=(${COMPREPLY[@]#$folder/}) return elif [[ $cur == !* ]]; then - spoolfile="$( $muttcmd -F "$muttrc" -Q spoolfile 2>/dev/null | \ - command sed -e 's|^spoolfile=\"\(.*\)\"$|\1|' )" - [[ ! -z $spoolfile ]] && eval cur="${cur/^!/$spoolfile}" + spoolfile="$($muttcmd -F "$muttrc" -Q spoolfile 2>/dev/null | + command sed -e 's|^spoolfile=\"\(.*\)\"$|\1|')" + [[ -n $spoolfile ]] && eval cur="${cur/^!/$spoolfile}" fi _filedir } - _mutt() { local cur prev words cword _init_completion -n =+! || return case $cur in - -*) - COMPREPLY=( $( compgen -W '-A -a -b -c -e -f -F -H -i -m -n -p -Q -R -s - -v -x -y -z -Z -h' -- "$cur" ) ) - return - ;; - *) - case $prev in - -*[afFHi]) - _muttfiledir "$cur" - return - ;; - -*A) - _muttaliases "$cur" - return - ;; - -*[emQshpRvyzZ]) + -*) + COMPREPLY=($(compgen -W '-A -a -b -c -e -f -F -H -i -m -n -p -Q -R -s + -v -x -y -z -Z -h' -- "$cur")) return ;; *) - _muttaddr "$cur" - return + case $prev in + -*[afFHi]) + _muttfiledir "$cur" + return + ;; + -*A) + _muttaliases "$cur" + return + ;; + -*[emQshpRvyzZ]) + return + ;; + *) + _muttaddr "$cur" + return + ;; + esac ;; - esac - ;; esac } && -complete -F _mutt -o default mutt muttng + complete -F _mutt -o default mutt muttng neomutt # ex: filetype=sh diff --git a/completions/mypy b/completions/mypy index fa9cbff64c7..2785d73f6e3 100644 --- a/completions/mypy +++ b/completions/mypy @@ -5,12 +5,13 @@ _mypy() local cur prev words cword split _init_completion -s || return - [[ $cword -gt 2 && ${words[cword-2]} == --shadow-file ]] && \ - prev=--shadow-file # hack; takes two args + [[ $cword -gt 2 && ${words[cword - 2]} == --shadow-file ]] && + prev=--shadow-file # hack; takes two args case $prev in - --help|--version|--python-version|--platform|--always-true|\ - --always-false|--find-occurrences|--package|--command|-!(-*)[hVpc]) + --help | --version | --python-version | --platform | --always-true | \ + --always-false | --@(dis|en)able-error-code | --find-occurrences | \ + --exclude | --package | --command | -!(-*)[hVpc]) return ;; --config-file) @@ -18,18 +19,18 @@ _mypy() return ;; --follow-imports) - COMPREPLY=( $( compgen -W 'normal silent skip error' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'normal silent skip error' -- "$cur")) return ;; --python-executable) - COMPREPLY=( $( compgen -c -- "${cur:-py}" ) ) + COMPREPLY=($(compgen -c -- "${cur:-py}")) return ;; - --*-dir|--*-report) + --*-dir | --*-report) _filedir -d return ;; - --custom-typing|--module|-!(-*)m) + --custom-typing-module | --module | -!(-*)m) _xfunc python _python_modules return ;; @@ -43,13 +44,15 @@ _mypy() ;; esac + $split && return + if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _filedir '@(py|pyi)' } && -complete -F _mypy mypy + complete -F _mypy mypy # ex: filetype=sh diff --git a/completions/mysql b/completions/mysql index 55fbb0593b2..dcbe3edf359 100644 --- a/completions/mysql +++ b/completions/mysql @@ -2,12 +2,15 @@ _mysql_character_sets() { - local IFS=$' \t\n' reset=$( shopt -p failglob ); shopt -u failglob - local -a charsets=( /usr/share/m{ariadb,ysql}/charsets/*.xml ) + local IFS=$' \t\n' reset=$(shopt -p failglob) + shopt -u failglob + local -a charsets=(/usr/share/m{ariadb,ysql}/charsets/*.xml) $reset - charsets=( "${charsets[@]##*/}" ) - charsets=( "${charsets[@]%%?(Index|\*).xml}" utf8 ) - COMPREPLY+=( $( compgen -W '${charsets[@]}' -- "$cur" ) ) + if ((${#charsets[@]})); then + charsets=("${charsets[@]##*/}") + charsets=("${charsets[@]%%?(Index|\*).xml}" utf8) + COMPREPLY+=($(compgen -W '${charsets[@]}' -- "$cur")) + fi } _mysql() @@ -16,16 +19,16 @@ _mysql() _init_completion -s || return case $prev in - --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + --user | -!(-*)u) + COMPREPLY=($(compgen -u -- "$cur")) return ;; - --database|-!(-*)D) - COMPREPLY=( $( compgen -W "$(mysqlshow 2>/dev/null | command sed -ne '2d' -e 's/^|.\([^|]*\)|.*/\1/p')" -- "$cur" ) ) + --database | -!(-*)D) + COMPREPLY=($(compgen -W "$(mysqlshow 2>/dev/null | command sed -ne '2d' -e 's/^|.\([^|]*\)|.*/\1/p')" -- "$cur")) return ;; - --host|-!(-*)h) + --host | -!(-*)h) _known_hosts_real -- "$cur" return ;; @@ -34,23 +37,23 @@ _mysql() return ;; - --character-sets-dir|--ssl-capath) + --character-sets-dir | --ssl-capath) _filedir -d return ;; - --socket|-!(-*)S) + --socket | -!(-*)S) _filedir sock return ;; --protocol) - COMPREPLY=( $( compgen -W 'tcp socket pipe memory' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'tcp socket pipe memory' -- "$cur")) return ;; - --defaults-file|--defaults-extra-file|--tee) + --defaults-file | --defaults-extra-file | --tee) _filedir return ;; - --ssl-ca|--ssl-cert) + --ssl-ca | --ssl-cert) _filedir '@(pem|cer|c?(e)rt)' return ;; @@ -58,39 +61,41 @@ _mysql() _filedir '@(pem|key)' return ;; - --port|--set-variable|--ssl-cipher|--connect_timeout|\ - --max_allowed_packet|--prompt|--net_buffer_length|--select_limit|\ - --max_join_size|--server-arg|--debug|--delimiter|--execute|--pager|\ - -!(-*)[Pe]) + --port | --set-variable | --ssl-cipher | --connect_timeout | \ + --max_allowed_packet | --prompt | --net_buffer_length | --select_limit | \ + --max_join_size | --server-arg | --debug | --delimiter | --execute | --pager | \ + -!(-*)[Pe]) return ;; - --help|--version|-!(-*)[?IV]) + --help | --version | -!(-*)[?IV]) return ;; esac + $split && return + case $cur in --*) local help=$(_parse_help "$1") help+=" --skip-comments --skip-ssl" - COMPREPLY=( $( compgen -W "$help" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W "$help" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; # only complete long options -) compopt -o nospace - COMPREPLY=( -- ) + COMPREPLY=(--) return ;; esac - COMPREPLY=( $( compgen -W \ + COMPREPLY=($(compgen -W \ "$(mysqlshow 2>/dev/null | command sed -ne '2d' -e 's/^|.\([^|]*\)|.*/\1/p')" \ - -- "$cur" ) ) + -- "$cur")) } && -complete -F _mysql mysql + complete -F _mysql mysql # ex: filetype=sh diff --git a/completions/mysqladmin b/completions/mysqladmin index 438db84c498..5329534014f 100644 --- a/completions/mysqladmin +++ b/completions/mysqladmin @@ -6,15 +6,15 @@ _mysqladmin() _init_completion -s || return case $prev in - --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + --user | -!(-*)u) + COMPREPLY=($(compgen -u -- "$cur")) return ;; - --host|-!(-*)h) + --host | -!(-*)h) _known_hosts_real -- "$cur" return ;; - --character-sets-dir|--ssl-capath) + --character-sets-dir | --ssl-capath) _filedir -d return ;; @@ -22,15 +22,15 @@ _mysqladmin() _xfunc mysql _mysql_character_sets return ;; - --socket|-!(-*)S) + --socket | -!(-*)S) _filedir sock return ;; - --defaults-file|--defaults-extra-file) + --defaults-file | --defaults-extra-file) _filedir return ;; - --ssl-ca|--ssl-cert) + --ssl-ca | --ssl-cert) _filedir '@(pem|cer|c?(e)rt)' return ;; @@ -38,26 +38,26 @@ _mysqladmin() _filedir '@(pem|key)' return ;; - --count|--port|--set-variable|--sleep|--ssl-cipher|--wait|\ - --connect_timeout|--shutdown_timeout|-!(-*)[cPOiw]) + --count | --port | --set-variable | --sleep | --ssl-cipher | --wait | \ + --connect_timeout | --shutdown_timeout | -!(-*)[cPOiw]) return ;; - --help|--version|-!(-*)[?V]) + --help | --version | -!(-*)[?V]) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) - COMPREPLY+=( $( compgen -W 'create debug drop extended-status flush-hosts + COMPREPLY+=($(compgen -W 'create debug drop extended-status flush-hosts flush-logs flush-status flush-tables flush-threads flush-privileges kill password old-password ping processlist reload refresh shutdown - status start-slave stop-slave variables version' -- "$cur" ) ) + status start-slave stop-slave variables version' -- "$cur")) - [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _mysqladmin mysqladmin + complete -F _mysqladmin mysqladmin # ex: filetype=sh diff --git a/completions/nc b/completions/nc index 55b356d35cf..6fb0994339c 100644 --- a/completions/nc +++ b/completions/nc @@ -10,7 +10,7 @@ _nc() return ;; -*s) - if [[ "${words[@]}" == *-6* ]]; then + if [[ ${words[*]} == *-6* ]]; then _ip_addresses -6 __ltrim_colon_completions "$cur" else @@ -19,13 +19,13 @@ _nc() return ;; -*T) - COMPREPLY=( $( compgen -W 'critical inetcontrol lowcost lowdelay + COMPREPLY=($(compgen -W 'critical inetcontrol lowcost lowdelay netcontrol throughput reliability ef af{11..43} cs{0..7}' \ - -- "$cur" ) ) + -- "$cur")) return ;; -*X) - COMPREPLY=( $( compgen -W '4 5 connect' -- "$cur" ) ) + COMPREPLY=($(compgen -W '4 5 connect' -- "$cur")) return ;; -*x) @@ -34,17 +34,18 @@ _nc() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) return fi # Complete 1st non-option arg only - local args; _count_args "" "-*[IiMmOPpqsTVWwXx]" - [[ $args -eq 1 ]] || return + local args + _count_args "" "-*[IiMmOPpqsTVWwXx]" + ((args == 1)) || return _known_hosts_real -- "$cur" } && -complete -F _nc nc + complete -F _nc nc # ex: filetype=sh diff --git a/completions/ncftp b/completions/ncftp index 4c073ce6b9c..c3f2cf15913 100644 --- a/completions/ncftp +++ b/completions/ncftp @@ -6,22 +6,22 @@ _ncftp() _init_completion || return case $prev in - -u|-p|-P|-j|-F) + -u | -p | -P | -j | -F) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) return fi if [[ $cword -eq 1 && -f ~/.ncftp/bookmarks ]]; then - COMPREPLY=( $( compgen -W '$( command sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \ - ~/.ncftp/bookmarks )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(command sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \ + ~/.ncftp/bookmarks)' -- "$cur")) fi } && -complete -F _ncftp -o default ncftp + complete -F _ncftp -o default ncftp # ex: filetype=sh diff --git a/completions/nethogs b/completions/nethogs index 8eeb4ff58c0..5cd3650e4e2 100644 --- a/completions/nethogs +++ b/completions/nethogs @@ -8,19 +8,19 @@ _nethogs() case "$prev" in -d) # expect integer value - COMPREPLY+=( $( compgen -W '{0..9}' ) ) + COMPREPLY+=($(compgen -W '{0..9}')) compopt -o nospace return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" -h)' -- "$cur")) return fi _available_interfaces -a } && -complete -F _nethogs nethogs + complete -F _nethogs nethogs # ex: filetype=sh diff --git a/completions/newlist b/completions/newlist index 04bf17d1759..f1f6cf853ac 100644 --- a/completions/newlist +++ b/completions/newlist @@ -6,20 +6,20 @@ _newlist() _init_completion -s || return case $prev in - -l|--language|-u|--urlhost|-e|--emailhost|--help) + -l | --language | -u | --urlhost | -e | --emailhost | --help) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _xfunc list_lists _mailman_lists fi } && -complete -F _newlist newlist + complete -F _newlist newlist # ex: filetype=sh diff --git a/completions/newusers b/completions/newusers index 068b7a92819..890a5fccb35 100644 --- a/completions/newusers +++ b/completions/newusers @@ -6,26 +6,25 @@ _newusers() _init_completion -s || return case $prev in - -c|--crypt) - COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \ - -- "$cur" ) ) + -c | --crypt) + COMPREPLY=($(compgen -W 'DES MD5 NONE SHA256 SHA512' -- "$cur")) return ;; - -s|--sha-rounds) + -s | --sha-rounds) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _newusers newusers + complete -F _newusers newusers # ex: filetype=sh diff --git a/completions/ngrep b/completions/ngrep index 5d51a0c9058..7d16c8d643f 100644 --- a/completions/ngrep +++ b/completions/ngrep @@ -6,20 +6,20 @@ _ngrep() _init_completion || return case $prev in - -h|-V|-n|-A|-s|-S|-c|-P) + -h | -V | -n | -A | -s | -S | -c | -P) return ;; - -I|-O) + -I | -O) _filedir 'pcap?(ng)' return ;; -d) _available_interfaces -a - COMPREPLY+=( $( compgen -W 'any' -- "$cur" ) ) + COMPREPLY+=($(compgen -W 'any' -- "$cur")) return ;; -W) - COMPREPLY=( $( compgen -W 'normal byline single none' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'normal byline single none' -- "$cur")) return ;; -F) @@ -28,11 +28,11 @@ _ngrep() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) return fi } && -complete -F _ngrep ngrep + complete -F _ngrep ngrep # ex: filetype=sh diff --git a/completions/nmap b/completions/nmap index c56c7210894..482148e34ea 100644 --- a/completions/nmap +++ b/completions/nmap @@ -2,15 +2,15 @@ _nmap() { - local cur prev words cword - _init_completion || return + local cur prev words cword split + _init_completion -s || return case $prev in - -iL|-oN|-oX|-oS|-oG|---excludefile|--resume|--stylesheet) + -iL | -oN | -oX | -oS | -oG | ---excludefile | --resume | --stylesheet) _filedir return ;; - -oA|--datadir) + -oA | --datadir) _filedir -d return ;; @@ -18,33 +18,39 @@ _nmap() _available_interfaces -a return ;; - -b|--dns-servers) + -b | --dns-servers) _known_hosts_real -- "$cur" return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-iL -iR --exclude --excludefile -sL -sP -PN - -PS -PA -PU -PY -PE -PP -PM -PO -n -R --dns-servers --system-dns - --traceroute -sS -sT -sA -sW -sM -sU -sN -sF -sX --scanflags -sI - -sY -sZ -sO -b -p -F -r --top-ports --port-ratio -sV - --version-intensity --version-light --version-all --version-trace - -sC --script= --script-args= --script-trace --script-updatedb -O - --osscan-limit --osscan-guess -T0 -T1 -T2 -T3 -T4 -T5 - --min-hostgroup --max-hostgroup --min-parallelism --max-parallelism - --min-rtt-timeout --max-rtt-timeout --initial-rtt-timeout - --max-retries --host-timeout --scan-delay --max-scan-delay - --min-rate --max-rate -f --mtu -D -S -e --source-port --data-length - --ip-options --ttl --spoof-mac --badsum --adler32 -oN -oX -oS -oG - -oA -v -d --reason --open --packet-trace --iflist --log-errors - --append-output --resume --stylesheet --webxml --no-stylesheet -6 - -A --datadir --send-eth --send-ip --privilege--unprivileged -V - -h' -- "$cur" ) ) + $split && return + + if [[ $cur == -* ]]; then + # strip everything following a :, inclusive + # strip everything following a =, exclusive + # expand -X; -Y to -X -Y + # expand -X/-Y/-Z to -X -Y -Z + # expand -X/Y/Z to -X -Y -Z + # expand --foo/bar to --foo --bar + # strip everything following a non-option name or = char + # TODO: should expand -T<0-5> to -T0 ... -T5 + COMPREPLY=($(compgen -W "$( + "$1" --help 2>&1 | command sed \ + -e "s/:.*$//" \ + -e "s/=.*$/=/" \ + -e "s/;[[:space:]]*-/ -/g" \ + -e "s/\/-/ -/g" \ + -e "/^[[:space:]]*-[^-]/s/\/\([^-]\)/ -\1/g" \ + -e "/^[[:space:]]*--/s/\/\([^-]\)/ --\1/g" \ + -e "s/[^[:space:]a-zA-Z0-9=-].*$//" + )" \ + -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _known_hosts_real -- "$cur" fi } && -complete -F _nmap nmap + complete -F _nmap nmap # ex: filetype=sh diff --git a/completions/nproc b/completions/nproc index 8903940e921..50273f0735c 100644 --- a/completions/nproc +++ b/completions/nproc @@ -6,7 +6,7 @@ _nproc() _init_completion -s || return case $prev in - --help|--version|--ignore) + --help | --version | --ignore) return ;; esac @@ -14,8 +14,10 @@ _nproc() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _nproc nproc + complete -F _nproc nproc + +# ex: filetype=sh diff --git a/completions/nslookup b/completions/nslookup index 6577062966d..0f7342eda84 100644 --- a/completions/nslookup +++ b/completions/nslookup @@ -2,15 +2,25 @@ _bind_queryclass() { - COMPREPLY+=( $( compgen -W 'IN CH HS ANY' -- "$cur" ) ) + COMPREPLY+=($(compgen -W 'IN CH HS ANY' -- "$cur")) } _bind_querytype() { - # http://en.wikipedia.org/wiki/List_of_DNS_record_types - COMPREPLY+=( $( compgen -W 'A AAAA AFSDB APL CERT CNAME DHCID DLV DNAME - DNSKEY DS HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR - RRSIG RP SIG SOA SPF SRV SSHFP TXT' -- "$cur" ) ) + # https://en.wikipedia.org/wiki/List_of_DNS_record_types + # Resource records + local -a types=( + A AAAA AFSDB APL CAA CDNSKEY CDS CERT CNAME CSYNC DHCID DLV DNAME + DNSKEY DS EUI48 EUI64 HINFO HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC + NSEC3 NSEC3PARAM OPENPGPKEY PTR RRSIG RP SIG SMIMEA SOA SRV SSHFP TA + TKEY TLSA TSIG TXT URI ZONEMD SVCB HTTPS + ) + # Other types/pseudo record types + types+=(AXFR IXFR OPT) + # Selected obsolete record types + types+=(SPF) + + COMPREPLY+=($(compgen -W '${types[@]}' -- "$cur")) } _nslookup() @@ -19,12 +29,12 @@ _nslookup() _init_completion -n = || return case $cur in - -class=*|-cl=*) + -class=* | -cl=*) cur=${cur#*=} _bind_queryclass return ;; - -querytype=*|-type=*|-q=*|-ty=*) + -querytype=* | -type=* | -q=* | -ty=*) cur=${cur#*=} _bind_querytype return @@ -35,21 +45,21 @@ _nslookup() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-all -class= -debug -nodebug -d2 -nod2 + COMPREPLY=($(compgen -W '-all -class= -debug -nodebug -d2 -nod2 -domain= -search -nosearch -port= -querytype= -recurse -norecurse - -retry= -timeout= -vc -novc -fail -nofail' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + -retry= -timeout= -vc -novc -fail -nofail' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi local args - _count_args = - if [[ $args -le 2 ]]; then + _count_args "=" + if ((args <= 2)); then _known_hosts_real -- "$cur" - [[ $args -eq 1 && $cur == @(|-) ]] && COMPREPLY+=( - ) + [[ $args -eq 1 && $cur == @(|-) ]] && COMPREPLY+=(-) fi } && -complete -F _nslookup nslookup + complete -F _nslookup nslookup _host() { @@ -66,21 +76,29 @@ _host() return ;; -m) - COMPREPLY=( $( compgen -W 'trace record usage' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'trace record usage' -- "$cur")) return ;; - -N|-R|-W) + -N | -R | -W) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi - _known_hosts_real -- "$cur" + local args + _count_args "" "-*[ctmNRW]" + if ((args == 1)); then + _known_hosts_real -- "$cur" + elif ((args == 2)); then + local ipvx + [[ ${words[*]} =~ \ -[^\ ]*([46]) ]] && ipvx=-${BASH_REMATCH[1]} + _known_hosts_real ${ipvx-} -- "$cur" + fi } && -complete -F _host host + complete -F _host host # ex: filetype=sh diff --git a/completions/nsupdate b/completions/nsupdate new file mode 100644 index 00000000000..68df333e359 --- /dev/null +++ b/completions/nsupdate @@ -0,0 +1,40 @@ +# bash completion for nsupdate(1) -*- shell-script -*- + +_nsupdate() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -*[VLprtu]) + return + ;; + -*k) + _filedir key + return + ;; + -*R) + cur=${cur:=/dev/} + _filedir + return + ;; + -*y) + if [[ $cur == h* ]]; then + COMPREPLY=($(compgen -W "hmac-{md5,sha{1,224,256,384,512}}" \ + -S : -- "$cur")) + [[ ${COMPREPLY-} == *: ]] && compopt -o nospace + fi + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) + return + fi + + _filedir +} && + complete -F _nsupdate nsupdate + +# ex: filetype=sh diff --git a/completions/ntpdate b/completions/ntpdate index 4b09335b053..c69ad63a0ae 100644 --- a/completions/ntpdate +++ b/completions/ntpdate @@ -11,11 +11,11 @@ _ntpdate() return ;; -*U) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) return ;; -*p) - COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..8}' -- "$cur")) return ;; @@ -24,12 +24,14 @@ _ntpdate() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" -h || _parse_usage "$1")' -- "$cur" + )) else _known_hosts_real -- "$cur" fi } && -complete -F _ntpdate ntpdate + complete -F _ntpdate ntpdate # ex: filetype=sh diff --git a/completions/oggdec b/completions/oggdec index 5e0a881888d..97bde2054e4 100644 --- a/completions/oggdec +++ b/completions/oggdec @@ -6,18 +6,18 @@ _oggdec() _init_completion -s || return case $prev in - --help|--version|-!(-*)[hV]*) + --help | --version | -!(-*)[hV]*) return ;; - --bits|-!(-*)b) - COMPREPLY=( $( compgen -W "8 16" -- "$cur" ) ) + --bits | -!(-*)b) + COMPREPLY=($(compgen -W "8 16" -- "$cur")) return ;; - --endianness|--sign|-!(-*)[es]) - COMPREPLY=( $( compgen -W "0 1" -- "$cur" ) ) + --endianness | --sign | -!(-*)[es]) + COMPREPLY=($(compgen -W "0 1" -- "$cur")) return ;; - --output|-!(-*)o) + --output | -!(-*)o) _filedir wav return ;; @@ -25,14 +25,14 @@ _oggdec() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir ogg } && -complete -F _oggdec oggdec + complete -F _oggdec oggdec # ex: filetype=sh diff --git a/completions/op b/completions/op deleted file mode 100644 index 15dedc05160..00000000000 --- a/completions/op +++ /dev/null @@ -1,58 +0,0 @@ -# op (1Password CLI) completion -*- shell-script -*- - -_op_commands() -{ - "$@" --help | - awk "/^(Available |Sub)commands/{flag=1;next}/^ /&&flag{print \$1}" -} - -_op_command_options() -{ - case $cur in - -*) - for i in "${!words[@]}"; do - [[ ${words[i]} == -* || $i -eq 0 ]] && unset words[i] - done - COMPREPLY=( $( compgen -W \ - '$( _parse_usage "$1" "${words[*]} --help" ) --help' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 - ;; - esac - return 1 -} - -_op() -{ - local cur prev words cword split - _init_completion -s || return - - local command i - for (( i=1; i < cword; i++ )); do - case ${words[i]} in - --help|--version) return ;; - -*) ;; - *) command=${words[i]}; break ;; - esac - done - - if [[ -z $command && $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - return - fi - - [[ $command ]] && _op_command_options "$1" && return - - if [[ -z $command || $command == $prev ]]; then - COMPREPLY=( $( compgen -W '$( _op_commands "$1" $command )' \ - -- "$cur" ) ) - [[ $COMPREPLY ]] && return - fi - - # TODO specific command and subcommand completions -} && -complete -F _op op - -# ex: filetype=sh diff --git a/completions/openssl b/completions/openssl index 73e56a44d6d..dd770920815 100644 --- a/completions/openssl +++ b/completions/openssl @@ -5,9 +5,9 @@ _openssl_sections() local config f # check if a specific configuration file is used - for (( i=2; i < cword; i++ )); do - if [[ "${words[i]}" == -config ]]; then - config=${words[i+1]} + for ((i = 2; i < cword; i++)); do + if [[ ${words[i]} == -config ]]; then + config=${words[i + 1]} break fi done @@ -22,14 +22,17 @@ _openssl_sections() [[ ! -f $config ]] && return - COMPREPLY=( $( compgen -W "$( awk '/\[.*\]/ {print $2}' $config )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(awk '/\[.*\]/ {print $2}' $config)" -- "$cur")) } _openssl_digests() { - "$1" dgst -h 2>&1 | \ + "$1" dgst -h 2>&1 | awk '/^-.*[ \t]to use the .* message digest algorithm/ { print $1 }' + local -a digests=($("$1" help 2>&1 | + command sed -ne '/^Message Digest commands/,/^[[:space:]]*$/p' | + command sed -e 1d)) + printf "%s\n" "${digests[@]/#/-}" } _openssl() @@ -52,29 +55,29 @@ _openssl() rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb rc4 rc4-40 sha224 sha256 sha384 sha512 genpkey pkey pkeyparam pkeyutl' - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + if ((cword == 1)); then + COMPREPLY=($(compgen -W "$commands" -- "$cur")) else command=${words[1]} case $prev in - -CA|-CAfile|-CAkey|-CAserial|-cert|-certfile|-config|-content| \ - -dcert|-dkey|-dhparam|-extfile|-in|-inkey|-kfile|-key|-keyout| \ - -out|-oid|-paramfile|-peerkey|-prvrify|-rand|-recip|-revoke| \ - -sess_in|-sess_out|-spkac|-sigfile|-sign|-signkey|-signer| \ - -signature|-ss_cert|-untrusted|-verify) + -CA | -CAfile | -CAkey | -CAserial | -cert | -certfile | -config | -content | \ + -dcert | -dkey | -dhparam | -extfile | -in | -inkey | -kfile | -key | -keyout | \ + -out | -oid | -paramfile | -peerkey | -prvrify | -rand | -recip | -revoke | \ + -sess_in | -sess_out | -spkac | -sigfile | -sign | -signkey | -signer | \ + -signature | -ss_cert | -untrusted | -verify | -writerand) _filedir return ;; - -outdir|-CApath) + -outdir | -CApath) _filedir -d return ;; - -name|-crlexts|-extensions) + -name | -crlexts | -extensions) _openssl_sections return ;; - -inform|-outform|-keyform|-certform|-CAform|-CAkeyform|-dkeyform|\ - -dcertform|-peerform) + -inform | -outform | -keyform | -certform | -CAform | -CAkeyform | -dkeyform | \ + -dcertform | -peerform) formats='DER PEM' case $command in x509) @@ -87,7 +90,7 @@ _openssl() formats+=" ENGINE" ;; esac - COMPREPLY=( $( compgen -W "$formats" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$formats" -- "$cur")) return ;; -connect) @@ -95,178 +98,41 @@ _openssl() return ;; -starttls) - COMPREPLY=( $( compgen -W 'smtp pop3 imap ftp' -- "$cur" ) ) + COMPREPLY=($(compgen -W ' + smtp pop3 imap ftp xmpp xmpp-server telnet irc mysql + postgres lmtp nntp sieve ldap + ' -- "$cur")) return ;; -cipher) - COMPREPLY=( $( IFS=: compgen -W "$( $1 ciphers )" \ - -- "$cur" ) ) + COMPREPLY=($(IFS=: compgen -W "$($1 ciphers)" -- "$cur")) return ;; -kdf) - COMPREPLY=( $( compgen -W 'TLS1-PRF HKDF' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'TLS1-PRF HKDF' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # possible options for the command + options=$(_parse_help "$1" "$command -help" 2>/dev/null) case $command in - asn1parse) - options='-inform -in -out -noout -offset -length -i -oid - -strparse' - ;; - ca) - options='-verbose -config -name -gencrl -revoke -crl_reason - -crl_hold -crl_compromise -crl_CA_compromise -crldays - -crlhours -crlexts -startdate -enddate -days -md - -policy -keyfile -key -passin -cert -selfsig -in -out - -notext -outdir -infiles -spkac -ss_cert -preserveDN - -noemailDN -batch -msie_hack -extensions -extfile - -engine -subj -utf8 -multivalue-rdn' - ;; - ciphers) - options='-v -ssl2 -ssl3 -tls1' - ;; - crl) - options='-inform -outform -text -in -out -noout -hash - -issuer -lastupdate -nextupdate -CAfile -CApath' - ;; - crl2pkcs7) - options='-inform -outform -in -out -print_certs' - ;; - dgst) - options="-c -d -hex -binary -out -sign -verify -prverify - -signature $( _openssl_digests $1 )" - ;; - dsa) - options='-inform -outform -in -passin -out -passout -des - -des3 -idea -text -noout -modulus -pubin -pubout' - ;; - dsaparam) - options='-inform -outform -in -out -noout -text -C -rand - -genkey' - ;; - enc) - options='-ciphername -in -out -pass -e -d -a -A -k -kfile - -S -K -iv -p -P -bufsize -debug' - ;; - dhparam) - options='-inform -outform -in -out -dsaparam -noout -text - -C -2 -5 -rand' - ;; - gendsa) - options='-out -des -des3 -idea -rand' - ;; - genpkey) - options='-out -outform -pass -cipher -engine -paramfile - -algorithm -pkeyopt -genparam -text' - ;; - genrsa) - options='-out -passout -des -des3 -idea -f4 -3 -rand' - ;; - pkcs7) - options='-inform -outform -in -out -print_certs -text - -noout' - ;; - pkey) - options='-inform -outform -in -passin -out -passout - -traditional -cipher -text -text_pub -noout -pubin - -pubout -engine' - ;; - pkeyparam) - options='-in -out -text -noout -engine' - ;; - pkeyutl) - options='-in -out -sigfile -inkey -keyform -passin -peerkey - -peerform -pubin -certin -rev -sign -verify - -verifyrecover -encrypt -decrypt -derive -kdf -kdflen - -pkeyopt -hexdump -asn1parse -engine -engine_impl' - ;; - rand) - options='-out -rand -base64' - ;; - req) - options="-inform -outform -in -passin -out -passout -text - -noout -verify -modulus -new -rand -newkey -newkey - -nodes -key -keyform -keyout $( _openssl_digests $1 ) - -config -x509 -days -asn1-kludge -newhdr -extensions - -reqexts section" - ;; - rsa) - options='-inform -outform -in -passin -out -passout - -sgckey -des -des3 -idea -text -noout -modulus -check - -pubin -pubout -engine' - ;; - rsautl) - options='-in -out -inkey -pubin -certin -sign -verify - -encrypt -decrypt -pkcs -ssl -raw -hexdump -asn1parse' - ;; - s_client) - options='-connect -verify -cert -certform -key -keyform - -pass -CApath -CAfile -reconnect -pause -showcerts - -debug -msg -nbio_test -state -nbio -crlf -ign_eof - -quiet -ssl2 -ssl3 -tls1 -no_ssl2 -no_ssl3 -no_tls1 - -bugs -cipher -starttls -engine -tlsextdebug - -no_ticket -sess_out -sess_in -rand' - ;; - s_server) - options='-accept -context -verify -Verify -crl_check - -crl_check_all -cert -certform -key -keyform -pass - -dcert -dcertform -dkey -dkeyform -dpass -dhparam - -nbio -nbio_test -crlf -debug -msg -state -CApath - -CAfile -nocert -cipher -quiet -no_tmp_rsa -ssl2 - -ssl3 -tls1 -no_ssl2 -no_ssl3 -no_tls1 -no_dhe - -bugs -hack -www -WWW -HTTP -engine -tlsextdebug - -no_ticket -id_prefix -rand' - ;; - s_time) - options='-connect -www -cert -key -CApath -CAfile -reuse - -new -verify -nbio -time -ssl2 -ssl3 -bugs -cipher' - ;; - sess_id) - options='-inform -outform -in -out -text -noout -context ID' - ;; - smime) - options='-encrypt -decrypt -sign -verify -pk7out -des -des3 - -rc2-40 -rc2-64 -rc2-128 -aes128 -aes192 -aes256 -in - -certfile -signer -recip -inform -passin -inkey -out - -outform -content -to -from -subject -text -rand' - ;; - speed) - options='-engine' - ;; - verify) - options='-CApath -CAfile -purpose -untrusted -help - -issuer_checks -verbose -certificates' - ;; - x509) - options="-inform -outform -keyform -CAform -CAkeyform -in - -out -serial -hash -subject_hash -issuer_hash -subject - -issuer -nameopt -email -startdate -enddate -purpose - -dates -modulus -fingerprint -alias -noout -trustout - -clrtrust -clrreject -addtrust -addreject -setalias - -days -set_serial -signkey -x509toreq -req -CA -CAkey - -CAcreateserial -CAserial -text -C -clrext - -extfile -extensions -engine $( _openssl_digests $1 )" - ;; - md*|sha*|ripemd160) - options='-c -d' - ;; + dgst | req | x509) options+=" $(_openssl_digests $1)" ;; esac - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) else - if [[ "$command" == speed ]]; then - COMPREPLY=( $( compgen -W 'md2 mdc2 md5 hmac sha1 rmd160 + if [[ $command == speed ]]; then + COMPREPLY=($(compgen -W 'md2 mdc2 md5 hmac sha1 rmd160 idea-cbc rc2-cbc rc5-cbc bf-cbc des-cbc des-ede3 rc4 rsa512 rsa1024 rsa2048 rsa4096 dsa512 dsa1024 dsa2048 idea - rc2 des rsa blowfish' -- "$cur" ) ) + rc2 des rsa blowfish' -- "$cur")) else _filedir fi fi fi } && -complete -F _openssl -o default openssl + complete -F _openssl -o default openssl # ex: filetype=sh diff --git a/completions/opera b/completions/opera index 26343c6243e..f2bc8c30005 100644 --- a/completions/opera +++ b/completions/opera @@ -6,8 +6,8 @@ _opera() _init_completion || return case "$prev" in - ?(-)-widget|?(-)-urllist|?(-)-uiparserlog|?(-)-uiwidgetsparserlog|\ - ?(-)-profilinglog) + ?(-)-widget | ?(-)-urllist | ?(-)-uiparserlog | ?(-)-uiwidgetsparserlog | \ + ?(-)-profilinglog) _filedir return ;; @@ -16,32 +16,32 @@ _opera() return ;; ?(-)-remote) - COMPREPLY=( $( compgen -W 'openURL\\( openFile\\( openM2\\( + COMPREPLY=($(compgen -W 'openURL\\( openFile\\( openM2\\( openComposer\\( addBookmark\\( raise\\(\\) lower\\(\\)' \ - -- "$cur" ) ) - [[ $COMPREPLY == *\( ]] && compopt -o nospace + -- "$cur")) + [[ ${COMPREPLY-} == *\( ]] && compopt -o nospace return ;; ?(-)-windowname) - COMPREPLY=( $( compgen -W 'first last opera{1..9}' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'first last opera{1..9}' -- "$cur")) return ;; - ?(-)-geometry|?(-)-window|?(-)-display|?(-)-urllistloadtimeout|\ - ?(-)-delaycustomizations|?(-)-dialogtest|?(-)-inidialogtest|\ - ?(-)-gputest) + ?(-)-geometry | ?(-)-window | ?(-)-display | ?(-)-urllistloadtimeout | \ + ?(-)-delaycustomizations | ?(-)-dialogtest | ?(-)-inidialogtest | \ + ?(-)-gputest) # argument required but no completions available return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir '@(?([xX]|[sS])[hH][tT][mM]?([lL]))' } && -complete -F _opera opera + complete -F _opera opera # ex: filetype=sh diff --git a/completions/optipng b/completions/optipng index 7c614abe3fd..0f6b40e1108 100644 --- a/completions/optipng +++ b/completions/optipng @@ -6,14 +6,14 @@ _optipng() _init_completion || return case $prev in - -'?'|-h|--help|-f) + -'?' | -h | --help | -f) return ;; -o) - COMPREPLY=( $( compgen -W '{0..7}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..7}' -- "$cur")) return ;; - -out|-log) + -out | -log) _filedir return ;; @@ -22,31 +22,31 @@ _optipng() return ;; -i) - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + COMPREPLY=($(compgen -W '0 1' -- "$cur")) return ;; - -zc|-zm) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + -zc | -zm) + COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) return ;; -zw) - COMPREPLY=( $( compgen -W '256 512 1k 2k 4k 8k 16k 32k' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '256 512 1k 2k 4k 8k 16k 32k' \ + -- "$cur")) return ;; -strip) - COMPREPLY=( $( compgen -W 'all' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'all' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _filedir '@(png|bmp|gif|pnm|tif?(f))' } && -complete -F _optipng optipng + complete -F _optipng optipng # ex: filetype=sh diff --git a/completions/p4 b/completions/p4 index beea4687ac8..ed5f20c2587 100644 --- a/completions/p4 +++ b/completions/p4 @@ -9,43 +9,43 @@ _p4() local p4commands p4filetypes # rename isn't really a command - p4commands="$( p4 help commands 2>/dev/null | awk 'NF>3 {print $1}' )" + p4commands="$(p4 help commands 2>/dev/null | awk 'NF>3 {print $1}')" p4filetypes="ctext cxtext ktext kxtext ltext tempobj ubinary \ uresource uxbinary xbinary xltext xtempobj xtext \ text binary resource" - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W "$p4commands" -- "$cur" ) ) - elif [[ $cword -eq 2 ]]; then + if ((cword == 1)); then + COMPREPLY=($(compgen -W "$p4commands" -- "$cur")) + elif ((cword == 2)); then case $prev in help) - COMPREPLY=( $( compgen -W "simple commands environment + COMPREPLY=($(compgen -W "simple commands environment filetypes jobview revisions usage views $p4commands" \ - -- "$cur" ) ) + -- "$cur")) ;; admin) - COMPREPLY=( $( compgen -W "checkpoint stop" -- "$cur" ) ) - ;; - *) + COMPREPLY=($(compgen -W "checkpoint stop" -- "$cur")) ;; + *) ;; + esac - elif [[ $cword -gt 2 ]]; then + elif ((cword > 2)); then case $prev in -t) - case ${words[$cword-2]} in - add|edit|reopen) - COMPREPLY=( $( compgen -W "$p4filetypes" -- "$cur" ) ) - ;; - *) + case ${words[cword - 2]} in + add | edit | reopen) + COMPREPLY=($(compgen -W "$p4filetypes" -- "$cur")) ;; + *) ;; + esac ;; - *) - ;; + *) ;; + esac fi } && -complete -F _p4 -o default p4 g4 + complete -F _p4 -o default p4 g4 # ex: filetype=sh diff --git a/completions/pack200 b/completions/pack200 index 37c57749b1f..cb9871b1ca3 100644 --- a/completions/pack200 +++ b/completions/pack200 @@ -6,37 +6,37 @@ _pack200() _init_completion -s || return case $prev in - -S|--segment-limit|-P|--pass-file|-C|--class-attribute|\ - -F|--field-attribute|-M|--method-attribute|-D|--code-attribute|\ - '-?'|-h|--help|-V|--version|-J) + -S | --segment-limit | -P | --pass-file | -C | --class-attribute | \ + -F | --field-attribute | -M | --method-attribute | -D | \ + --code-attribute | '-?' | -h | --help | -V | --version | -J) return ;; - -E|--effort) - COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) ) + -E | --effort) + COMPREPLY=($(compgen -W '{0..9}' -- "$cur")) return ;; - -H|--deflate-hint) - COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) ) + -H | --deflate-hint) + COMPREPLY=($(compgen -W 'true false keep' -- "$cur")) return ;; - -m|--modification-time) - COMPREPLY=( $( compgen -W 'latest keep' -- "$cur" ) ) + -m | --modification-time) + COMPREPLY=($(compgen -W 'latest keep' -- "$cur")) return ;; - -U|--unknown-attribute) - COMPREPLY=( $( compgen -W 'error strip pass' -- "$cur" ) ) + -U | --unknown-attribute) + COMPREPLY=($(compgen -W 'error strip pass' -- "$cur")) return ;; - -f|--config-file) + -f | --config-file) _filedir properties return ;; - -l|--log-file) - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + -l | --log-file) + COMPREPLY=($(compgen -W '-' -- "$cur")) _filedir log return ;; - -r|--repack) + -r | --repack) _filedir jar return ;; @@ -46,29 +46,29 @@ _pack200() # Check if a pack or a jar was already given. local i pack=false jar=false - for (( i=0; i < ${#words[@]}-1; i++ )) ; do + for ((i = 1; i < ${#words[@]} - 1; i++)); do case ${words[i]} in - *.pack|*.pack.gz) pack=true ;; + *.pack | *.pack.gz) pack=true ;; *.jar) jar=true ;; esac done - if ! $pack ; then - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '--no-gzip --gzip --strip-debug + if ! $pack; then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--no-gzip --gzip --strip-debug --no-keep-file-order --segment-limit= --effort= --deflate-hint= --modification-time= --pass-file= --unknown-attribute= --class-attribute= --field-attribute= --method-attribute= --code-attribute= --config-file= --verbose --quiet --log-file= - --help --version -J --repack' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + --help --version -J --repack' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _filedir 'pack?(.gz)' fi - elif ! $jar ; then + elif ! $jar; then _filedir jar fi } && -complete -F _pack200 pack200 + complete -F _pack200 pack200 # ex: filetype=sh diff --git a/completions/passwd b/completions/passwd index e192a228512..6d8bd544520 100644 --- a/completions/passwd +++ b/completions/passwd @@ -6,20 +6,21 @@ _passwd() _init_completion || return case $prev in - --minimum|--maximum|--warning|--inactive|--help|--usage|-!(-*)[nxwi?]) + --minimum | --maximum | --warning | --inactive | --help | --usage | \ + -!(-*)[nxwi?]) return ;; esac - if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) return fi _allowed_users } && -complete -F _passwd passwd + complete -F _passwd passwd # ex: filetype=sh diff --git a/completions/patch b/completions/patch index 80c86922ca7..e883d9cac7e 100644 --- a/completions/patch +++ b/completions/patch @@ -6,42 +6,42 @@ _patch() _init_completion -s || return case $prev in - --strip|--ifdef|--prefix|--basename-prefix|--suffix|--get|\ - -!(-*)[pDBYzg]) + --strip | --ifdef | --prefix | --basename-prefix | --suffix | --get | \ + -!(-*)[pDBYzg]) return ;; - --fuzz|-!(-*)F) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + --fuzz | -!(-*)F) + COMPREPLY=($(compgen -W '{0..3}' -- "$cur")) return ;; - --input|-!(-*)i) + --input | -!(-*)i) _filedir '@(?(d)patch|dif?(f))' return ;; - --output|--reject-file|-!(-*)[or]) - [[ ! $cur || $cur == - ]] && COMPREPLY=( - ) + --output | --reject-file | -!(-*)[or]) + [[ ! $cur || $cur == - ]] && COMPREPLY=(-) _filedir return ;; --quoting-style) - COMPREPLY=( $( compgen -W 'literal shell shell-always c escape' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'literal shell shell-always c escape' \ + -- "$cur")) return ;; - --version-control|-!(-*)V) - COMPREPLY=( $( compgen -W 'simple numbered existing' -- "$cur" ) ) + --version-control | -!(-*)V) + COMPREPLY=($(compgen -W 'simple numbered existing' -- "$cur")) return ;; - --directory|-!(-*)d) + --directory | -!(-*)d) _filedir -d return ;; --reject-format) - COMPREPLY=( $( compgen -W 'context unified' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'context unified' -- "$cur")) return ;; --read-only) - COMPREPLY=( $( compgen -W 'ignore warn fail' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ignore warn fail' -- "$cur")) return ;; esac @@ -49,8 +49,8 @@ _patch() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi @@ -65,6 +65,6 @@ _patch() ;; esac } && -complete -F _patch patch + complete -F _patch patch # ex: filetype=sh diff --git a/completions/pdftoppm b/completions/pdftoppm new file mode 100644 index 00000000000..c9630513b4d --- /dev/null +++ b/completions/pdftoppm @@ -0,0 +1,35 @@ +# bash completion for pdftoppm(1) -*- shell-script -*- + +_comp_cmd_pdftoppm() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -[flrxyWH] | -r[xy] | -scale?(-to-[xy]) | -jpegopt | -[ou]pw) + return + ;; + -tiffcompression) + COMPREPLY=($(compgen -W 'none packbits jpeg lzw deflate' -- "$cur")) + return + ;; + -freetype | -aa | -aaVector) + COMPREPLY=($(compgen -W 'yes no' -- "$cur")) + return + ;; + -thinlinemode) + COMPREPLY=($(compgen -W 'none solid shape' -- "$cur")) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + return + fi + + [[ $prev == *.pdf ]] || _filedir pdf +} && + complete -F _comp_cmd_pdftoppm pdftoppm + +# ex: filetype=sh diff --git a/completions/pdftotext b/completions/pdftotext index aed6b2c2734..89517408be5 100644 --- a/completions/pdftotext +++ b/completions/pdftotext @@ -6,31 +6,35 @@ _pdftotext() _init_completion || return case $prev in - -h|-help|--help|-'?'|-f|-l|-r|-x|-y|-W|-H|-fixed|-opw|-upw) + -h | -help | --help | -'?' | -f | -l | -r | -x | -y | -W | -H | \ + -fixed | -opw | -upw) return ;; -enc) - COMPREPLY=( $( compgen -W '$( "$1" -listenc 2>/dev/null | - command sed -e 1d )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$("$1" -listenc 2>/dev/null | + command sed -e 1d)' -- "$cur")) return ;; -eol) - COMPREPLY=( $( compgen -W "unix dos mac" -- "$cur" ) ) + COMPREPLY=($(compgen -W "unix dos mac" -- "$cur")) return ;; esac if [[ $cur == -* && ${prev,,} != *.pdf ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi case ${prev,,} in - -|*.txt) ;; - *.pdf) COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) ; _filedir txt ;; + - | *.txt) ;; + *.pdf) + COMPREPLY=($(compgen -W '-' -- "$cur")) + _filedir txt + ;; *) _filedir pdf ;; esac } && -complete -F _pdftotext pdftotext + complete -F _pdftotext pdftotext # ex: filetype=sh diff --git a/completions/perl b/completions/perl index 7b91d1b4e9c..cf2b5b304f4 100644 --- a/completions/perl +++ b/completions/perl @@ -2,9 +2,9 @@ _perl_helper() { - COMPREPLY=( $( compgen -P "$prefix" -W \ - "$( ${2:-perl} ${BASH_SOURCE[0]%/*}/../helpers/perl $1 $cur )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -P "$prefix" -W \ + "$(${2:-perl} ${BASH_SOURCE[0]%/*}/../helpers/perl $1 $cur)" \ + -- "$cur")) [[ $1 == functions ]] || __ltrim_colon_completions "$prefix$cur" } @@ -16,7 +16,7 @@ _perl() local prefix="" temp optPrefix optSuffix # If option not followed by whitespace, reassign prev and cur - if [[ "$cur" == -?* ]]; then + if [[ $cur == -?* ]]; then temp=$cur prev=${temp:0:2} cur=${temp:2} @@ -27,55 +27,70 @@ _perl() optPrefix=-P$prev optSuffix=-S/ prefix=$prev - fi - case $prev in - -*[DeEiFl]) - return - ;; - -*[Ix]) - local IFS=$'\n' - compopt -o filenames - COMPREPLY=( $( compgen -d $optPrefix $optSuffix -- "$cur" ) ) - return - ;; - -*[mM]) - temp="${cur#-}" - prefix+="${cur%$temp}" - cur="$temp" - _perl_helper modules $1 - return - ;; - -*V) - if [[ $cur == :* ]]; then - temp="${cur##+(:)}" - prefix+="${cur%$temp}" + case $prev in + -*[DeEiFl]) + return + ;; + -*[Ix]) local IFS=$'\n' - COMPREPLY=( $( compgen -P "$prefix" -W \ - '$( $1 -MConfig -e "print join \"\\n\", - keys %Config::Config" 2>/dev/null )' -- "$temp" ) ) - __ltrim_colon_completions "$prefix$temp" - fi - return - ;; - -*d|-*dt) - if [[ $cur == :* ]]; then - temp="${cur#:}" - prefix="$prefix${cur%$temp}" - cur="Devel::$temp" + compopt -o filenames + COMPREPLY=($(compgen -d $optPrefix $optSuffix -- "$cur")) + return + ;; + -*[mM]) + temp="${cur#-}" + prefix+=${cur%"$temp"} + cur="$temp" _perl_helper modules $1 - fi - ;; - esac + return + ;; + -*V) + if [[ $cur == :* ]]; then + temp="${cur##+(:)}" + prefix+=${cur%"$temp"} + local IFS=$'\n' + COMPREPLY=($(compgen -P "$prefix" -W \ + '$($1 -MConfig -e "print join \"\\n\", + keys %Config::Config" 2>/dev/null)' -- "$temp")) + __ltrim_colon_completions "$prefix$temp" + fi + return + ;; + -*d | -*dt) + if [[ $cur == :* ]]; then + temp="${cur#:}" + prefix=$prefix${cur%"$temp"} + cur="Devel::$temp" + _perl_helper modules $1 + fi + ;; + esac + + # Unlike other perl options, having a space between the `-e' and + # `-E' options and their arguments, e.g. `perl -e "exit 2"', is + # valid syntax. However, the argument is neither a filename nor a + # directory, but one line of perl program, thus do not suggest + # _filedir completion. + elif [[ $prev == -e ]] || [[ $prev == -E ]]; then + return + + # Likewise, `-I' also accepts a space between option and argument + # and it takes a directory as value. + elif [[ $prev == -I ]]; then + local IFS=$'\n' + compopt -o filenames + COMPREPLY=($(compgen -d ${optPrefix-} ${optSuffix-} -- "$cur")) + return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p - -n -a -F -l -0 -I -m -M -P -S -x -i -e' -- "$cur" ) ) + elif [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p + -n -a -F -l -0 -I -m -M -P -S -x -i -e' -- "$cur")) else _filedir fi } && -complete -F _perl perl + complete -F _perl perl _perldoc() { @@ -85,7 +100,7 @@ _perldoc() local prefix="" temp # completing an option (may or may not be separated by a space) - if [[ "$cur" == -?* ]]; then + if [[ $cur == -?* ]]; then temp=$cur prev=${temp:0:2} cur=${temp:2} @@ -93,7 +108,7 @@ _perldoc() fi local perl="${1%doc}" - [[ $perl == $1 ]] || ! type $perl &>/dev/null && perl= + [[ $perl == "$1" ]] || ! type $perl &>/dev/null && perl= case $prev in -*[hVnoMwL]) @@ -109,23 +124,23 @@ _perldoc() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) else # return available modules (unless it is clearly a file) - if [[ "$cur" != @(*/|[.~])* ]]; then + if [[ $cur != @(*/|[.~])* ]]; then _perl_helper perldocs $perl if [[ $cur == p* ]]; then - COMPREPLY+=( $( compgen -W \ - '$( PERLDOC_PAGER=cat "$1" -u perl | \ - command sed -ne "/perl.*Perl overview/,/perlwin32/p" | \ - awk "\$NF=2 && \$1 ~ /^perl/ { print \$1 }" )' \ - -- "$cur" ) ) + COMPREPLY+=($(compgen -W \ + '$(PERLDOC_PAGER=cat "$1" -u perl | \ + command sed -ne "/perl.*Perl overview/,/perlwin32/p" | \ + awk "\$NF=2 && \$1 ~ /^perl/ { print \$1 }")' \ + -- "$cur")) fi fi _filedir 'p@([lm]|od)' fi } && -complete -F _perldoc -o bashdefault perldoc + complete -F _perldoc -o bashdefault perldoc # ex: filetype=sh diff --git a/completions/perlcritic b/completions/perlcritic index b38ae991217..7843549516a 100644 --- a/completions/perlcritic +++ b/completions/perlcritic @@ -6,46 +6,46 @@ _perlcritic() _init_completion || return case $prev in - --help|--version|--top|--include|--exclude|--single-policy|\ - --colo?(u)r-severity-*|--program-extensions|-[?HVs]) + --help | --version | --top | --include | --exclude | --single-policy | \ + --colo?(u)r-severity-* | --program-extensions | -[?HVs]) return ;; --severity) - COMPREPLY=( $( compgen -W "{1..5} brutal cruel harsh stern gentle" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "{1..5} brutal cruel harsh stern gentle" \ + -- "$cur")) return ;; - --profile|-p) + --profile | -p) _filedir perlcriticrc return ;; --theme) - COMPREPLY=( $( compgen -W '$( "$1" --list-themes 2>/dev/null )' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '$("$1" --list-themes 2>/dev/null)' \ + -- "$cur")) return ;; --profile-strictness) - COMPREPLY=( $( compgen -W 'warn fatal quiet' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'warn fatal quiet' -- "$cur")) return ;; --verbose) - COMPREPLY=( $( compgen -W '{1..11}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..11}' -- "$cur")) return ;; --pager) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi _filedir 'p[lm]' } && -complete -F _perlcritic perlcritic + complete -F _perlcritic perlcritic # ex: filetype=sh diff --git a/completions/perltidy b/completions/perltidy index 10c49cab33d..a6ee36b742f 100644 --- a/completions/perltidy +++ b/completions/perltidy @@ -6,7 +6,7 @@ _perltidy() _init_completion -n = || return case $prev in - -h|--help) + -h | --help) return ;; -o) @@ -16,26 +16,35 @@ _perltidy() esac case $cur in - -pro=*) + -pro=* | --profile=*) cur="${cur#*=}" _filedir return ;; - -ole=*) - COMPREPLY=( $( compgen -W 'dos win mac unix' -- "${cur#*=}" ) ) + -ole=* | --output-line-ending=*) + COMPREPLY=($(compgen -W 'dos win mac unix' -- "${cur#*=}")) return ;; - -bt=*|-pt=*|-sbt=*|-bvt=*|-pvt=*|-sbvt=*|-bvtc=*|-pvtc=*|-sbvtc=*|\ - -cti=*|-kbl=*|-vt=*) - COMPREPLY=( $( compgen -W '0 1 2' -- "${cur#*=}" ) ) + -bt=* | --brace-tightness=* | -pt=* | --paren-tightness=* | \ + -sbt=* | --square-bracket-tightness=* | \ + -bvt=* | --brace-vertical-tightness=* | \ + -pvt=* | --paren-vertical-tightness=* | \ + -sbvt=* | --square-bracket-vertical-tightness=* | \ + -bvtc=* | --brace-vertical-tightness-closing=* | \ + -pvtc=* | --paren-vertical-tightness-closing=* | \ + -sbvtc=* | --square-bracket-vertical-tightness-closing=* | \ + -cti=* | --closing-token-indentation=* | \ + -kbl=* | --keep-old-blank-lines=* | \ + -vt=* | --vertical-tightness=*) + COMPREPLY=($(compgen -W '0 1 2' -- "${cur#*=}")) return ;; - -vtc=*) - COMPREPLY=( $( compgen -W '0 1' -- "${cur#*=}" ) ) + -vtc=* | --vertical-tightness-closing=*) + COMPREPLY=($(compgen -W '0 1' -- "${cur#*=}")) return ;; - -cab=*) - COMPREPLY=( $( compgen -W '0 1 2 3' -- "${cur#*=}" ) ) + -cab=* | --comma-arrow-breakpoints=*) + COMPREPLY=($(compgen -W '0 1 2 3' -- "${cur#*=}")) return ;; -*=) @@ -44,10 +53,12 @@ _perltidy() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else - _filedir 'p[lm]' + _filedir 'p[lm]|t' fi } && -complete -F _perltidy perltidy + complete -F _perltidy perltidy + +# ex: filetype=sh diff --git a/completions/pgrep b/completions/pgrep index d1b6f18da19..fa886362e98 100644 --- a/completions/pgrep +++ b/completions/pgrep @@ -6,47 +6,57 @@ _pgrep() _init_completion || return case $prev in - --delimiter|--pgroup|--session|--terminal|-!(-*)[cdgJMNstTz]) + --delimiter | --pgroup | --session | --terminal | -!(-*)[cdgJMNstTz]) return ;; --signal) _signals return ;; - --pidfile|-!(-*)F) + --pidfile | -!(-*)F) _filedir return ;; - --group|-!(-*)G) + --group | -!(-*)G) _gids return ;; -j) - COMPREPLY=( $( compgen -W 'any none' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'any none' -- "$cur")) return ;; - --parent|-!(-*)P) + --parent | --ns | -!(-*)P) _pids return ;; - --euid|--uid|-!(-*)[uU]) + --euid | --uid | -!(-*)[uU]) _uids return ;; + --nslist) + COMPREPLY=( + $(IFS="$IFS," compgen -W '$($1 --help 2>&1 | + command sed -ne \ + "s/^[[:space:]]*Available namespaces://p")' \ + -- "${cur##*,}")) + ((${#COMPREPLY[@]})) && + _comp_delimited , -W '"${COMPREPLY[@]}"' + return + ;; esac if [[ $cur == -* ]]; then - local help='$( _parse_help "$1" )' - [[ $help ]] || help='$( "$1" --usage 2>&1 | + local help=$(_parse_help "$1") + [[ $help ]] || help='$("$1" --usage 2>&1 | command sed -e "s/\[-signal\]//" -e "s/\[-SIGNAL\]//" | - _parse_usage - )' - COMPREPLY=( $( compgen -W "$help" -- "$cur" ) ) + _parse_usage -)' + COMPREPLY=($(compgen -W "$help" -- "$cur")) [[ $cword -eq 1 && $1 == *pkill ]] && _signals - return fi _pnames -s } && -complete -F _pgrep pgrep pkill + complete -F _pgrep pgrep pkill # ex: filetype=sh diff --git a/completions/pidof b/completions/pidof index 0781cfacbc1..a11b432315e 100644 --- a/completions/pidof +++ b/completions/pidof @@ -6,22 +6,22 @@ _pidof() _init_completion || return case $prev in - --help|-V|--version|-!(-*)[hV]*) + --help | -V | --version | -!(-*)[hV]*) return ;; - --omit-pid|-!(-*)o) + --omit-pid | -!(-*)o) _pids return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _pnames } && -complete -F _pidof pidof + complete -F _pidof pidof # ex: filetype=sh diff --git a/completions/pine b/completions/pine index d99a3808b40..943563c2a4b 100644 --- a/completions/pine +++ b/completions/pine @@ -6,27 +6,28 @@ _pine() _init_completion || return case $prev in - -help|-d|-f|-c|-I|-n|-url|-copy_pinerc|-copy_abook) + -help | -d | -f | -c | -I | -n | -url | -copy_pinerc | -copy_abook) return ;; - -attach|-attachlist|-attach_and_delete|-p|-P|-pinerc|-passfile|-x) + -attach | -attachlist | -attach_and_delete | -p | -P | -pinerc | \ + -passfile | -x) _filedir return ;; -sort) - COMPREPLY=( $( compgen -W 'arrival subject threaded orderedsubject - date from size score to cc' -- "$cur") ) + COMPREPLY=($(compgen -W 'arrival subject threaded orderedsubject + date from size score to cc' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) else - COMPREPLY=( $( compgen -W '$( awk "{print \$1}" ~/.addressbook \ - 2>/dev/null)' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(awk "{print \$1}" ~/.addressbook \ + 2>/dev/null)' -- "$cur")) fi } && -complete -F _pine pine alpine + complete -F _pine pine alpine # ex: filetype=sh diff --git a/completions/ping b/completions/ping index 0b4b09a6acb..418dac10d39 100644 --- a/completions/ping +++ b/completions/ping @@ -19,22 +19,22 @@ _ping() # Path MTU strategy in Linux, mask|time in FreeBSD local opts="do want dont" [[ $OSTYPE == *bsd* ]] && opts="mask time" - COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$opts' -- "$cur")) return ;; -*N) if [[ $cur != *= ]]; then - COMPREPLY=( $( compgen -W 'name ipv6 ipv6-global ipv6-sitelocal + COMPREPLY=($(compgen -W 'name ipv6 ipv6-global ipv6-sitelocal ipv6-linklocal ipv6-all ipv4 ipv4-all subject-ipv6= - subject-ipv4= subject-name= subject-fqdn=' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + subject-ipv4= subject-name= subject-fqdn=' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi return ;; -*Q) # TOS in Linux, "somewhat quiet" (no args) in FreeBSD if [[ $OSTYPE != *bsd* ]]; then - COMPREPLY=( $( compgen -W '{0..7}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..7}' -- "$cur")) return fi ;; @@ -45,8 +45,8 @@ _ping() ;; -*T) # Timestamp option in Linux, TTL in FreeBSD - [[ $OSTYPE == *bsd* ]] || \ - COMPREPLY=( $( compgen -W 'tsonly tsandaddr' -- "$cur" ) ) + [[ $OSTYPE == *bsd* ]] || + COMPREPLY=($(compgen -W 'tsonly tsandaddr' -- "$cur")) return ;; -*4*) @@ -58,13 +58,15 @@ _ping() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) return fi [[ $1 == *6 ]] && ipvx=-6 - _known_hosts_real $ipvx -- "$cur" + _known_hosts_real ${ipvx-} -- "$cur" } && -complete -F _ping ping ping6 + complete -F _ping ping ping6 # ex: filetype=sh diff --git a/completions/pkg-config b/completions/pkg-config index 5f4f26ae215..c9c689bb948 100644 --- a/completions/pkg-config +++ b/completions/pkg-config @@ -6,24 +6,24 @@ _pkg_config() _init_completion -s || return case $prev in - --define-variable|--atleast-version|--atleast-pkgconfig-version| \ - --exact-version|--max-version) + --define-variable | --atleast-version | --atleast-pkgconfig-version | \ + --exact-version | --max-version) # argument required but no completions available return ;; --variable) - local i - for (( i=1; i < ${#words[@]}; i++ )); do - if [[ ${words[i]} != -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( "$1" ${words[i]} --print-variables 2>/dev/null )' \ - -- "$cur" ) ) + local word + for word in "${words[@]:1}"; do + if [[ $word != -* ]]; then + COMPREPLY=($(compgen -W \ + '$("$1" $word --print-variables 2>/dev/null)' \ + -- "$cur")) break fi done return ;; - -\?|--help|--version|--usage) + -\? | --help | --version | --usage) # all other arguments are noop with these return ;; @@ -31,15 +31,15 @@ _pkg_config() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W "$( $1 --list-all \ - 2>/dev/null | awk '{print $1}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 --list-all \ + 2>/dev/null | awk '{print $1}')" -- "$cur")) _filedir pc fi } && -complete -F _pkg_config pkg-config + complete -F _pkg_config pkg-config pkgconf # ex: filetype=sh diff --git a/completions/pkg-get b/completions/pkg-get index d5382eb2545..3ebd0c8c288 100644 --- a/completions/pkg-get +++ b/completions/pkg-get @@ -15,7 +15,7 @@ _pkg_get_get_catalog_file() done conffile="${conffile:-/opt/csw/etc/pkg-get.conf}" - if [[ -z "$url" ]]; then + if [[ -z $url ]]; then url=$(awk -F= ' $1=="url" { print $2 }' $conffile) fi @@ -25,49 +25,49 @@ _pkg_get_get_catalog_file() echo "$catalog_file" } && -_pkg_get() -{ - local cur prev file catalog_file url command - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - - if [[ "${prev}" == "-s" ]]; then - return 1 - fi + _pkg_get() + { + local cur prev file catalog_file url command + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD - 1]}" - i=${#COMP_WORDS[*]} - while [[ $i -gt 0 ]]; do - i=$((i-1)) - if [[ "${COMP_WORDS[$i]}" == -s ]]; then - url="${COMP_WORDS[$((i+1))]}" + if [[ ${prev} == "-s" ]]; then + return 1 fi - if [[ "${COMP_WORDS[$i]}" == @(-[aDdiUu]|available|describe|download|install|list|updatecatalog|upgrade) ]]; then - command="${COMP_WORDS[$i]}" - fi - done - if [[ -n "$command" ]]; then - if [[ "$command" == @(-[Ddi]|describe|download|install) ]]; then - catalog_file=$(_pkg_get_get_catalog_file "$url") - if [[ -f $catalog_file ]]; then - local packages_list=$(awk ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' $catalog_file) - COMPREPLY=( $(compgen -W "${packages_list}" -- ${cur}) ) + local i=${#COMP_WORDS[*]} + while ((i > 0)); do + if [[ ${COMP_WORDS[--i]} == -s ]]; then + url="${COMP_WORDS[i + 1]}" + fi + if [[ ${COMP_WORDS[i]} == @(-[aDdiUu]|available|describe|download|install|list|updatecatalog|upgrade) ]]; then + command="${COMP_WORDS[i]}" + fi + done + + if [[ -v command ]]; then + if [[ $command == @(-[Ddi]|describe|download|install) ]]; then + catalog_file=$(_pkg_get_get_catalog_file "$url") + if [[ -f $catalog_file ]]; then + local packages_list=$(awk ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' $catalog_file) + COMPREPLY=($(compgen -W "${packages_list}" -- ${cur})) + fi fi + return fi - return - fi - if [[ ${cur} == -* ]] ; then - local opts="-c -d -D -f -i -l -s -S -u -U -v" - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) - return - fi + if [[ ${cur} == -* ]]; then + local -a opts=(-c -d -D -f -i -l -s -S -u -U -v) + COMPREPLY=($(compgen -W '${opts[@]}' -- ${cur})) + return + fi - local commands="available describe download install list \ - updatecatalog upgrade" - COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) ) -} && -complete -F _pkg_get pkg-get + local -a commands=( + available describe download install list updatecatalog upgrade + ) + COMPREPLY=($(compgen -W '${commands[@]}' -- ${cur})) + } && + complete -F _pkg_get pkg-get # ex: filetype=sh diff --git a/completions/pkg_delete b/completions/pkg_delete index 9125829d58c..2abb6714b1d 100644 --- a/completions/pkg_delete +++ b/completions/pkg_delete @@ -1,6 +1,4 @@ -# bash completion for FreeBSD package management tools -*- shell-script -*- - -[[ $OSTYPE == *freebsd* ]] || return 1 +# bash completion for *BSD package management tools -*- shell-script -*- _pkg_delete() { @@ -9,12 +7,12 @@ _pkg_delete() local pkgdir=${PKG_DBDIR:-/var/db/pkg}/ - [[ "$prev" == -o || "$prev" == -p || "$prev" == -W ]] && return + [[ $prev == -o || $prev == -p || $prev == -W ]] && return - COMPREPLY=( $( compgen -d -- "$pkgdir$cur" ) ) - COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) + COMPREPLY=($(compgen -d -- "$pkgdir$cur")) + ((${#COMPREPLY[@]} == 0)) || COMPREPLY=(${COMPREPLY[@]#$pkgdir}) } && -complete -F _pkg_delete -o dirnames pkg_delete pkg_info pkg_deinstall + complete -F _pkg_delete -o dirnames pkg_delete pkg_info pkg_deinstall # ex: filetype=sh diff --git a/completions/pkgadd b/completions/pkgadd index 009f3a25460..f8b7f9ef5ff 100644 --- a/completions/pkgadd +++ b/completions/pkgadd @@ -2,7 +2,7 @@ # # Copyright 2006 Yann Rouillard -_pkgadd () +_pkgadd() { local cur prev words cword _init_completion -n : || return @@ -12,10 +12,10 @@ _pkgadd () # available in this directory local device=/var/spool/pkg local i=$cword - while [[ $((i--)) -gt 0 ]]; do - case "${words[$i]}" in + while ((i-- > 0)); do + case "${words[i]}" in -d) - device="${words[$((i+1))]}" + device="${words[i + 1]}" break ;; esac @@ -26,35 +26,37 @@ _pkgadd () _filedir pkg _filedir -d ;; - -a|-r|-V) + -a | -r | -V) _filedir ;; - -k|-s|-R) + -k | -s | -R) _filedir -d ;; - -P|-k|-x) - ;; + -P | -x) ;; + *) - if [[ ${cur} == -* ]] ; then - local opts="-a -A -d -k -n -M -P -r -R -s -v -V -x" - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + if [[ ${cur} == -* ]]; then + local -a opts=(-a -A -d -k -n -M -P -r -R -s -v -V -x) + COMPREPLY=($(compgen -W '${opts[@]}' -- ${cur})) else local pkginst_list if [[ -d $device ]]; then + local -a tmplist for filedir in $(/bin/ls -1 $device); do - if [[ -d "$device/$filedir" ]] && [[ -f "$device/$filedir/pkginfo" ]]; then - pkginst_list+=( ${pkginst_list[@]:-} "$filedir" ) + if [[ -d "$device/$filedir" && -f "$device/$filedir/pkginfo" ]]; then + tmplist+=(${tmplist[@]:-} "$filedir") fi done - pkginst_list="${pkginst_list[@]}" + pkginst_list="${tmplist[*]}" else - pkginst_list=$(strings $(dequote $device) | \ - command grep "^PKG=" | sort -u | cut -d= -f2) + pkginst_list="$(strings "$(dequote $device)" | + command grep ^PKG= | sort -u | cut -d= -f2)" + fi + COMPREPLY=($(compgen -W "$pkginst_list" -- ${cur})) fi - COMPREPLY=( $(compgen -W "$pkginst_list" -- ${cur}) ) - fi + ;; esac } && -complete -F _pkgadd pkgadd + complete -F _pkgadd pkgadd # ex: filetype=sh diff --git a/completions/pkgrm b/completions/pkgrm index 891507f839c..2449d3497f1 100644 --- a/completions/pkgrm +++ b/completions/pkgrm @@ -2,7 +2,7 @@ # # Copyright 2006 Yann Rouillard -_pkgrm () +_pkgrm() { local cur prev words cword _init_completion || return @@ -12,13 +12,13 @@ _pkgrm () # available in this directory local spool=/var/sadm/pkg local i=$cword - while [[ $((i--)) -gt 0 ]]; do - i=$((i-1)) - case "${words[$i]}" in + while ((i-- > 0)); do + ((i--)) + case "${words[i]}" in -s) - spool="${words[$((i+1))]}" + spool="${words[i + 1]}" break - ;; + ;; esac done @@ -29,8 +29,8 @@ _pkgrm () -s | -R) _filedir -d ;; - -Y) - ;; + -Y) ;; + *) if [[ ${cur} == -* ]]; then local opts="-a -A -n -M -R -s -v -V -Y" @@ -38,9 +38,9 @@ _pkgrm () else COMPREPLY=($(compgen -W "$(/bin/ls -1 $spool)" -- ${cur})) fi - ;; + ;; esac } && -complete -F _pkgrm pkgrm + complete -F _pkgrm pkgrm # ex: filetype=sh diff --git a/completions/pkgtool b/completions/pkgtool index 95d42aaaab5..951bae40b87 100644 --- a/completions/pkgtool +++ b/completions/pkgtool @@ -6,7 +6,7 @@ _pkgtool() _init_completion || return case "$prev" in - --source_dir|--target_dir) + --source_dir | --target_dir) _filedir -d return ;; @@ -15,7 +15,7 @@ _pkgtool() return ;; --source_device) - COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) ) + COMPREPLY=($(compgen -f -d -- "${cur:-/dev/}")) return ;; --tagfile) @@ -24,12 +24,12 @@ _pkgtool() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--sets --ignore-tagfiles --tagfile + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--sets --ignore-tagfiles --tagfile --source-mounted --source_dir --target_dir --source_device' \ - -- "$cur" ) ) + -- "$cur")) fi } && -complete -F _pkgtool pkgtool + complete -F _pkgtool pkgtool # ex: filetype=sh diff --git a/completions/pkgutil b/completions/pkgutil index 4b2fcdcd888..1852778d7b4 100644 --- a/completions/pkgutil +++ b/completions/pkgutil @@ -18,78 +18,97 @@ _pkgutil() _init_completion -n : || return local command catalog_files configuration_files - declare -a configuration_files=("/opt/csw/etc/pkgutil.conf" "/etc/opt/csw/pkgutil.conf") + declare -a configuration_files=( + "/opt/csw/etc/pkgutil.conf" "/etc/opt/csw/pkgutil.conf") declare -a catalog_files=() - i=$cword - while [[ $((i--)) -gt 1 ]]; do - if [[ "${words[$i]}" == -@(t|-temp) ]]; then - local url="${words[$((i+1))]}" + local i=$cword + while ((i-- > 1)); do + if [[ ${words[i]} == -@(t|-temp) ]]; then + local url="${words[i + 1]}" local catalog=$(_pkgutil_url2catalog "$url") catalog_files=("$catalog") - elif [[ "${words[$i]}" == --config ]]; then - configuration_files=( "$(dequote ${words[$((i+1))]})" ) - elif [[ "${words[$i]}" == -@([iurdacUS]|-install|-upgrade|-remove|-download|-available|-compare|-catalog|-stream) ]]; then - command="${words[$i]}" + elif [[ ${words[i]} == --config ]]; then + configuration_files=("$(dequote ${words[i + 1]})") + elif [[ ${words[i]} == -@([iurdacUS]|-install|-upgrade|-remove|-download|-available|-compare|-catalog|-stream) ]]; then + command="${words[i]}" fi done - if [[ "$prev" == -@([WPR]|-workdir|-pkgdir|-rootpath) ]]; then + if [[ $prev == -@([WPR]|-workdir|-pkgdir|-rootpath) ]]; then _filedir -d return fi - if [[ "$prev" == -@(o|-output|-config) ]]; then + if [[ $prev == -@(o|-output|-config) ]]; then _filedir return fi - if [[ "$prev" == -@(p|-param) ]]; then + if [[ $prev == -@(p|-param) ]]; then compopt -o nospace - COMPREPLY=( $(compgen -W "mirror: pkgaddopts: pkgrmopts: wgetopts: use_gpg: use_md5: pkgliststyle: maxpkglist: noncsw: stop_on_hook_soft_error: exclude_pattern: gpg_homedir: root_path: deptree_filter_common: show_current: catalog_not_cached: catalog_update:" -- $cur) ) + COMPREPLY=($(compgen -W " + mirror: pkgaddopts: pkgrmopts: wgetopts: use_gpg: use_md5: + pkgliststyle: maxpkglist: noncsw: stop_on_hook_soft_error: + exclude_pattern: gpg_homedir: root_path: deptree_filter_common: + show_current: catalog_not_cached: catalog_update: + " -- $cur)) return fi - if [[ "$prev" == @(-T|--target) ]]; then + if [[ $prev == @(-T|--target) ]]; then # Work-around bash_completion issue where bash interprets a colon # as a separator, borrowed from maven completion code which borrowed # it from darcs completion code :) local colonprefixes=${cur%"${cur##*:}"} - COMPREPLY=( $(compgen -W "sparc:5.9 sparc:5.10 sparc:5.11 i386:5.9 i386:5.10 i386:5.11" -- $cur) ) + COMPREPLY=($( + compgen -W \ + "sparc:5.9 sparc:5.10 sparc:5.11 i386:5.9 i386:5.10 i386:5.11" \ + -- $cur + )) local i=${#COMPREPLY[*]} - while [ $((--i)) -ge 0 ]; do - COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"} + while ((i-- > 0)); do + COMPREPLY[i]=${COMPREPLY[i]#"$colonprefixes"} done return fi - if [[ -n "$command" ]] && [[ ! "$cur" == -* ]]; then + if [[ -v command && $cur != -* ]]; then local mirrors mirror_url - mirrors=$(awk -F= ' $1 ~ /^ *mirror *$/ { print $2 }' ${configuration_files[@]}) + mirrors=$(awk -F= ' $1 ~ /^ *mirror *$/ { print $2 }' "${configuration_files[@]}") mirrors=${mirrors:-http://mirror.opencsw.org/opencsw/testing} for mirror_url in $mirrors; do local catalog=$(_pkgutil_url2catalog "$mirror_url") - catalog_files=( "${catalog_files[@]}" "$catalog" ) + catalog_files=("${catalog_files[@]}" "$catalog") done - if [[ "$command" == -@([dius]|-download|-install|-upgrade|-stream) ]]; then + if [[ $command == -@([dius]|-download|-install|-upgrade|-stream) ]]; then local packages_list=$(awk ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' "${catalog_files[@]}") - COMPREPLY=( $(compgen -W "${packages_list}" -- $cur) ) + COMPREPLY=($(compgen -W "${packages_list}" -- $cur)) - elif [[ "$command" == @(-r|--remove) ]]; then - local packages_list=$(pkginfo | awk ' $2 ~ /^CSW/ { printf ("%s|",$2) }') + elif [[ $command == @(-r|--remove) ]]; then + local packages_list=$( + pkginfo | awk ' $2 ~ /^CSW/ { printf ("%s|",$2) }' + ) packages_list=${packages_list%|} packages_list=$(nawk " \$3 ~ /^$packages_list\$/ { print \$1 }" "${catalog_files[@]}") - COMPREPLY=( $(compgen -W "${packages_list}" -- $cur) ) + COMPREPLY=($(compgen -W "${packages_list}" -- $cur)) fi return fi - local commands="-i --install -u --upgrade -r --remove -d --download -U --catalog -a --available --describe -c --compare -C --compare-diff -A --compare-avail -e --email -t --temp -x --exclude -W --workdir -P --pkgdir -R --rootpath --config -y --yes -f --force -n --nomod -N --nodeps -D --debug --trace -h --help -v --version -V --syscheck -l --list -L --listfile -F --findfile --deptree --extract -s --stream -o --output -T --target --single -p --param --parse --cleanup --catinfo" - COMPREPLY=( $(compgen -W "${commands}" -- $cur) ) + local -a commands=( + --install --upgrade --remove --download --catalog --available + --describe --compare --compare-diff --compare-avail --email --temp + --exclude --workdir --pkgdir --rootpath --config --yes --force --nomod + --nodeps --debug --trace --help --version --syscheck --list --listfile + --findfile --deptree --extract --stream --output --target --single + --param --parse --cleanup --catinfo + ) + COMPREPLY=($(compgen -W '${commands[@]}' -- $cur)) } && -complete -F _pkgutil pkgutil + complete -F _pkgutil pkgutil # ex: filetype=sh diff --git a/completions/plague-client b/completions/plague-client index 6fd22f75188..4e9820631d0 100644 --- a/completions/plague-client +++ b/completions/plague-client @@ -5,10 +5,10 @@ _plague_client() local cur prev words cword _init_completion || return - [[ $cword -eq 1 ]] && \ - COMPREPLY=( $( compgen -W 'build detail finish help is_paused kill list - list_builders pause requeue unpause update_builders' -- "$cur" ) ) + ((cword == 1)) && + COMPREPLY=($(compgen -W 'build detail finish help is_paused kill list + list_builders pause requeue unpause update_builders' -- "$cur")) } && -complete -F _plague_client plague-client + complete -F _plague_client plague-client # ex: filetype=sh diff --git a/completions/pm-hibernate b/completions/pm-hibernate index fcabbfaf83e..ea3b0aa744a 100644 --- a/completions/pm-hibernate +++ b/completions/pm-hibernate @@ -5,8 +5,8 @@ _pm_action() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W "--help $( _parse_help "$1" )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "--help $(_parse_help "$1")" -- "$cur")) } && -complete -F _pm_action pm-hibernate pm-suspend pm-suspend-hybrid + complete -F _pm_action pm-hibernate pm-suspend pm-suspend-hybrid # ex: filetype=sh diff --git a/completions/pm-is-supported b/completions/pm-is-supported index 2eeb634d6ff..adc7fde757c 100644 --- a/completions/pm-is-supported +++ b/completions/pm-is-supported @@ -5,9 +5,9 @@ _pm_is_supported() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W '--help --suspend --hibernate --suspend-hybrid' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '--help --suspend --hibernate --suspend-hybrid' \ + -- "$cur")) } && -complete -F _pm_is_supported pm-is-supported + complete -F _pm_is_supported pm-is-supported # ex: filetype=sh diff --git a/completions/pm-powersave b/completions/pm-powersave index f61833cf180..affb195d8fe 100644 --- a/completions/pm-powersave +++ b/completions/pm-powersave @@ -5,8 +5,8 @@ _pm_powersave() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + COMPREPLY=($(compgen -W "true false" -- "$cur")) } && -complete -F _pm_powersave pm-powersave + complete -F _pm_powersave pm-powersave # ex: filetype=sh diff --git a/completions/pngfix b/completions/pngfix index b1f630ed453..64b5481ddb4 100644 --- a/completions/pngfix +++ b/completions/pngfix @@ -6,7 +6,7 @@ _pngfix() _init_completion -s || return case $prev in - --suffix|--prefix) + --suffix | --prefix) return ;; --output) @@ -14,8 +14,9 @@ _pngfix() return ;; --strip) - COMPREPLY=( $( IFS='|' compgen -W '$( "$1" --help 2>&1 | - command sed -ne "s/.*--strip=\[\([^]]*\)\].*/\1/p" )' -- "$cur" ) ) + COMPREPLY=($(IFS='|' compgen -W '$("$1" --help 2>&1 | + command sed -ne "s/.*--strip=\[\([^]]*\)\].*/\1/p")' \ + -- "$cur")) return ;; esac @@ -23,13 +24,13 @@ _pngfix() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir png } && -complete -F _pngfix pngfix + complete -F _pngfix pngfix # ex: filetype=sh diff --git a/completions/portinstall b/completions/portinstall index 314e936f136..803374071b5 100644 --- a/completions/portinstall +++ b/completions/portinstall @@ -13,19 +13,19 @@ _portinstall() # First try INDEX-5 indexfile=$portsdir/INDEX-5 # Then INDEX if INDEX-5 does not exist or system is not FreeBSD 5.x - [[ "${OSTYPE%.*}" == freebsd5 && -f $indexfile ]] || + [[ ${OSTYPE%.*} == freebsd5 && -f $indexfile ]] || indexfile=$portsdir/INDEX - [[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return + [[ $prev == -l || $prev == -L || $prev == -o ]] && return - COMPREPLY=( $( command grep -E "^$cur" 2>/dev/null < $indexfile | \ - cut -d'|' -f1 ) ) - COMPREPLY2=( $( command grep -E "^[^\|]+\|$portsdir$cur" 2>/dev/null \ - < $indexfile | cut -d'|' -f2 ) ) - COMPREPLY2=( ${COMPREPLY2[@]#$portsdir} ) - COMPREPLY+=( "${COMPREPLY2[@]}" ) + COMPREPLY=($(command grep -E "^$cur" 2>/dev/null <$indexfile | + cut -d'|' -f1)) + COMPREPLY2=($(command grep -E "^[^\|]+\|$portsdir$cur" 2>/dev/null \ + <$indexfile | cut -d'|' -f2)) + COMPREPLY2=(${COMPREPLY2[@]#$portsdir}) + COMPREPLY+=("${COMPREPLY2[@]}") } && -complete -F _portinstall -o dirnames portinstall + complete -F _portinstall -o dirnames portinstall # ex: filetype=sh diff --git a/completions/portsnap b/completions/portsnap index f865183b637..a2f0a936a44 100644 --- a/completions/portsnap +++ b/completions/portsnap @@ -8,18 +8,18 @@ _portsnap() _init_completion || return case $prev in - -d|-p) + -d | -p) _filedir -d return ;; - -l|-f) + -l | -f) _filedir return ;; esac - COMPREPLY=( $(compgen -W "fetch cron extract update" -- $cur) ) + COMPREPLY=($(compgen -W "fetch cron extract update" -- $cur)) } && -complete -F _portsnap portsnap + complete -F _portsnap portsnap # ex: filetype=sh diff --git a/completions/portupgrade b/completions/portupgrade index 64d983df080..ffe63056ad8 100644 --- a/completions/portupgrade +++ b/completions/portupgrade @@ -5,15 +5,15 @@ _portupgrade() local cur prev words cword _init_completion || return - [[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return + [[ $prev == -l || $prev == -L || $prev == -o ]] && return local pkgdir=${PKG_DBDIR:-/var/db/pkg}/ - COMPREPLY=( $( compgen -d -- "$pkgdir$cur" ) ) - COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) - COMPREPLY=( ${COMPREPLY[@]%-*} ) + COMPREPLY=($(compgen -d -- "$pkgdir$cur")) + COMPREPLY=(${COMPREPLY[@]#$pkgdir}) + COMPREPLY=(${COMPREPLY[@]%-*}) } && -complete -F _portupgrade -o dirnames portupgrade + complete -F _portupgrade -o dirnames portupgrade # ex: filetype=sh diff --git a/completions/postcat b/completions/postcat index 69214354e3b..a58b0e5781d 100644 --- a/completions/postcat +++ b/completions/postcat @@ -13,22 +13,20 @@ _postcat() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi local idx qfile=0 for idx in "${words[@]}"; do - [[ "$idx" == -q ]] && qfile=1 && break + [[ $idx == -q ]] && qfile=1 && break done - if [[ $qfile -eq 1 ]]; then + if ((qfile == 1)); then local len=${#cur} pval - idx=0 - for pval in $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do - if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + for pval in $(mailq 2>/dev/null | + command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//'); do + if [[ $cur == "${pval:0:len}" ]]; then + COMPREPLY+=($pval) fi done return @@ -36,6 +34,6 @@ _postcat() _filedir } && -complete -F _postcat postcat + complete -F _postcat postcat # ex: filetype=sh diff --git a/completions/postconf b/completions/postconf index c1f17d9d34c..4cb324c125d 100644 --- a/completions/postconf +++ b/completions/postconf @@ -8,7 +8,7 @@ _postconf() local eqext case $prev in - -b|-t) + -b | -t) _filedir return ;; @@ -23,18 +23,17 @@ _postconf() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi - local len=${#cur} idx=0 pval - for pval in $( /usr/sbin/postconf 2>/dev/null | cut -d ' ' -f 1 ); do - if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]="$pval$eqext" - idx=$(($idx+1)) + local len=${#cur} pval + for pval in $(/usr/sbin/postconf 2>/dev/null | cut -d ' ' -f 1); do + if [[ $cur == "${pval:0:len}" ]]; then + COMPREPLY+=("$pval${eqext-}") fi done } && -complete -F _postconf postconf + complete -F _postconf postconf # ex: filetype=sh diff --git a/completions/postfix b/completions/postfix index 9b116be1d4f..f96055027fa 100644 --- a/completions/postfix +++ b/completions/postfix @@ -11,19 +11,23 @@ _postfix() return ;; -D) - COMPREPLY=( $( compgen -W 'start' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'start' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($( + compgen -W \ + '$(_bashcomp_try_faketty "$1" --help 2>&1 | _parse_usage -)' \ + -- "$cur" + )) return fi - COMPREPLY=( $( compgen -W 'check start stop abort flush reload status - set-permissions upgrade-configuration' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'check start stop abort flush reload status + set-permissions upgrade-configuration' -- "$cur")) } && -complete -F _postfix postfix + complete -F _postfix postfix # ex: filetype=sh diff --git a/completions/postmap b/completions/postmap index 1b415f69d61..35c4ada15c6 100644 --- a/completions/postmap +++ b/completions/postmap @@ -16,27 +16,26 @@ _postmap() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi - if [[ "$cur" == *:* ]]; then + if [[ $cur == *:* ]]; then compopt -o filenames - COMPREPLY=( $( compgen -f -- "${cur#*:}" ) ) + COMPREPLY=($(compgen -f -- "${cur#*:}")) else - local len=${#cur} idx=0 pval - for pval in $( /usr/sbin/postconf -m 2>/dev/null ); do - if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]="$pval:" - idx=$(($idx+1)) + local len=${#cur} pval + for pval in $(/usr/sbin/postconf -m 2>/dev/null); do + if [[ $cur == "${pval:0:len}" ]]; then + COMPREPLY+=("$pval:") fi done - if [[ $idx -eq 0 ]]; then + if [[ ! ${COMPREPLY-} ]]; then compopt -o filenames - COMPREPLY=( $( compgen -f -- "$cur" ) ) + COMPREPLY=($(compgen -f -- "$cur")) fi fi } && -complete -F _postmap postmap postalias + complete -F _postmap postmap postalias # ex: filetype=sh diff --git a/completions/postsuper b/completions/postsuper index e69cbea0ccc..19b265f95c1 100644 --- a/completions/postsuper +++ b/completions/postsuper @@ -5,7 +5,7 @@ _postsuper() local cur prev words cword _init_completion || return - local pval len idx + local pval len case $prev in -c) @@ -14,36 +14,31 @@ _postsuper() ;; -[dr]) len=${#cur} - idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do - if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + for pval in ALL $(mailq 2>/dev/null | + command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//'); do + if [[ $cur == "${pval:0:len}" ]]; then + COMPREPLY+=($pval) fi done return ;; -h) len=${#cur} - idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d' ); do - if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + for pval in ALL $(mailq 2>/dev/null | + command sed \ + -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d'); do + if [[ $cur == "${pval:0:len}" ]]; then + COMPREPLY+=($pval) fi done return ;; -H) len=${#cur} - idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do - if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + for pval in ALL $(mailq 2>/dev/null | command sed -e \ + '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//'); do + if [[ $cur == "${pval:0:len}" ]]; then + COMPREPLY+=($pval) fi done return @@ -51,12 +46,12 @@ _postsuper() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi - COMPREPLY=( $( compgen -W 'hold incoming active deferred' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'hold incoming active deferred' -- "$cur")) } && -complete -F _postsuper postsuper + complete -F _postsuper postsuper # ex: filetype=sh diff --git a/completions/povray b/completions/povray index e90279b3caa..1910d7f0849 100644 --- a/completions/povray +++ b/completions/povray @@ -16,35 +16,43 @@ _povray() cur="${povcur#[-+]I}" # to confuse _filedir pfx="${povcur%"$cur"}" _filedir pov - COMPREPLY=( ${COMPREPLY[@]/#/$pfx} ) + COMPREPLY=(${COMPREPLY[@]/#/$pfx}) return ;; [-+]O*) # guess what output file type user may want - case $( ( IFS=$'\n'; command grep '^[-+]F' <<<"${words[*]}" ) ) in + case $( + IFS=$'\n' + command grep '^[-+]F' <<<"${words[*]}" + ) in [-+]FN) oext=png ;; [-+]FP) oext=ppm ;; [-+]F[CT]) oext=tga ;; *) oext=$defoext ;; esac # complete filename corresponding to previously specified +I - COMPREPLY=( $( ( IFS=$'\n'; command grep '^[-+]I' <<<"${words[*]}" ) ) ) - COMPREPLY=( ${COMPREPLY[@]#[-+]I} ) - COMPREPLY=( ${COMPREPLY[@]/%.pov/.$oext} ) + COMPREPLY=($( + IFS=$'\n' + command grep '^[-+]I' <<<"${words[*]}" + )) + COMPREPLY=(${COMPREPLY[@]#[-+]I}) + COMPREPLY=(${COMPREPLY[@]/%.pov/.$oext}) cur="${povcur#[-+]O}" # to confuse _filedir pfx="${povcur%"$cur"}" _filedir $oext - COMPREPLY=( ${COMPREPLY[@]/#/$pfx} ) + COMPREPLY=(${COMPREPLY[@]/#/$pfx}) return ;; - *.ini\[|*.ini\[*[^]]) # sections in .ini files + *.ini\[ | *.ini\[*[^]]) # sections in .ini files cur="${povcur#*\[}" pfx="${povcur%\["$cur"}" # prefix == filename [[ -r $pfx ]] || return - COMPREPLY=( $(command sed -e 's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/' \ - -e 't' -e 'd' -- "$pfx") ) + COMPREPLY=($( + command sed -e 's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/' \ + -e 't' -e 'd' -- "$pfx" + )) # to prevent [bar] expand to nothing. can be done more easily? - COMPREPLY=( "${COMPREPLY[@]/#/$pfx[}" ) + COMPREPLY=("${COMPREPLY[@]/#/${pfx}[}") return ;; *) @@ -53,6 +61,6 @@ _povray() ;; esac } && -complete -F _povray povray xpovray spovray + complete -F _povray povray xpovray spovray # ex: filetype=sh diff --git a/completions/prelink b/completions/prelink index 0db3140c954..1c39611f630 100644 --- a/completions/prelink +++ b/completions/prelink @@ -6,18 +6,18 @@ _prelink() _init_completion -s || return case $prev in - -'?'|--help|--usage|-V|--version|-r|--reloc-only) + -'?' | --help | --usage | -V | --version | -r | --reloc-only) return ;; - -b|--black-list|--dynamic-linker|--undo-output) + -b | --black-list | --dynamic-linker | --undo-output) _filedir return ;; - -c|--config-file) + -c | --config-file) _filedir conf return ;; - -C|--cache) + -C | --cache) _filedir cache return ;; @@ -30,13 +30,13 @@ _prelink() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _prelink prelink + complete -F _prelink prelink # ex: filetype=sh diff --git a/completions/printenv b/completions/printenv new file mode 100644 index 00000000000..3553e83db5c --- /dev/null +++ b/completions/printenv @@ -0,0 +1,23 @@ +# printenv(1) completion -*- shell-script -*- + +_printenv() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help | --version) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + return + fi + + COMPREPLY=($(compgen -v -- "$cur")) +} && + complete -F _printenv printenv + +# ex: filetype=sh diff --git a/completions/protoc b/completions/protoc index 1d4bef16775..10294f5cf9a 100644 --- a/completions/protoc +++ b/completions/protoc @@ -6,11 +6,7 @@ _protoc() _init_completion -s || return case $prev in - --proto_path|--cpp_out|--java_out|--python_out) - _filedir -d - return - ;; - --version|-h|--help|--encode|--decode) + --version | -h | --help | --encode | --decode) return ;; --descriptor_set_out) @@ -18,16 +14,20 @@ _protoc() return ;; --error_format) - COMPREPLY=( $( compgen -W 'gcc msvs' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'gcc msvs' -- "$cur")) return ;; --plugin) if [[ $cur != *=* ]]; then compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) fi return ;; + --proto_path | --*_out) + _filedir -d + return + ;; esac $split && return @@ -36,28 +36,28 @@ _protoc() -o*) cur=${cur:2} _filedir - COMPREPLY=( "${COMPREPLY[@]/#/-o}" ) + COMPREPLY=("${COMPREPLY[@]/#/-o}") return ;; -I*) cur=${cur:2} _filedir -d - COMPREPLY=( "${COMPREPLY[@]/#/-I}" ) + COMPREPLY=("${COMPREPLY[@]/#/-I}") return ;; -*) - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) local i - for i in ${!COMPREPLY[@]}; do - [[ ${COMPREPLY[i]} == -oFILE ]] && unset 'COMPREPLY[i]' + for i in "${!COMPREPLY[@]}"; do + [[ ${COMPREPLY[i]} == -oFILE ]] && unset -v 'COMPREPLY[i]' done - [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; esac _filedir proto } && -complete -F _protoc protoc + complete -F _protoc protoc # ex: filetype=sh diff --git a/completions/ps b/completions/ps new file mode 100644 index 00000000000..c3d1e06acc6 --- /dev/null +++ b/completions/ps @@ -0,0 +1,75 @@ +# bash completion for ps(1) -*- shell-script -*- + +_comp_cmd_ps() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help) + COMPREPLY=($(compgen -W 'simple list output threads misc all' \ + -- "$cur")) + return + ;; + --info | V | --version) + return + ;; + -C) + _pnames + return + ;; + -[Gg] | --[Gg]roup) + COMPREPLY=($(compgen -g -- "$cur")) + return + ;; + ?(-)p | [^-]*p | --pid) + _pids + return + ;; + --ppid) + _pids # TODO: Only pids with children? + return + ;; + ?(-)q | [^-]*q | --quick-pid) + _pids + return + ;; + -s | --sid) + # TODO + return + ;; + ?(-)t | [^-]*t | --tty) + COMPREPLY=($( + shopt -s nullglob + printf '%s\n' /dev/tty* + )) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}" "${COMPREPLY[@]#/dev/}"' \ + -- "$cur")) + return + ;; + ?(-)U | [^-]*U | -u | --[Uu]ser) + COMPREPLY=($(compgen -u -- "$cur")) + return + ;; + --format | ?(-)[Oo] | [^-]*[Oo]) + # TODO: This doesn't work well when there are multiple options for + # the non-first item (similarly to useradd --groups and others). + _comp_delimited , -W "$("$1" L | awk '{ print $1 }')" + return + ;; + esac + + if [[ $cur == -* ]]; then + # sed: strip single char dashless ", x," that trip _parse_help + local opts=$({ + "$1" --help + "$1" --help all + } 2>/dev/null | + sed -e "s/, [A-Za-z],/,/" | _parse_help -) + COMPREPLY=($(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur")) + fi +} && + complete -F _comp_cmd_ps ps + +# ex: filetype=sh diff --git a/completions/psql b/completions/psql index 8f5d1200f9a..e019d596b1c 100644 --- a/completions/psql +++ b/completions/psql @@ -4,16 +4,16 @@ _pg_databases() { # -w was introduced in 8.4, https://launchpad.net/bugs/164772 # "Access privileges" in output may contain linefeeds, hence the NF > 1 - COMPREPLY=( $( compgen -W "$( psql -XAtqwlF $'\t' 2>/dev/null | \ - awk 'NF > 1 { print $1 }' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(psql -XAtqwlF $'\t' 2>/dev/null | + awk 'NF > 1 { print $1 }')" -- "$cur")) } _pg_users() { # -w was introduced in 8.4, https://launchpad.net/bugs/164772 - COMPREPLY=( $( compgen -W "$( psql -XAtqwc 'select usename from pg_user' \ - template1 2>/dev/null )" -- "$cur" ) ) - [[ ${#COMPREPLY[@]} -eq 0 ]] && COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(psql -XAtqwc 'select usename from pg_user' \ + template1 2>/dev/null)" -- "$cur")) + ((${#COMPREPLY[@]} == 0)) && COMPREPLY=($(compgen -u -- "$cur")) } # createdb(1) completion @@ -24,29 +24,30 @@ _createdb() _init_completion -s || return case $prev in - --host|-!(-*)h) + --host | -!(-*)h) _known_hosts_real -- "$cur" return ;; - --username|--owner|-!(-*)[UO]) + --username | --owner | -!(-*)[UO]) _pg_users return ;; - --help|--version|--port|--tablespace|--encoding|--template|-!(-*)[pDET]) + --help | --version | --port | --tablespace | --encoding | --template | \ + -!(-*)[pDET]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _pg_databases fi } && -complete -F _createdb createdb + complete -F _createdb createdb # createuser(1) completion # @@ -56,14 +57,14 @@ _createuser() _init_completion -s || return case $prev in - --help|--version|--port|--connection-limit|-!(-*)[pc]) + --help | --version | --port | --connection-limit | -!(-*)[pc]) return ;; - --host|-!(-*)h) + --host | -!(-*)h) _known_hosts_real -- "$cur" return ;; - --username|-!(-*)U) + --username | -!(-*)U) _pg_users return ;; @@ -71,12 +72,12 @@ _createuser() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _createuser createuser + complete -F _createuser createuser # dropdb(1) completion # @@ -86,29 +87,29 @@ _dropdb() _init_completion -s || return case $prev in - --host|-!(-*)h) + --host | -!(-*)h) _known_hosts_real -- "$cur" return ;; - --username|-!(-*)U) + --username | -!(-*)U) _pg_users return ;; - --help|--version) + --help | --version) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _pg_databases fi } && -complete -F _dropdb dropdb + complete -F _dropdb dropdb # dropuser(1) completion # @@ -118,14 +119,14 @@ _dropuser() _init_completion -s || return case $prev in - --help|--version|--port|-!(-*)p) + --help | --version | --port | -!(-*)p) return ;; - --host|-!(-*)h) + --host | -!(-*)h) _known_hosts_real -- "$cur" return ;; - --username|-!(-*)U) + --username | -!(-*)U) _pg_users return ;; @@ -133,14 +134,14 @@ _dropuser() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else _pg_users fi } && -complete -F _dropuser dropuser + complete -F _dropuser dropuser # psql(1) completion # @@ -150,39 +151,40 @@ _psql() _init_completion -s || return case $prev in - --host|-!(-*)h) + --host | -!(-*)h) _known_hosts_real -- "$cur" return ;; - --username|-!(-*)U) + --username | -!(-*)U) _pg_users return ;; - --dbname|-!(-*)d) + --dbname | -!(-*)d) _pg_databases return ;; - --output|--file|--log-file|-!(-*)[ofL]) + --output | --file | --log-file | -!(-*)[ofL]) _filedir return ;; - --help|--version|--command|--field-separator|--port|--pset|\ - --record-separator|--table-attr|--set|--variable|-!(-*)[?VcFpPRTv]) + --help | --version | --command | --field-separator | --port | --pset | \ + --record-separator | --table-attr | --set | --variable | \ + -!(-*)[?VcFpPRTv]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # return list of available options - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else # return list of available databases _pg_databases fi } && -complete -F _psql psql + complete -F _psql psql # ex: filetype=sh diff --git a/completions/puppet b/completions/puppet index 59a477ed40d..4539ab21637 100644 --- a/completions/puppet +++ b/completions/puppet @@ -3,54 +3,61 @@ _puppet_logdest() { if [[ -z $cur ]]; then - COMPREPLY=( $( compgen -W 'syslog console /' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'syslog console /' -- "$cur")) else - COMPREPLY=( $( compgen -W 'syslog console' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'syslog console' -- "$cur")) _filedir fi } _puppet_digest() { - COMPREPLY=( $( compgen -W 'MD5 MD2 SHA1 SHA256' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'MD5 MD2 SHA1 SHA256' -- "$cur")) } _puppet_certs() { local puppetca="puppet cert" - PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetca &>/dev/null \ - && puppetca=puppetca + PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetca &>/dev/null && + puppetca=puppetca - if [[ "$1" == --all ]]; then - cert_list=$( $puppetca --list --all | command sed -e 's/^[+-]\{0,1\}\s*\(\S\+\)\s\+.*$/\1/' ) + if [[ $1 == --all ]]; then + cert_list=$( + $puppetca --list --all | + command sed -e 's/^[+-]\{0,1\}\s*\(\S\+\)\s\+.*$/\1/' + ) else - cert_list=$( $puppetca --list ) + cert_list=$($puppetca --list) fi - COMPREPLY+=( $( compgen -W "$cert_list" -- "$cur" ) ) + COMPREPLY+=($(compgen -W "$cert_list" -- "$cur")) } _puppet_types() { - puppet_types=$( puppet describe --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' ) - COMPREPLY+=( $( compgen -W "$puppet_types" -- "$cur" ) ) + puppet_types=$( + puppet describe --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' + ) + COMPREPLY+=($(compgen -W "$puppet_types" -- "$cur")) } _puppet_references() { local puppetdoc="puppet doc" - PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetdoc &>/dev/null \ - && puppetdoc=puppetdoc + PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetdoc &>/dev/null && + puppetdoc=puppetdoc - puppet_doc_list=$( $puppetdoc --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' ) - COMPREPLY+=( $( compgen -W "$puppet_doc_list" -- "$cur" ) ) + puppet_doc_list=$( + $puppetdoc --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' + ) + COMPREPLY+=($(compgen -W "$puppet_doc_list" -- "$cur")) } _puppet_subcmd_opts() { # puppet cmd help is somewhat slow, avoid if possible - [[ -z $cur || $cur == -* ]] && \ - COMPREPLY+=( $( compgen -W \ - '$( _parse_usage "$1" "help $2" )' -- "$cur" ) ) + [[ -z $cur || $cur == -* ]] && + COMPREPLY+=($(compgen -W \ + '$(_parse_usage "$1" "help $2")' -- "$cur")) } _puppet() @@ -58,10 +65,10 @@ _puppet() local cur prev words cword _init_completion || return - local xspec helpopts subcommand action + local subcommand action case $prev in - -h|--help|-V|--version) + -h | --help | -V | --version) return ;; esac @@ -96,19 +103,21 @@ _puppet() ;; puppet) case ${words[1]} in - agent|apply|cert|describe|doc|filebucket|kick|master|parser|queue|resource) + agent | apply | cert | describe | doc | filebucket | kick | \ + master | parser | queue | resource) subcommand=${words[1]} ;; - *.pp|*.rb) + *.pp | *.rb) subcommand=apply ;; *) - COMPREPLY=( $( compgen -W 'agent apply cert describe doc + COMPREPLY=($(compgen -W 'agent apply cert describe doc filebucket kick master parser queue resource' \ - -- "$cur" ) ) + -- "$cur")) return ;; esac + ;; esac case $subcommand in @@ -126,46 +135,48 @@ _puppet() _known_hosts_real -- "$cur" return ;; - -l|--logdest) + -l | --logdest) _puppet_logdest return ;; --masterport) - COMPREPLY=( $( compgen -W '8140' -- "$cur" ) ) + COMPREPLY=($(compgen -W '8140' -- "$cur")) return ;; - -w|--waitforcert) - COMPREPLY=( $( compgen -W '0 15 30 60 120' -- "$cur" ) ) + -w | --waitforcert) + COMPREPLY=($(compgen -W '0 15 30 60 120' -- "$cur")) return ;; *) _puppet_subcmd_opts "$1" $subcommand # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize] - COMPREPLY+=( $( compgen -W '--no-daemonize' -- "$cur" ) ) + COMPREPLY+=($(compgen -W '--no-daemonize' -- "$cur")) return + ;; esac ;; apply) case $prev in --catalog) - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + COMPREPLY=($(compgen -W '-' -- "$cur")) _filedir json return ;; --execute) return ;; - -l|--logdest) + -l | --logdest) _puppet_logdest return ;; *) - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else _filedir fi return + ;; esac ;; cert) @@ -176,117 +187,125 @@ _puppet() ;; *) action=$prev - COMPREPLY=( $( compgen -W '--digest --debug --help --verbose --version' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '--digest --debug --help --verbose + --version' -- "$cur")) case $action in - fingerprint|list|verify|--fingerprint|--list|--verify) - COMPREPLY+=( $( compgen -W '--all' -- "$cur" ) ) + fingerprint | list | verify | --fingerprint | --list | \ + --verify) + COMPREPLY+=($(compgen -W '--all' -- "$cur")) _puppet_certs --all return ;; - generate|--generate) + generate | --generate) _known_hosts_real -- "$cur" return ;; - clean|print|revoke|--clean|--print|--revoke) + clean | print | revoke | --clean | --print | --revoke) _puppet_certs --all return ;; - sign|--sign) - COMPREPLY+=( $( compgen -W '--all' -- "$cur" ) ) + sign | --sign) + COMPREPLY+=($(compgen -W '--all' -- "$cur")) _puppet_certs return ;; *) - COMPREPLY+=( $( compgen -W 'clean fingerprint generate - list print revoke sign verify reinventory' -- "$cur" ) ) + COMPREPLY+=($(compgen -W 'clean fingerprint + generate list print revoke sign verify + reinventory' -- "$cur")) return + ;; esac + ;; esac ;; describe) _puppet_subcmd_opts "$1" $subcommand - if [[ "$cur" != -* ]]; then + if [[ $cur != -* ]]; then _puppet_types fi return ;; doc) case $prev in - -o|--outputdir) + -o | --outputdir) _filedir -d return ;; - -m|--mode) - COMPREPLY=( $( compgen -W 'text trac pdf rdoc' -- "$cur" ) ) + -m | --mode) + COMPREPLY=($(compgen -W 'text trac pdf rdoc' -- "$cur")) return ;; - -r|--reference) + -r | --reference) _puppet_references return ;; *) - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else _filedir fi return + ;; esac ;; filebucket) case $prev in - -s|--server) + -s | --server) _known_hosts_real -- "$cur" return ;; - -b|--bucket) + -b | --bucket) _filedir -d return ;; *) - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else - COMPREPLY=( $( compgen -W 'backup get restore' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'backup get restore' \ + -- "$cur")) _filedir fi return + ;; esac ;; kick) case $prev in - -c|--class) + -c | --class) return ;; --host) _known_hosts_real -- "$cur" return ;; - -t|--tag) + -t | --tag) return ;; *) - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else _known_hosts_real -- "$cur" fi return + ;; esac ;; master) case $prev in - -l|--logdest) + -l | --logdest) _puppet_logdest return ;; *) _puppet_subcmd_opts "$1" $subcommand # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize] - COMPREPLY+=( $( compgen -W '--no-daemonize' -- "$cur" ) ) + COMPREPLY+=($(compgen -W '--no-daemonize' -- "$cur")) return + ;; esac ;; parser) @@ -297,31 +316,34 @@ _puppet() return ;; *) - COMPREPLY=( $( compgen -W 'validate' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'validate' -- "$cur")) return + ;; esac ;; queue) case $prev in - -l|--logdest) + -l | --logdest) _puppet_logdest return ;; *) - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else _filedir fi return + ;; esac ;; - resource|*) + resource | *) _puppet_subcmd_opts "$1" $subcommand return ;; esac } && -complete -F _puppet puppetmasterd puppetd puppetca ralsh puppetrun puppetqd filebucket puppetdoc puppet + complete -F _puppet puppetmasterd puppetd puppetca ralsh puppetrun \ + puppetqd filebucket puppetdoc puppet # ex: filetype=sh diff --git a/completions/pv b/completions/pv index 72f9e7dd4dc..bc10055a5c3 100644 --- a/completions/pv +++ b/completions/pv @@ -6,24 +6,27 @@ _pv() _init_completion || return case $prev in - --help|--version|--last-written|--format|--delay-start|--interval|\ - --width|--height|--name|--rate-limit|--buffer-size|-!(-*)[hVAFDiwHNLB]) + --help | --version | --last-written | --format | --delay-start | \ + --interval | --width | --height | --name | --rate-limit | \ + --buffer-size | -!(-*)[hVAFDiwHNLB]) return ;; - --remote|-!(-*)R) + --remote | -!(-*)R) _pids return ;; - --pidfile|--watchfd|-!(-*)[Pd]) + --pidfile | --watchfd | -!(-*)[Pd]) _filedir pid return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) else _filedir fi } && -complete -F _pv pv + complete -F _pv pv + +# ex: filetype=sh diff --git a/completions/pwck b/completions/pwck index 468aa7c6f12..533a254a453 100644 --- a/completions/pwck +++ b/completions/pwck @@ -5,13 +5,15 @@ _pwck() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) return fi _filedir } && -complete -F _pwck pwck + complete -F _pwck pwck # ex: filetype=sh diff --git a/completions/pwd b/completions/pwd index f4a558a25e9..b9c4fbc0ef1 100644 --- a/completions/pwd +++ b/completions/pwd @@ -6,15 +6,15 @@ _pwd() _init_completion || return case $prev in - --help|--version) + --help | --version) return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY ]] || \ - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} ]] || + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) } && -complete -F _pwd pwd + complete -F _pwd pwd # ex: filetype=sh diff --git a/completions/pwdx b/completions/pwdx index ed8d3ec276d..25a1a1e118a 100644 --- a/completions/pwdx +++ b/completions/pwdx @@ -6,19 +6,19 @@ _pwdx() _init_completion || return case $prev in - -h|--help|-V|--version) + -h | --help | -V | --version) return ;; esac if [[ $cur == -* ]]; then - local help='$( _parse_help "$1" )' + local help='$(_parse_help "$1")' [[ $help ]] || help=-V - COMPREPLY=( $( compgen -W "$help" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$help" -- "$cur")) else _pids fi } && -complete -F _pwdx pwdx + complete -F _pwdx pwdx # ex: filetype=sh diff --git a/completions/pwgen b/completions/pwgen index 4ec3b6cdeac..50d31d5f400 100644 --- a/completions/pwgen +++ b/completions/pwgen @@ -6,10 +6,10 @@ _pwgen() _init_completion -s || return case $prev in - --num-passwords|--help|-!(-*)[Nh]) + --num-passwords | --help | -!(-*)[Nh]) return ;; - --sha1|-!(-*)H) + --sha1 | -!(-*)H) _filedir return ;; @@ -18,11 +18,11 @@ _pwgen() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi } && -complete -F _pwgen pwgen + complete -F _pwgen pwgen # ex: filetype=sh diff --git a/completions/pycodestyle b/completions/pycodestyle index 7a62ac075e7..dec6f375993 100644 --- a/completions/pycodestyle +++ b/completions/pycodestyle @@ -6,11 +6,11 @@ _pycodestyle() _init_completion -s || return case $prev in - -h|--help|--version) + -h | --help | --version) return ;; --format) - COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'default pylint' -- "$cur")) return ;; --config) @@ -22,13 +22,13 @@ _pycodestyle() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir py } && -complete -F _pycodestyle pycodestyle + complete -F _pycodestyle pycodestyle # ex: filetype=sh diff --git a/completions/pydoc b/completions/pydoc index 727999f8574..e7b117886fd 100644 --- a/completions/pydoc +++ b/completions/pydoc @@ -6,7 +6,7 @@ _pydoc() _init_completion || return case $prev in - -k|-p) + -k | -p) return ;; -w) @@ -15,27 +15,28 @@ _pydoc() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( "$1" | command sed -e "s/^pydoc3\{0,1\} //" | _parse_help - )' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W \ + '$("$1" | command sed -e "s/^pydoc3\{0,1\} //" | _parse_help -)' \ + -- "$cur")) return fi - COMPREPLY=( $( compgen -W 'keywords topics modules' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'keywords topics modules' -- "$cur")) if [[ $cur != @(.|*/)* ]]; then - local python=python; [[ ${1##*/} == *3* ]] && python=python3 + local python=python + [[ ${1##*/} == *3* ]] && python=python3 _xfunc python _python_modules $python fi # Note that we don't do "pydoc modules" as it is known to hang on # some systems; _python_modules tends to work better and faster. - COMPREPLY+=( $( compgen -W \ - '$( $1 keywords topics | command sed -e /^Here/d )' -- "$cur" ) ) + COMPREPLY+=($(compgen -W \ + '$($1 keywords topics | command sed -e /^Here/d)' -- "$cur")) _filedir py } && -complete -F _pydoc pydoc pydoc3 + complete -F _pydoc pydoc pydoc3 # ex: filetype=sh diff --git a/completions/pydocstyle b/completions/pydocstyle index c68f3c9a1e5..538e722725b 100644 --- a/completions/pydocstyle +++ b/completions/pydocstyle @@ -6,8 +6,8 @@ _pydocstyle() _init_completion -s || return case $prev in - --help|--version|--match|--ignore-decorators|--select|--ignore|\ - --add-select|--add-ignore|-!(-*)h) + --help | --version | --match | --ignore-decorators | --select | \ + --ignore | --add-select | --add-ignore | -!(-*)h) return ;; --config) @@ -15,21 +15,21 @@ _pydocstyle() return ;; --convention) - COMPREPLY=( $( compgen -W "pep257 numpy" -- "$cur" ) ) + COMPREPLY=($(compgen -W "pep257 numpy" -- "$cur")) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir py } && -complete -F _pydocstyle pydocstyle + complete -F _pydocstyle pydocstyle # ex: filetype=sh diff --git a/completions/pyflakes b/completions/pyflakes index 05025263aa5..0a4e977197a 100644 --- a/completions/pyflakes +++ b/completions/pyflakes @@ -6,18 +6,18 @@ _pyflakes() _init_completion || return case $prev in - -h|--help|--version) + -h | --help | --version) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _filedir py } && -complete -F _pyflakes pyflakes + complete -F _pyflakes pyflakes # ex: filetype=sh diff --git a/completions/pylint b/completions/pylint index a55dcc93932..165b8f933f0 100644 --- a/completions/pylint +++ b/completions/pylint @@ -1,67 +1,98 @@ # pylint(1) completion -*- shell-script -*- +_comp_cmd_pylint_message_ids() +{ + local filter=p + [[ ${2-} ]] && filter="/^$2 messages/,/^$/p" + # 6: arbitrary, assumed no ids shorter than that + # TODO(scop): The fallback here is slow, maybe memoize whether + # --list-msgs-enabled worked (>= 2.4.0) and avoid unnecessary tries + # again later? + local msgs="$( + set -o pipefail + ${1:-pylint} --list-msgs-enabled 2>/dev/null | + command sed -ne "$filter" | + command sed -ne 's/^[[:space:]]\{1,\}\([a-z-]\{6,\}\).*/\1/p' || + ${1:-pylint} --list-msgs 2>/dev/null | + command sed -ne 's/^:\([a-z-]\{6,\}\).*/\1/p' + )" + _comp_delimited , -W "$msgs" +} + _pylint() { local cur prev words cword split _init_completion -s || return - local python=python; [[ ${1##*/} == *3* ]] && python=python3 + local python=python + [[ ${1##*/} == *3* ]] && python=python3 case $prev in - --version|--help|--long-help|--help-msg|--init-hook|--ignore|--enable|\ - --evaluation|--max-line-length|--max-module-lines|\ - --indent-string|--min-similarity-lines|--max-args|\ - --ignored-argument-names|--max-locals|--max-returns|--max-branchs|\ - --max-statements|--max-parents|--max-attributes|--min-public-methods|\ - --max-public-methods|--required-attributes|--bad-functions|\ - --module-rgx|--const-rgx|--class-rgx|--function-rgx|--method-rgx|\ - --attr-rgx|--argument-rgx|--variable-rgx|--inlinevar-rgx|--good-names|\ - --bad-names|--no-docstring-rgx|--dummy-variables-rgx|\ - --additional-builtins|--notes|--ignored-classes|--generated-members|\ - --overgeneral-exceptions|--ignore-iface-methods|\ - --defining-attr-methods|--valid-classmethod-first-arg|\ - --valid-metaclass-classmethod-first-arg|-!(-*)[he]) + --version | --help | --long-help | --init-hook | \ + --ignore | --evaluation | --max-line-length | \ + --max-module-lines | --indent-string | --min-similarity-lines | \ + --max-args | --ignored-argument-names | --max-locals | \ + --max-returns | --max-branches | --max-statements | --max-parents | \ + --max-attributes | --min-public-methods | --max-public-methods | \ + --required-attributes | --bad-functions | --module-rgx | \ + --const-rgx | --class-rgx | --function-rgx | --method-rgx | \ + --attr-rgx | --argument-rgx | --variable-rgx | --inlinevar-rgx | \ + --good-names | --bad-names | --no-docstring-rgx | \ + --dummy-variables-rgx | --additional-builtins | --notes | \ + --ignored-classes | --generated-members | \ + --overgeneral-exceptions | --ignore-iface-methods | \ + --defining-attr-methods | --valid-classmethod-first-arg | \ + --valid-metaclass-classmethod-first-arg | -!(-*)[h]) + return + ;; + --fail-on | --help-msg) + _comp_cmd_pylint_message_ids "$1" + return + ;; + --enable | -!(-*)e) + _comp_cmd_pylint_message_ids "$1" Disabled return ;; - --disable|-!(-*)d) - COMPREPLY=( $( compgen -W 'all' -- "$cur" ) ) + --disable | -!(-*)d) + _comp_cmd_pylint_message_ids "$1" Enabled + COMPREPLY+=($(compgen -W 'all' -- "$cur")) return ;; --rcfile) _filedir return ;; - --persistent|--include-ids|--symbols|--files-output|--reports|\ - --comment|--ignore-comments|--ignore-docstrings|--ignore-imports|\ - --init-import|--ignore-mixin-members|--zope|--suggestion-mode|\ - -!(-*)[isr]) - COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) ) + --persistent | --include-ids | --symbols | --files-output | \ + --reports | --comment | --ignore-comments | --ignore-docstrings | \ + --ignore-imports | --init-import | --ignore-mixin-members | \ + --zope | --suggestion-mode | -!(-*)[isr]) + COMPREPLY=($(compgen -W 'yes no' -- "$cur")) return ;; - --load-plugins|--deprecated-modules) - local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - cur="${cur##*,}" - _xfunc python _python_modules $python - [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) + --load-plugins | --deprecated-modules) + cur="${cur##*,}" _xfunc python _python_modules $python + ((${#COMPREPLY[@]})) && + _comp_delimited , -W '"${COMPREPLY[@]}"' return ;; - --jobs|-!(-*)j) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + --jobs | -!(-*)j) + COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) return ;; --confidence) - local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -W "HIGH INFERENCE INFERENCE_FAILURE - UNDEFINED" -- "${cur##*,}" ) ) - [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) + local prefix= + [[ $cur == *,* ]] && prefix="${cur%,*}," + COMPREPLY=($(compgen -W "HIGH INFERENCE INFERENCE_FAILURE + UNDEFINED" -- "${cur##*,}")) + ((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/#/$prefix}) return ;; - --format|-!(-*)f) - COMPREPLY=( $( compgen -W 'text parseable colorized json msvs' \ - -- "$cur" ) ) + --format | -!(-*)f) + COMPREPLY=($(compgen -W 'text parseable colorized json msvs' \ + -- "$cur")) return ;; - --import-graph|--ext-import-graph|--int-import-graph) + --import-graph | --ext-import-graph | --int-import-graph) _filedir dot return ;; @@ -70,15 +101,15 @@ _pylint() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( _parse_help "$1" --long-help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W \ + '$(_parse_help "$1" --long-help)' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi [[ $cur == @(.|*/)* ]] || _xfunc python _python_modules $python _filedir py } && -complete -F _pylint pylint pylint-2 pylint-3 + complete -F _pylint pylint pylint-2 pylint-3 # ex: filetype=sh diff --git a/completions/pytest b/completions/pytest index 76a1c1189bd..d79af26f6c3 100644 --- a/completions/pytest +++ b/completions/pytest @@ -1,40 +1,57 @@ # bash completion for pytest(1) -*- shell-script -*- +_pytest_option_choice_args() +{ + local modes=$("${2:-pytest}" $1=bash-completion-nonexistent 2>&1 | + command sed -e 's/[^[:space:][:alnum:]-]\{1,\}//g' \ + -ne 's/.*choose from //p') + COMPREPLY+=($(compgen -W '$modes' -- "$cur")) +} + _pytest() { local cur prev words cword split - _init_completion -s || return + _init_completion -s -n : || return case $prev in - --help|--maxfail|--report|--junit-prefix|--doctest-glob|-!(-*)[hkmrp]) + --help | --maxfail | --report | --junit-prefix | --doctest-glob | \ + -!(-*)[hkmorp]) return ;; --import-mode) - COMPREPLY=( $( compgen -W "prepend append" -- "$cur" ) ) + COMPREPLY=($(compgen -W "prepend append" -- "$cur")) return ;; --capture) - COMPREPLY=( $( compgen -W "fd sys no" -- "$cur" ) ) + COMPREPLY=($(compgen -W "fd sys no tee-sys" -- "$cur")) + return + ;; + --lfnf | --last-failed-no-failures) + COMPREPLY=($(compgen -W "all none" -- "$cur")) return ;; --tb) - COMPREPLY=( $( compgen -W "auto long short line native no" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "auto long short line native no" \ + -- "$cur")) + return + ;; + --show-capture) + COMPREPLY=($(compgen -W "no stdout stderr log all" -- "$cur")) return ;; --color) - COMPREPLY=( $( compgen -W "yes no auto" -- "$cur" ) ) + COMPREPLY=($(compgen -W "yes no auto" -- "$cur")) return ;; --pastebin) - COMPREPLY=( $( compgen -W "failed all" -- "$cur" ) ) + COMPREPLY=($(compgen -W "failed all" -- "$cur")) return ;; --junit-xml) _filedir xml return ;; - --result-log) + --result-log | --log-file) _filedir log return ;; @@ -42,30 +59,84 @@ _pytest() _filedir return ;; - --confcutdir|--basetemp) + --confcutdir | --basetemp | --rsyncdir | --rootdir) _filedir -d return ;; + --doctest-report) + COMPREPLY=($( + compgen -W "none cdiff ndiff udiff only_first_failure" -- "$cur" + )) + return + ;; --assert) - COMPREPLY=( $( compgen -W "plain reinterp rewrite" -- "$cur" ) ) + COMPREPLY=($(compgen -W "plain reinterp rewrite" -- "$cur")) return ;; --genscript) _filedir py return ;; + --pythonwarnings | -!(-*)W) + _xfunc python _python_warning_actions + return + ;; + --numprocesses | -!(-*)n) + COMPREPLY=($(compgen -W "{1..$(_ncpus)} auto" -- "$cur")) + return + ;; + --dist | --vcr-record?(-mode)) + _pytest_option_choice_args $prev "$1" + return + ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + return + fi + + if [[ $cur == *.py::*:* ]]; then + local file=${cur/.py:*/.py} + local class=${cur#*.py::} in_class=false + local line + class=${class%%:*} + while IFS= read -r line; do + if [[ $line =~ ^class[[:space:]]+${class}[[:space:]:\(] ]]; then + in_class=true + elif [[ $line =~ ^class[[:space:]] ]]; then + in_class=false + fi + if $in_class && [[ $line =~ ^[[:space:]]+(async[[:space:]]+)?def[[:space:]]+(test_[A-Za-z0-9_]+) ]]; then + COMPREPLY+=(${BASH_REMATCH[2]}) + fi + done 2>/dev/null <"$file" + ((!${#COMPREPLY[@]})) || + COMPREPLY=($(compgen -P "$file::$class::" -W '"${COMPREPLY[@]}"' \ + -- "${cur##*:?(:)}")) + __ltrim_colon_completions "$cur" + return + elif [[ $cur == *.py:* ]]; then + local file="${cur/.py:*/.py}" line + while IFS= read -r line; do + if [[ $line =~ ^class[[:space:]]+(Test[A-Za-z0-9_]+) ]]; then + COMPREPLY+=(${BASH_REMATCH[1]}) + elif [[ $line =~ ^(async[[:space:]]+)?def[[:space:]]+(test_[A-Za-z0-9_]+) ]]; then + COMPREPLY+=(${BASH_REMATCH[2]}) + fi + done 2>/dev/null <"$file" + ((!${#COMPREPLY[@]})) || + COMPREPLY=($(compgen -P "$file::" -W '"${COMPREPLY[@]}"' \ + -- "${cur##*.py:?(:)}")) + __ltrim_colon_completions "$cur" return fi _filedir py } && -complete -F _pytest pytest pytest-2 pytest-3 py.test py.test-2 py.test-3 + complete -F _pytest pytest pytest-2 pytest-3 py.test py.test-2 py.test-3 # ex: filetype=sh diff --git a/completions/python b/completions/python index c8939bf21f6..7daed9f83be 100644 --- a/completions/python +++ b/completions/python @@ -2,9 +2,15 @@ _python_modules() { - COMPREPLY+=( $( compgen -W \ - "$( ${1:-python} ${BASH_SOURCE[0]%/*}/../helpers/python $cur \ - 2>/dev/null )" -- "$cur" ) ) + COMPREPLY+=($(compgen -W \ + "$(${1:-python} ${BASH_SOURCE[0]%/*}/../helpers/python $cur \ + 2>/dev/null)" -- "$cur")) +} + +_python_warning_actions() +{ + COMPREPLY+=($(compgen -W "ignore default all module once error" \ + ${prefix:+-P "$prefix"} -- "$cur")) } _python() @@ -17,11 +23,11 @@ _python() prefix=${cur:0:2} prev=$prefix cur=${cur:2} - ;; + ;; esac case $prev in - --help|--version|-!(-*)[?hVcX]) + --help | --version | -!(-*)[?hVc]) return ;; -!(-*)m) @@ -29,35 +35,44 @@ _python() return ;; -!(-*)Q) - COMPREPLY=( $( compgen -W "old new warn warnall" -P "$prefix" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "old new warn warnall" -P "$prefix" \ + -- "$cur")) return ;; -!(-*)W) - COMPREPLY=( $( compgen -W "ignore default all module once error" \ - -P "$prefix" -- "$cur" ) ) + _python_warning_actions + return + ;; + -!(-*)X) + COMPREPLY=($(compgen -W "$("$1" -h 2>&1 | + awk '$1 == "-X" && $2 ~ /:$/ { + sub(":$","",$2); sub("=.*","=",$2); print $2 + }')" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; --jit) # TODO: quite a few others, parse from "--jit help" output? - COMPREPLY=( $( compgen -W "help off" -- "$cur" ) ) + COMPREPLY=($(compgen -W "help off" -- "$cur")) return ;; !(?(*/)python*([0-9.])|?(*/)pypy*([0-9.])|-?)) - [[ $cword -lt 2 || ${words[cword-2]} != -[QWX] ]] && _filedir + [[ $cword -lt 2 || ${words[cword - 2]} != -[QWX] ]] && _filedir ;; esac - # if -c or -m is already given, complete all kind of files. - if [[ "${words[@]::$cword}" == *\ -[cm]\ * ]]; then + if [[ ${words[*]::cword} == *\ -[cm]\ * ]]; then _filedir - elif [[ "$cur" != -* ]]; then - _filedir 'py?([cowz])' + elif [[ $cur != -* ]]; then + _filedir '@(py?([cowz])|zip)' else - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=($(compgen -W \ + '$("$1" -h | awk "{ sub(\"\\\(-bb:\",\"\n-bb \"); print }" | + _parse_help -)' -- "$cur")) fi } && -complete -F _python python python2 python3 pypy pypy3 micropython + complete -F _python python python2 python2.7 python3 python3.{3..11} \ + pypy pypy3 pyston pyston3 micropython # ex: filetype=sh diff --git a/completions/pyvenv b/completions/pyvenv index d5135e87d7d..c8312497f94 100644 --- a/completions/pyvenv +++ b/completions/pyvenv @@ -6,20 +6,20 @@ _pyvenv() _init_completion -s || return case $prev in - -h|--help) + -h | --help) return ;; esac $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _longopt "$1" return fi _filedir -d } && -complete -F _pyvenv pyvenv pyvenv-3.{4..8} + complete -F _pyvenv pyvenv pyvenv-3.{4..10} # ex: filetype=sh diff --git a/completions/qdbus b/completions/qdbus index dee0760a952..2bc0fe4b09d 100644 --- a/completions/qdbus +++ b/completions/qdbus @@ -5,10 +5,10 @@ _qdbus() local cur prev words cword _init_completion || return - [[ -n $cur ]] && unset "words[$((${#words[@]}-1))]" - COMPREPLY=( $( compgen -W '$( command ${words[@]} 2>/dev/null | \ - command sed "s/(.*)//" )' -- "$cur" ) ) + [[ -n $cur ]] && unset -v "words[$((${#words[@]} - 1))]" + COMPREPLY=($(compgen -W '$(command ${words[@]} 2>/dev/null | \ + command sed "s/(.*)//")' -- "$cur")) } && -complete -F _qdbus qdbus dcop + complete -F _qdbus qdbus dcop # ex: filetype=sh diff --git a/completions/qemu b/completions/qemu index 724e7a5f4d1..325c61386a0 100644 --- a/completions/qemu +++ b/completions/qemu @@ -6,89 +6,94 @@ _qemu() _init_completion || return case $prev in - -fd[ab]|-hd[abcd]|-cdrom|-option-rom|-kernel|-initrd|-bootp|-pidfile| \ - -loadvm|-mtdblock|-sd|-pflash|-bios) + -fd[ab] | -hd[abcd] | -cdrom | -option-rom | -kernel | -initrd | \ + -bootp | -pidfile | -loadvm | -mtdblock | -sd | -pflash | -bios) _filedir return ;; - -tftp|-smb|-L|-chroot) + -tftp | -smb | -L | -chroot) _filedir -d return ;; -boot) - COMPREPLY=( $( compgen -W 'a c d n' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'a c d n' -- "$cur")) return ;; -k) - COMPREPLY=( $( compgen -W 'ar de-ch es fo fr-ca hu ja mk no pt-br - sv da en-gb et fr fr-ch is lt nl pl ru th de en-us fi fr-be hr - it lv nl-be pt sl tr' -- "$cur" ) ) + local IFS=$' \t\n' reset=$(shopt -p nullglob) + shopt -s nullglob + local -a keymaps=($( + printf "%s\n" \ + /usr/{local/,}share/qemu/keymaps/!(common|modifiers) + )) + $reset + ((${#keymaps[@]})) && + COMPREPLY=($(compgen -W '"${keymaps[@]##*/}"}' -- "$cur")) return ;; -soundhw) - COMPREPLY=( $( compgen -W "$( $1 -soundhw ? | awk \ - '/^[[:lower:]]/ {print $1}' ) all" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 -soundhw help | awk \ + '/^[[:lower:]]/ {print $1}') all" -- "$cur")) return ;; - -M) - COMPREPLY=( $( compgen -W "$( $1 -M ? | awk \ - '/^[[:lower:]]/ {print $1}' )" -- "$cur" ) ) + -machine | -M) + COMPREPLY=($(compgen -W "$($1 $prev help | awk \ + '/^[[:lower:]]/ {print $1}')" -- "$cur")) return ;; -cpu) - COMPREPLY=( $( compgen -W "$( $1 -cpu ? | awk \ - '{print $2}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 -cpu help | awk '{print $2}')" \ + -- "$cur")) return ;; -usbdevice) - COMPREPLY=( $( compgen -W 'mouse tablet disk: host: serial: braille - net' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'mouse tablet disk: host: serial: braille + net' -- "$cur")) return ;; -net) - COMPREPLY=( $( compgen -W 'nic user tap socket vde none dump' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'nic user tap socket vde none dump' \ + -- "$cur")) return ;; - -serial|-parallel|-monitor) - COMPREPLY=( $( compgen -W 'vc pty none null /dev/ file: stdio pipe: - COM udp: tcp: telnet: unix: mon: braille' -- "$cur" ) ) + -serial | -parallel | -monitor) + COMPREPLY=($(compgen -W 'vc pty none null /dev/ file: stdio pipe: + COM udp: tcp: telnet: unix: mon: braille' -- "$cur")) return ;; -redir) - COMPREPLY=( $( compgen -S":" -W 'tcp udp' -- "$cur" ) ) + COMPREPLY=($(compgen -S":" -W 'tcp udp' -- "$cur")) return ;; -bt) - COMPREPLY=( $( compgen -W 'hci vhci device' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'hci vhci device' -- "$cur")) return ;; -vga) - COMPREPLY=( $( compgen -W 'cirrus std vmware xenfb none' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'cirrus std vmware xenfb none' -- "$cur")) return ;; -drive) - COMPREPLY=( $( compgen -S"=" -W 'file if bus unit index media cyls - snapshot cache format serial addr' -- "$cur" ) ) + COMPREPLY=($(compgen -S"=" -W 'file if bus unit index media cyls + snapshot cache format serial addr' -- "$cur")) return ;; -balloon) - COMPREPLY=( $( compgen -W 'none virtio' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'none virtio' -- "$cur")) return ;; -smbios) - COMPREPLY=( $( compgen -W 'file type' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'file type' -- "$cur")) return ;; -watchdog) - COMPREPLY=( $( compgen -W "$( $1 -watchdog ? 2>&1 | \ - awk '{print $1}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 -watchdog help 2>&1 | + awk '{print $1}')" -- "$cur")) return ;; -watchdog-action) - COMPREPLY=( $( compgen -W 'reset shutdown poweroff pause debug - none' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'reset shutdown poweroff pause debug + none' -- "$cur")) return ;; -runas) @@ -97,14 +102,13 @@ _qemu() ;; esac - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help ) -fd{a,b} - -hd{a..d}' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help) -fd{a,b} + -hd{a..d}' -- "$cur")) else _filedir fi } && -complete -F _qemu qemu qemu-kvm qemu-system-i386 qemu-system-x86_64 + complete -F _qemu qemu qemu-kvm qemu-system-i386 qemu-system-x86_64 # ex: filetype=sh diff --git a/completions/qrunner b/completions/qrunner index 4e02a175da1..3919ea25b2f 100644 --- a/completions/qrunner +++ b/completions/qrunner @@ -7,12 +7,12 @@ _qrunner() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--runner --once --list --verbose --subproc - --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--runner --once --list --verbose --subproc + --help' -- "$cur")) fi } && -complete -F _qrunner qrunner + complete -F _qrunner qrunner # ex: filetype=sh diff --git a/completions/querybts b/completions/querybts index 11ae4cea6b2..edeba9675ac 100644 --- a/completions/querybts +++ b/completions/querybts @@ -6,18 +6,18 @@ _querybts() _init_completion -s || return case $prev in - --bts|-!(-*)B) - COMPREPLY=( $( compgen -W "debian guug kde mandrake help" \ - -- "$cur" ) ) + --bts | -!(-*)B) + COMPREPLY=($(compgen -W "debian guug kde mandrake help" \ + -- "$cur")) return ;; - --ui|--interface|-!(-*)u) - COMPREPLY=( $( compgen -W "newt text gnome" -- "$cur" ) ) + --ui | --interface | -!(-*)u) + COMPREPLY=($(compgen -W "newt text gnome" -- "$cur")) return ;; --mbox-reader-cmd) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) return ;; esac @@ -25,16 +25,16 @@ _querybts() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W 'wnpp boot-floppies kernel bugs.debian.org + COMPREPLY=($(compgen -W 'wnpp boot-floppies kernel bugs.debian.org cdimage.debian.org general installation-reports listarchives lists.debian.org mirrors nm.debian.org press project qa.debian.org release-notes security.debian.org tech-ctte upgrade-reports - www.debian.org $( apt-cache pkgnames 2>/dev/null )' -- "$cur" ) ) + www.debian.org $(_xfunc apt-cache _apt_cache_packages)' -- "$cur")) fi } && -complete -F _querybts querybts + complete -F _querybts querybts # ex: filetype=sh diff --git a/completions/quota b/completions/quota index c1604f8e7f0..31aebfcbed9 100644 --- a/completions/quota +++ b/completions/quota @@ -5,36 +5,36 @@ _user_or_group() local i # complete on groups if -g was given - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == -@(g|-group) ]]; then - COMPREPLY=( $( compgen -g -- "$cur" ) ) + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -@(g|-group) ]]; then + COMPREPLY=($(compgen -g -- "$cur")) return fi done # otherwise complete on users - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) } _quota_parse_help() { - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) # non-GNU? - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } _quota_formats() { - COMPREPLY=( $( compgen -W 'vfsold vfsv0 rpc xfs' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'vfsold vfsv0 rpc xfs' -- "$cur")) } _filesystems() { # Only list filesystems starting with "/", otherwise we also get #+ "binfmt_misc", "proc", "tmpfs", ... - COMPREPLY=( $( compgen -W "$(awk '/^\// {print $1}' /etc/mtab)" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(awk '/^\// {print $1}' /etc/mtab)" \ + -- "$cur")) } _quota() @@ -43,24 +43,24 @@ _quota() _init_completion -s || return case $prev in - -F|--format) + -F | --format) _quota_formats return ;; - -h|--help|-V|--version) + -h | --help | -V | --version) return ;; esac $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _quota_parse_help "$1" else _user_or_group fi } && -complete -F _quota -o default quota + complete -F _quota -o default quota _setquota() { @@ -68,22 +68,22 @@ _setquota() _init_completion -s || return case $prev in - -F|--format) + -F | --format) _quota_formats return ;; - -p|--prototype) + -p | --prototype) _user_or_group return ;; - -h|--help|-V|--version) + -h | --help | -V | --version) return ;; esac $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _quota_parse_help "$1" else local args @@ -100,7 +100,7 @@ _setquota() fi } && -complete -F _setquota -o default setquota + complete -F _setquota -o default setquota _edquota() { @@ -108,32 +108,32 @@ _edquota() _init_completion -s || return case $prev in - -F|--format) + -F | --format) _quota_formats return ;; - -f|--filesystem) + -f | --filesystem) _filesystems return ;; - -p|--prototype) + -p | --prototype) _user_or_group return ;; - -h|--help|-V|--version) + -h | --help | -V | --version) return ;; esac $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _quota_parse_help "$1" else _user_or_group fi } && -complete -F _edquota -o default edquota + complete -F _edquota -o default edquota _quotacheck() { @@ -141,24 +141,24 @@ _quotacheck() _init_completion -s || return case $prev in - -F|--format) + -F | --format) _quota_formats return ;; - -h|--help|-V|--version) + -h | --help | -V | --version) return ;; esac $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _quota_parse_help "$1" else _filesystems fi } && -complete -F _quotacheck -o default quotacheck repquota + complete -F _quotacheck -o default quotacheck repquota _quotaon() { @@ -166,27 +166,27 @@ _quotaon() _init_completion -s || return case $prev in - -F|--format) + -F | --format) _quota_formats return ;; - -x|--xfs-command) - COMPREPLY=( $( compgen -W 'delete enforce' -- "$cur" ) ) + -x | --xfs-command) + COMPREPLY=($(compgen -W 'delete enforce' -- "$cur")) return ;; - -h|--help|-V|--version) + -h | --help | -V | --version) return ;; esac $split && return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then _quota_parse_help "$1" else _filesystems fi } && -complete -F _quotaon -o default quotaon quotaoff + complete -F _quotaon -o default quotaon quotaoff # ex: filetype=sh diff --git a/completions/radvdump b/completions/radvdump index 7280a7a1a96..850628fdaa9 100644 --- a/completions/radvdump +++ b/completions/radvdump @@ -6,17 +6,17 @@ _radvdump() _init_completion || return case $prev in - -h|--help|-v|--version) + -h | --help | -v | --version) return ;; - -d|--debug) - COMPREPLY=( $( compgen -W '{1..4}' -- "$cur" ) ) + -d | --debug) + COMPREPLY=($(compgen -W '{1..4}' -- "$cur")) return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) } && -complete -F _radvdump radvdump + complete -F _radvdump radvdump # ex: filetype=sh diff --git a/completions/rcs b/completions/rcs index d63fe170c84..c04d89d2de0 100644 --- a/completions/rcs +++ b/completions/rcs @@ -11,26 +11,26 @@ _rcs() dir=${cur%/*} # deal with relative directory - [[ $file == $dir ]] && dir=. + [[ $file == "$dir" ]] && dir=. - COMPREPLY=( $( compgen -f -- "$dir/RCS/$file" ) ) + COMPREPLY=($(compgen -f -- "$dir/RCS/$file")) - for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do - file=${COMPREPLY[$i]##*/} - dir=${COMPREPLY[$i]%RCS/*} - COMPREPLY[$i]=$dir$file + for i in ${!COMPREPLY[*]}; do + file=${COMPREPLY[i]##*/} + dir=${COMPREPLY[i]%RCS/*} + COMPREPLY[i]=$dir$file done - COMPREPLY+=( $( compgen -G "$dir/$file*,v" ) ) + COMPREPLY+=($(compgen -G "$dir/$file*,v")) - for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do - COMPREPLY[$i]=${COMPREPLY[$i]%,v} + for i in ${!COMPREPLY[*]}; do + COMPREPLY[i]=${COMPREPLY[i]%,v} done # default to files if nothing returned and we're checking in. # otherwise, default to directories - [[ ${#COMPREPLY[@]} -eq 0 && $1 == ci ]] && _filedir || _filedir -d + [[ ${#COMPREPLY[@]} -eq 0 && $1 == *ci ]] && _filedir || _filedir -d } && -complete -F _rcs ci co rlog rcs rcsdiff + complete -F _rcs ci co rlog rcs rcsdiff # ex: filetype=sh diff --git a/completions/rdesktop b/completions/rdesktop index 7f567b290b5..4a44737ffde 100644 --- a/completions/rdesktop +++ b/completions/rdesktop @@ -7,34 +7,35 @@ _rdesktop() case $prev in -*k) - COMPREPLY=( $( command ls \ - /usr/share/rdesktop/keymaps 2>/dev/null | \ - command grep -E -v '(common|modifiers)' ) ) - COMPREPLY+=( $( command ls $HOME/.rdesktop/keymaps 2>/dev/null ) ) - COMPREPLY+=( $( command ls ./keymaps 2>/dev/null ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=($(command ls \ + /usr/share/rdesktop/keymaps 2>/dev/null | + command grep -E -v '(common|modifiers)')) + COMPREPLY+=($(command ls $HOME/.rdesktop/keymaps 2>/dev/null)) + COMPREPLY+=($(command ls ./keymaps 2>/dev/null)) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) return ;; -*a) - COMPREPLY=( $( compgen -W '8 15 16 24' -- "$cur" ) ) + COMPREPLY=($(compgen -W '8 15 16 24' -- "$cur")) return ;; -*x) - COMPREPLY=( $( compgen -W 'broadband modem lan' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'broadband modem lan' -- "$cur")) return ;; -*r) case $cur in sound:*) - COMPREPLY=( $( compgen -W 'local off remote' \ - -- "${cur#sound:}" ) ) - ;; - *:*) + COMPREPLY=($(compgen -W 'local off remote' \ + -- "${cur#sound:}")) ;; + *:*) ;; + *) - COMPREPLY=( $( compgen -W 'comport: disk: lptport: - printer: sound: lspci scard' -- "$cur" ) ) - [[ $COMPREPLY == *: ]] && compopt -o nospace + COMPREPLY=($(compgen -W 'comport: disk: lptport: + printer: sound: lspci scard' -- "$cur")) + [[ ${COMPREPLY-} == *: ]] && compopt -o nospace ;; esac return @@ -44,14 +45,15 @@ _rdesktop() ;; esac - if [[ "$cur" == -* ]]; then - local opts=( $( _parse_help "$1" ) ) - COMPREPLY=( $( compgen -W '${opts[@]%:}' -- "$cur" ) ) + if [[ $cur == -* ]]; then + local opts=($(_parse_help "$1")) + ((${#opts[@]})) && + COMPREPLY=($(compgen -W '"${opts[@]%:}"}' -- "$cur")) else _known_hosts_real -- "$cur" fi } && -complete -F _rdesktop rdesktop + complete -F _rdesktop rdesktop # ex: filetype=sh diff --git a/completions/remove_members b/completions/remove_members index 66dbfda6770..db7ad0bcc3b 100644 --- a/completions/remove_members +++ b/completions/remove_members @@ -6,7 +6,7 @@ _remove_members() _init_completion -s || return case $prev in - -f|--file) + -f | --file) _filedir return ;; @@ -14,14 +14,14 @@ _remove_members() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--file --all --fromall --nouserack - --noadminack --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--file --all --fromall --nouserack + --noadminack --help' -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _remove_members remove_members + complete -F _remove_members remove_members # ex: filetype=sh diff --git a/completions/removepkg b/completions/removepkg index eaeb70a7983..ef3bd7384ab 100644 --- a/completions/removepkg +++ b/completions/removepkg @@ -4,20 +4,22 @@ _removepkg() { local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-copy -keep -preserve -warn' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-copy -keep -preserve -warn' -- "$cur")) return fi - if [[ "$cur" == */* ]]; then + if [[ $cur == */* ]]; then _filedir return fi local root=${ROOT:-/} - COMPREPLY=( $( cd "$root/var/log/packages" 2> /dev/null || return 1; \ - compgen -f -- "$cur" ) ) + COMPREPLY=($( + command cd -- "$root/var/log/packages" 2>/dev/null || return 1 + compgen -f -- "$cur" + )) } && -complete -F _removepkg removepkg + complete -F _removepkg removepkg # ex: filetype=sh diff --git a/completions/reportbug b/completions/reportbug index 6a07e2a626e..7f9aa59aeb5 100644 --- a/completions/reportbug +++ b/completions/reportbug @@ -6,65 +6,65 @@ _reportbug() _init_completion -s || return case $prev in - --class|--header|--pseudo-header|--mirror|--list-cc|--subject|\ - --http_proxy|--proxy|--email|--realname|--smtpuser|--smtppasswd|\ - --replyto|--reply-to|--justification|--package-version|--body|\ - --body-file|--timeout|--max-attachment-size|--envelope-from|\ - -!(-*)[CHPsjV]) + --class | --header | --pseudo-header | --mirror | --list-cc | \ + --subject | --http_proxy | --proxy | --email | --realname | \ + --smtpuser | --smtppasswd | --replyto | --reply-to | \ + --justification | --package-version | --body | --body-file | \ + --timeout | --max-attachment-size | --envelope-from | \ + -!(-*)[CHPsjV]) return ;; - --filename|--include|--mta|--output|--attach|-[fioA]) + --filename | --include | --mta | --output | --attach | -[fioA]) _filedir return ;; - --keyid|-!(-*)K) - COMPREPLY=( $( compgen -W '$( IFS=: ; \ + --keyid | -!(-*)K) + COMPREPLY=($(compgen -W '$(IFS=: ; \ gpg --list-keys --with-colons 2>/dev/null \ | while read -ra row ; do [[ "${row[0]}" == [ps]ub && ${row[11]} == *s* ]] && \ printf "%s\n" "${row[4]}" - done )' -- "$cur" ) ) + done)' -- "$cur")) return ;; - --bts|-!(-*)B) - COMPREPLY=( $( compgen -W "debian guug kde mandrake help" -- \ - "$cur" ) ) + --bts | -!(-*)B) + COMPREPLY=($(compgen -W "debian guug kde mandrake help" -- \ + "$cur")) return ;; - --editor|--mua|--mbox-reader-cmd|-!(-*)e) - words=( words[0] "$cur" ) - cword=1 - _command + --editor | --mua | --mbox-reader-cmd | -!(-*)e) + compopt -o filenames + COMPREPLY=($(compgen -c -- "$cur")) return ;; --mode) - COMPREPLY=( $( compgen -W "novice standard expert" -- "$cur" ) ) + COMPREPLY=($(compgen -W "novice standard expert" -- "$cur")) return ;; - --severity|-!(-*)S) - COMPREPLY=( $( compgen -W "grave serious important normal minor - wishlist" -- "$cur" ) ) + --severity | -!(-*)S) + COMPREPLY=($(compgen -W "grave serious important normal minor + wishlist" -- "$cur")) return ;; - --ui|--interface|-!(-*)u) - COMPREPLY=( $( compgen -W "newt text gnome" -- "$cur" ) ) + --ui | --interface | -!(-*)u) + COMPREPLY=($(compgen -W "newt text gnome" -- "$cur")) return ;; - --type|-!(-*)t) - COMPREPLY=( $( compgen -W "gnats debbugs" -- "$cur" ) ) + --type | -!(-*)t) + COMPREPLY=($(compgen -W "gnats debbugs" -- "$cur")) return ;; - --tag|-!(-*)T) - COMPREPLY=( $( compgen -W "none woody potato sarge sarge-ignore + --tag | -!(-*)T) + COMPREPLY=($(compgen -W "none woody potato sarge sarge-ignore etch etch-ignore lenny lenny-ignore sid experimental confirmed d-i fixed fixed-in-experimental fixed-upstream help l10n moreinfo patch pending security unreproducible upstream wontfix - ipv6 lfs" -- "$cur" ) ) + ipv6 lfs" -- "$cur")) return ;; --from-buildd) - COMPREPLY=( $( compgen -S "_" -W '$( apt-cache dumpavail | \ - command grep "^Source: $cur" | sort -u | cut -f2 -d" " )' )) + COMPREPLY=($(compgen -S "_" -W '$(apt-cache dumpavail | \ + command grep "^Source: $cur" | sort -u | cut -f2 -d" ")')) return ;; --smtphost) @@ -80,18 +80,18 @@ _reportbug() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == -*= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == -*= ]] && compopt -o nospace return fi - COMPREPLY=( $( compgen -W 'wnpp boot-floppies kernel bugs.debian.org + COMPREPLY=($(compgen -W 'wnpp boot-floppies kernel bugs.debian.org cdimage.debian.org general installation-reports listarchives lists.debian.org mirrors nm.debian.org press project qa.debian.org release-notes security.debian.org tech-ctte upgrade-reports - www.debian.org $( apt-cache pkgnames 2>/dev/null )' -- "$cur" ) ) + www.debian.org $(_xfunc apt-cache _apt_cache_packages)' -- "$cur")) _filedir } && -complete -F _reportbug reportbug + complete -F _reportbug reportbug # ex: filetype=sh diff --git a/completions/resolvconf b/completions/resolvconf index 1902e7d1384..b407488c986 100644 --- a/completions/resolvconf +++ b/completions/resolvconf @@ -6,16 +6,16 @@ _resolvconf() _init_completion || return case $prev in - -a|-d) + -a | -d) _available_interfaces return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a -d -u' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-a -d -u' -- "$cur")) fi } && -complete -F _resolvconf resolvconf + complete -F _resolvconf resolvconf # ex: filetype=sh diff --git a/completions/ri b/completions/ri index 50658932abc..83602232ec8 100644 --- a/completions/ri +++ b/completions/ri @@ -14,21 +14,22 @@ _ri_get_methods() regex=Class fi - COMPREPLY+=( \ - "$( ri ${classes[@]} 2>/dev/null | ruby -ane \ - 'if /^'"$regex"' methods:/.../^------------------|^$/ and \ + COMPREPLY+=( + "$(ri ${classes[@]+"${classes[@]}"} 2>/dev/null | ruby -ane \ + 'if /^'"$regex"' methods:/.../^------------------|^$/ and \ /^ / then print $_.split(/, |,$/).grep(/^[^\[]*$/).join("\n"); \ - end' 2>/dev/null | sort -u )" ) + end' 2>/dev/null | sort -u)") else # older versions of ri didn't distinguish between class/module and # instance methods - COMPREPLY+=( \ - "$( ruby -W0 $ri_path ${classes[@]} | ruby -ane \ - 'if /^-/.../^-/ and ! /^-/ and ! /^ +(class|module): / then \ + COMPREPLY+=( + "$(ruby -W0 $ri_path ${classes[@]+"${classes[@]}"} 2>/dev/null | ruby -ane \ + 'if /^-/.../^-/ and ! /^-/ and ! /^ +(class|module): / then \ print $_.split(/, |,$| +/).grep(/^[^\[]*$/).join("\n"); \ - end' | sort -u )" ) + end' | sort -u)") fi - COMPREPLY=( $( compgen $prefix -W '${COMPREPLY[@]}' -- $method ) ) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen $prefix -W '"${COMPREPLY[@]}"' -- $method)) } # needs at least Ruby 1.8.0 in order to use -W0 @@ -38,14 +39,14 @@ _ri() _init_completion -s -n : || return case $prev in - --help|--width|-!(-*)[hw]) + --help | --width | -!(-*)[hw]) return ;; - --format|-!(-*)f) - COMPREPLY=( $( compgen -W 'ansi bs html rdoc' -- "$cur" ) ) + --format | -!(-*)f) + COMPREPLY=($(compgen -W 'ansi bs html rdoc' -- "$cur")) return ;; - --doc-dir|-!(-*)d) + --doc-dir | -!(-*)d) _filedir -d return ;; @@ -57,9 +58,9 @@ _ri() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi @@ -71,17 +72,17 @@ _ri() # -W0 is required here to stop warnings from older versions of ri # from being captured when used with Ruby 1.8.1 and later ri_version="$(ruby -W0 $ri_path -v 2>&1)" || ri_version=integrated - [[ $ri_version != ${ri_version%200*} ]] && ri_version=integrated + [[ $ri_version != "${ri_version%200*}" ]] && ri_version=integrated [[ $ri_version =~ ri[[:space:]]v?([0-9]+) ]] && ri_major=${BASH_REMATCH[1]} # need to also split on commas IFS=$', \n\t' - if [[ "$cur" == [A-Z]*[#.]* ]]; then - [[ "$cur" == *#* ]] && separator=# || separator=. + if [[ $cur == [A-Z]*[#.]* ]]; then + [[ $cur == *#* ]] && separator=# || separator=. # we're completing on class and method - class=${cur%$separator*} - method=${cur#*$separator} - classes=( $class ) + class=${cur%"$separator"*} + method=${cur#*"$separator"} + classes=($class) prefix="-P $class$separator" _ri_get_methods return @@ -89,24 +90,25 @@ _ri() if [[ $ri_version == integrated ]]; then # integrated ri from Ruby 1.9 - classes=( $( ri -c 2>/dev/null | ruby -ne 'if /^\s*$/..$stdin.eof then \ - if /^ +[A-Z]/ then print; end; end' 2>/dev/null ) ) + classes=($(ri -c 2>/dev/null | ruby -ne 'if /^\s*$/..$stdin.eof then \ + if /^ +[A-Z]/ then print; end; end' 2>/dev/null)) elif [[ $ri_major && $ri_major -ge 3 ]]; then - classes=( $( ri -l 2>/dev/null ) ) + classes=($(ri -l 2>/dev/null)) elif [[ $ri_version == "ri 1.8a" ]]; then - classes=( $( ruby -W0 $ri_path | \ + classes=($(ruby -W0 $ri_path | ruby -ne 'if /^'"'"'ri'"'"' has/..$stdin.eof then \ - if /^ .*[A-Z]/ then print; end; end' )) + if /^ .*[A-Z]/ then print; end; end')) else - classes=( $( ruby -W0 $ri_path | \ + classes=($(ruby -W0 $ri_path | ruby -ne 'if /^I have/..$stdin.eof then \ - if /^ .*[A-Z]/ then print; end; end' )) + if /^ .*[A-Z]/ then print; end; end')) fi - COMPREPLY=( $( compgen -W '${classes[@]}' -- "$cur" ) ) + ((${#classes[@]})) && + COMPREPLY=($(compgen -W '"${classes[@]}"' -- "$cur")) __ltrim_colon_completions "$cur" - if [[ "$cur" == [A-Z]* ]]; then + if [[ $cur == [A-Z]* ]]; then # we're completing on class or module alone return fi @@ -115,6 +117,6 @@ _ri() method=$cur _ri_get_methods } && -complete -F _ri ri + complete -F _ri ri # ex: filetype=sh diff --git a/completions/rmlist b/completions/rmlist index ff827473c0b..0cc473a9bc1 100644 --- a/completions/rmlist +++ b/completions/rmlist @@ -5,13 +5,13 @@ _rmlist() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--archives --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--archives --help' -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _rmlist rmlist + complete -F _rmlist rmlist # ex: filetype=sh diff --git a/completions/rmmod b/completions/rmmod index 9868c79a0d9..7ec29e6cb95 100644 --- a/completions/rmmod +++ b/completions/rmmod @@ -7,18 +7,18 @@ _rmmod() _init_completion || return case $prev in - -h|--help|-V|--version) + -h | --help | -V | --version) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi _installed_modules "$cur" } && -complete -F _rmmod rmmod + complete -F _rmmod rmmod # ex: filetype=sh diff --git a/completions/route b/completions/route index 128ebc1690e..9551a6489d9 100644 --- a/completions/route +++ b/completions/route @@ -17,14 +17,15 @@ _route() for opt in add del -host -net netmask metric mss window irtt reject mod \ dyn reinstate dev default gw; do found=false - for (( i=1; i < ${#words[@]}-1; i++ )); do - [[ ${words[i]} == $opt ]] && found=true && break + for ((i = 1; i < ${#words[@]} - 1; i++)); do + [[ ${words[i]} == "$opt" ]] && found=true && break done - $found || COMPREPLY[${#COMPREPLY[@]}]="$opt" + $found || COMPREPLY+=("$opt") done - COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) ) + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) } && -complete -F _route route + complete -F _route route # ex: filetype=sh diff --git a/completions/rpcdebug b/completions/rpcdebug index e4358dc6941..6e2b88c56a0 100644 --- a/completions/rpcdebug +++ b/completions/rpcdebug @@ -2,18 +2,18 @@ _rpcdebug_flags() { - local i module - for (( i=0; i < ${#words[@]}; i++ )); do + for ((i = 1; i < ${#words[@]}; i++)); do if [[ ${words[i]} == -m ]]; then - module=${words[i+1]} + module=${words[i + 1]} + break fi done if [[ -n $module ]]; then - COMPREPLY=( $( compgen -W "$( rpcdebug -vh 2>&1 | \ - command sed -ne 's/^'$module'[[:space:]]\{1,\}//p' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(rpcdebug -vh 2>&1 | + command sed -ne 's/^'$module'[[:space:]]\{1,\}//p')" -- "$cur")) fi } @@ -32,16 +32,15 @@ _rpcdebug() return ;; -*m) - COMPREPLY=( $( compgen -W 'rpc nfs nfsd nlm' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'rpc nfs nfsd nlm' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h ) -s -c' \ - -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" -h) -s -c' -- "$cur")) fi } && -complete -F _rpcdebug rpcdebug + complete -F _rpcdebug rpcdebug # ex: filetype=sh diff --git a/completions/rpm b/completions/rpm index e42fbd720e6..562a75cb6da 100644 --- a/completions/rpm +++ b/completions/rpm @@ -4,41 +4,41 @@ _rpm_installed_packages() { - if [[ -r /var/log/rpmpkgs && \ + if [[ -r /var/log/rpmpkgs && /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]]; then # using RHL 7.2 or later - this is quicker than querying the DB - COMPREPLY=( $( compgen -W "$( command sed -ne \ + COMPREPLY=($(compgen -W "$(command sed -ne \ 's|^\([^[:space:]]\{1,\}\)-[^[:space:]-]\{1,\}-[^[:space:]-]\{1,\}\.rpm$|\1|p' \ - /var/log/rpmpkgs )" -- "$cur" ) ) - elif type rpmqpack &>/dev/null ; then + /var/log/rpmpkgs)" -- "$cur")) + elif type rpmqpack &>/dev/null; then # SUSE's rpmqpack is faster than rpm -qa - COMPREPLY=( $( compgen -W '$( rpmqpack )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(rpmqpack)' -- "$cur")) else - COMPREPLY=( $( ${1:-rpm} -qa --nodigest --nosignature \ - --queryformat='%{NAME} ' "$cur*" 2>/dev/null ) ) + COMPREPLY=($(${1:-rpm} -qa --nodigest --nosignature \ + --queryformat='%{NAME} ' "$cur*" 2>/dev/null)) fi } _rpm_groups() { local IFS=$'\n' - COMPREPLY=( $( compgen -W "$( ${1:-rpm} -qa --nodigest --nosignature \ - --queryformat='%{GROUP}\n' 2>/dev/null )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(${1:-rpm} -qa --nodigest --nosignature \ + --queryformat='%{GROUP}\n' 2>/dev/null)" -- "$cur")) } _rpm_macros() { # get a list of macros - COMPREPLY=( $( compgen -W "$( ${1:-rpm} --showrc | command sed -ne \ - 's/^-\{0,1\}[0-9]\{1,\}[:=][[:space:]]\{1,\}\([^[:space:](]\{3,\}\).*/%\1/p' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(${1:-rpm} --showrc | command sed -ne \ + 's/^-\{0,1\}[0-9]\{1,\}[:=][[:space:]]\{1,\}\([^[:space:](]\{3,\}\).*/%\1/p')" \ + -- "$cur")) } _rpm_buildarchs() { - COMPREPLY=( $( compgen -W "$( ${1:-rpm} --showrc | command sed -ne \ - 's/^\s*compatible\s\s*build\s\s*archs\s*:\s*\(.*\)/\1/ p' )" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(${1:-rpm} --showrc | command sed -ne \ + 's/^\s*compatible\s\s*build\s\s*archs\s*:\s*\(.*\)/\1/ p')" \ + -- "$cur")) } # rpm(8) completion @@ -48,36 +48,35 @@ _rpm() local cur prev words cword split _init_completion -s || return - if [[ $cword -eq 1 ]]; then + if ((cword == 1)); then # first parameter on line case $cur in --*) - COMPREPLY=( $( compgen -W '--help --version --initdb + COMPREPLY=($(compgen -W '--help --version --initdb --checksig --addsign --delsign --rebuilddb --showrc --setperms --setugids --eval --install --upgrade --query --freshen --erase --verify --querytags --import' \ - -- "$cur" ) ) + -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W '-e -E -F -i -q -t -U -V' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W '-e -E -F -i -q -t -U -V' -- "$cur")) ;; esac return fi case $prev in - --dbpath|--excludepath|--prefix|--relocate|--root|-!(-*)r) + --dbpath | --excludepath | --prefix | --relocate | --root | -!(-*)r) _filedir -d return ;; - --eval|-!(-*)E) + --eval | -!(-*)E) _rpm_macros $1 return ;; --pipe) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) return ;; --rcfile) @@ -89,28 +88,28 @@ _rpm() _filedir spec return ;; - --whatenhances|--whatprovides|--whatrecommends|--whatrequires|\ - --whatsuggests|--whatsupplements) - if [[ "$cur" == */* ]]; then + --whatenhances | --whatprovides | --whatrecommends | --whatrequires | \ + --whatsuggests | --whatsupplements) + if [[ $cur == */* ]]; then _filedir else # complete on capabilities local IFS=$'\n' fmt case $prev in - *enhances) fmt=ENHANCENAME ;; - *provides) fmt=PROVIDENAME ;; - *recommends) fmt=RECOMMENDNAME ;; - *requires) fmt=REQUIRENAME ;; - *suggests) fmt=SUGGESTNAME ;; - *supplements) fmt=SUPPLEMENTNAME ;; + *enhances) fmt="%{ENHANCENAME}" ;; + *provides) fmt="%{PROVIDENAME}" ;; + *recommends) fmt="%{RECOMMENDNAME}" ;; + *requires) fmt="%{REQUIRENAME}" ;; + *suggests) fmt="%{SUGGESTNAME}" ;; + *supplements) fmt="%{SUPPLEMENTNAME}" ;; esac - COMPREPLY=( $( compgen -W "$( $1 -qa --nodigest --nosignature \ - --queryformat=\"%{$fmt}\\n\" 2>/dev/null | - command grep -vF '(none)' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 -qa --nodigest --nosignature \ + --queryformat=\"$fmt\\n\" 2>/dev/null | + command grep -vF '(none)')" -- "$cur")) fi return ;; - --define|--fileid|--hdrid|--pkgid|-!(-*)D) + --define | --fileid | --hdrid | --pkgid | -!(-*)D) # argument required but no completions available return ;; @@ -119,119 +118,122 @@ _rpm() $split && return # options common to all modes - local opts="--define= --eval= --macros= --nodigest --nosignature --rcfile= - --quiet --pipe --verbose" + local -a opts=( + --define= --eval= --macros= --nodigest --nosignature --rcfile= --quiet + --pipe --verbose + ) case ${words[1]} in - -[iFU]*|--install|--freshen|--upgrade) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --percent --force --test + -[iFU]* | --install | --freshen | --upgrade) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '${opts[@]} --percent --force --test --replacepkgs --replacefiles --root --excludedocs --includedocs --noscripts --ignorearch --dbpath --prefix= --ignoreos --nodeps --allfiles --ftpproxy --ftpport --justdb --httpproxy --httpport --noorder --relocate= --badreloc --notriggers --excludepath= --ignoresize --oldpackage --queryformat --repackage - --nosuggests" -- "$cur" ) ) + --nosuggests' -- "$cur")) else _filedir '[rs]pm' fi ;; - -e|--erase) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --allmatches --noscripts - --notriggers --nodeps --test --repackage" -- "$cur" ) ) + -e | --erase) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '${opts[@]} --allmatches --noscripts + --notriggers --nodeps --test --repackage' -- "$cur")) else _rpm_installed_packages $1 fi ;; - -q*|--query) + -q* | --query) # options common to all query types - opts+=" --changelog --configfiles --conflicts --docfiles --dump + opts+=( + --changelog --configfiles --conflicts --docfiles --dump --enhances --filesbypkg --filecaps --fileclass --filecolor --fileprovide --filerequire --filesbypkg --info --list --obsoletes --pipe --provides --queryformat= --requires --scripts --suggests --triggers --xml --recommends - --supplements --filetriggers --licensefiles" + --supplements --filetriggers --licensefiles + ) - if [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then + if [[ ${words[*]} == *\ -@(*([^ -])f|-file )* ]]; then # -qf completion - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext - --last --root --state" -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '${opts[@]} --dbpath --fscontext + --last --root --state' -- "$cur")) else _filedir fi - elif [[ ${words[@]} == *\ -@(*([^ -])g|-group )* ]]; then + elif [[ ${words[*]} == *\ -@(*([^ -])g|-group )* ]]; then # -qg completion _rpm_groups $1 - elif [[ ${words[@]} == *\ -@(*([^ -])p|-package )* ]]; then + elif [[ ${words[*]} == *\ -@(*([^ -])p|-package )* ]]; then # -qp; uninstalled package completion - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --ftpport --ftpproxy - --httpport --httpproxy --nomanifest" -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '${opts[@]} --ftpport --ftpproxy + --httpport --httpproxy --nomanifest' -- "$cur")) else _filedir '[rs]pm' fi else # -q; installed package completion - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --all --file --fileid + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '${opts[@]} --all --file --fileid --dbpath --fscontext --ftswalk --group --hdrid --last --package --pkgid --root= --specfile --state --triggeredby --whatenhances --whatprovides --whatrecommends --whatrequires --whatsuggests - --whatsupplements" \ - -- "$cur" ) ) - elif [[ ${words[@]} != *\ -@(*([^ -])a|-all )* ]]; then + --whatsupplements' -- "$cur")) + elif [[ ${words[*]} != *\ -@(*([^ -])a|-all )* ]]; then _rpm_installed_packages $1 fi fi ;; - -K*|--checksig) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --nopgp --nogpg --nomd5" \ - -- "$cur" ) ) + -K* | --checksig) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '${opts[@]} --nopgp --nogpg --nomd5' \ + -- "$cur")) else _filedir '[rs]pm' fi ;; - -[Vy]*|--verify) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --root= --dbpath --nodeps + -[Vy]* | --verify) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '${opts[@]} --root= --dbpath --nodeps --nogroup --nolinkto --nomode --nomtime --nordev --nouser --nofiles --noscripts --nomd5 --querytags --specfile --whatenhances --whatprovides --whatrecommends - --whatrequires --whatsuggests --whatsupplements" \ - -- "$cur" ) ) + --whatrequires --whatsuggests --whatsupplements' \ + -- "$cur")) # check whether we're doing file completion - elif [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then + elif [[ ${words[*]} == *\ -@(*([^ -])f|-file )* ]]; then _filedir - elif [[ ${words[@]} == *\ -@(*([^ -])g|-group )* ]]; then + elif [[ ${words[*]} == *\ -@(*([^ -])g|-group )* ]]; then _rpm_groups $1 - elif [[ ${words[@]} == *\ -@(*([^ -])p|-package )* ]]; then + elif [[ ${words[*]} == *\ -@(*([^ -])p|-package )* ]]; then _filedir '[rs]pm' else _rpm_installed_packages $1 fi ;; - --resign|--addsign|--delsign) + --resign | --addsign | --delsign) _filedir '[rs]pm' ;; - --setperms|--setgids) + --setperms | --setgids) _rpm_installed_packages $1 ;; - --import|--dbpath|--root) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--import --dbpath --root=' \ - -- "$cur" ) ) + --import | --dbpath | --root) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--import --dbpath --root=' \ + -- "$cur")) else _filedir fi ;; esac - [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && -complete -F _rpm rpm + complete -F _rpm rpm _rpmbuild() { @@ -239,33 +241,33 @@ _rpmbuild() _init_completion -s || return local rpm="${1%build*}" - [[ $rpm == $1 ]] || ! type $rpm &>/dev/null && rpm= + [[ $rpm == "$1" ]] || ! type $rpm &>/dev/null && rpm= case $prev in - --buildroot|--root|--dbpath|-!(-*)r) + --buildroot | --root | --dbpath | -!(-*)r) _filedir -d return ;; --target) - _rpm_buildarchs + _rpm_buildarchs $rpm return ;; - --eval|-!(-*)E) + --eval | -!(-*)E) _rpm_macros $rpm return ;; - --macros|--rcfile) + --macros | --rcfile) _filedir return ;; --buildpolicy) - local cfgdir=$( $rpm --eval '%{_rpmconfigdir}' 2>/dev/null ) + local cfgdir=$($rpm --eval '%{_rpmconfigdir}' 2>/dev/null) if [[ $cfgdir ]]; then - COMPREPLY=( $( compgen -W "$( command ls $cfgdir 2>/dev/null \ - | command sed -ne 's/^brp-//p' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$(command ls $cfgdir 2>/dev/null | + command sed -ne 's/^brp-//p')" -- "$cur")) fi ;; - --define|--with|--without|-!(-*)D) + --define | --with | --without | -!(-*)D) return ;; esac @@ -273,24 +275,24 @@ _rpmbuild() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W "$(_parse_help "$1")" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi # Figure out file extensions to complete local word ext - for word in ${words[@]}; do + for word in "${words[@]}"; do case $word in - -b?|--clean|--nobuild) + -b? | --clean | --nobuild) ext=spec break ;; - -t?|--tarbuild) + -t? | --tarbuild) ext='@(t?(ar.)@([gx]z|bz?(2))|tar?(.@(lzma|Z)))' break ;; - --rebuild|--recompile) + --rebuild | --recompile) ext='@(?(no)src.r|s)pm' break ;; @@ -298,6 +300,6 @@ _rpmbuild() done [[ -n $ext ]] && _filedir $ext } && -complete -F _rpmbuild rpmbuild rpmbuild-md5 + complete -F _rpmbuild rpmbuild rpmbuild-md5 # ex: filetype=sh diff --git a/completions/rpm2tgz b/completions/rpm2tgz index abdf321bf22..5ddcfd59388 100644 --- a/completions/rpm2tgz +++ b/completions/rpm2tgz @@ -5,13 +5,13 @@ _rpm2tgz() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-s -S -n -r -d -c' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-s -S -n -r -d -c' -- "$cur")) return fi _filedir "rpm" } && -complete -F _rpm2tgz rpm2tgz rpm2txz rpm2targz + complete -F _rpm2tgz rpm2tgz rpm2txz rpm2targz # ex: filetype=sh diff --git a/completions/rpmcheck b/completions/rpmcheck index 565f1313b3b..cf4ed958798 100644 --- a/completions/rpmcheck +++ b/completions/rpmcheck @@ -12,13 +12,13 @@ _rpmcheck() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-explain -failures -successes -dump - -dump-all -base -help -compressed-input' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '-explain -failures -successes -dump + -dump-all -base -help -compressed-input' -- "$cur")) else _filedir fi } && -complete -F _rpmcheck rpmcheck + complete -F _rpmcheck rpmcheck # ex: filetype=sh diff --git a/completions/rrdtool b/completions/rrdtool index 705be0d0dbb..dcb9ce67ac9 100644 --- a/completions/rrdtool +++ b/completions/rrdtool @@ -1,17 +1,17 @@ # bash completion for rrdtool -*- shell-script -*- -_rrdtool () +_rrdtool() { local cur prev words cword _init_completion || return - if [[ ${#words[@]} -eq 2 ]]; then - COMPREPLY=( $( compgen -W 'create update updatev graph dump restore - last lastupdate first info fetch tune resize xport' -- "$cur" ) ) + if ((${#words[@]} == 2)); then + COMPREPLY=($(compgen -W 'create update updatev graph dump restore + last lastupdate first info fetch tune resize xport' -- "$cur")) else _filedir rrd fi } && -complete -F _rrdtool rrdtool + complete -F _rrdtool rrdtool # ex: filetype=sh diff --git a/completions/rsync b/completions/rsync index 55a2a859a7f..f0689dbc1f8 100644 --- a/completions/rsync +++ b/completions/rsync @@ -6,26 +6,27 @@ _rsync() _init_completion -s -n : || return case $prev in - --config|--password-file|--include-from|--exclude-from|--files-from|\ - --log-file|--write-batch|--only-write-batch|--read-batch) + --config | --password-file | --include-from | --exclude-from | \ + --files-from | --log-file | --write-batch | --only-write-batch | \ + --read-batch) compopt +o nospace _filedir return ;; - --temp-dir|--compare-dest|--backup-dir|--partial-dir|--copy-dest|\ - --link-dest|-!(-*)T) + --temp-dir | --compare-dest | --backup-dir | --partial-dir | \ + --copy-dest | --link-dest | -!(-*)T) compopt +o nospace _filedir -d return ;; - --rsh|-!(-*)e) + --rsh | -!(-*)e) compopt +o nospace - COMPREPLY=( $( compgen -W 'rsh ssh' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'rsh ssh' -- "$cur")) return ;; --compress-level) compopt +o nospace - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) return ;; esac @@ -36,40 +37,23 @@ _rsync() case $cur in -*) - COMPREPLY=( $( compgen -W '--verbose --quiet --no-motd --checksum - --archive --recursive --relative --no-implied-dirs - --backup --backup-dir= --suffix= --update --inplace --append - --append-verify --dirs --old-dirs --links --copy-links - --copy-unsafe-links --safe-links --copy-dirlinks - --keep-dirlinks --hard-links --perms --executability --chmod= - --acls --xattrs --owner --group --devices --copy-devices - --specials --times --omit-dir-times --super --fake-super - --sparse --dry-run --whole-file --no-whole-file - --one-file-system --block-size= --rsh= --rsync-path= - --existing --ignore-existing --remove-source-files --delete - --delete-before --delete-during --delete-delay --delete-after - --delete-excluded --ignore-errors --force --max-delete= - --max-size= --min-size= --partial --partial-dir= - --delay-updates --prune-empty-dirs --numeric-ids --timeout= - --contimeout= --ignore-times --size-only --modify-window= - --temp-dir= --fuzzy --compare-dest= --copy-dest= --link-dest= - --compress --compress-level= --skip-compress= --cvs-exclude - --filter= --exclude= --exclude-from= --include= --include-from= - --files-from= --from0 --protect-args --address= --port= - --sockopts= --blocking-io --no-blocking-io --stats - --8-bit-output --human-readable --progress --itemize-changes - --out-format= --log-file= --log-file-format= --password-file= - --list-only --bwlimit= --write-batch= --only-write-batch= - --read-batch= --protocol= --iconv= --ipv4 --ipv6 --version - --help --daemon --config= --no-detach' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] || compopt +o nospace + COMPREPLY=($( + # Account for the fact that older rsync versions (before cba00be6, meaning before v3.2.0) + # contain the following unusual line in --help: + # "(-h) --help show this help (-h is --help only if used alone)" + compgen -W '$( + "$1" --help 2>&1 | sed -e "s/^([^)]*)//" | _parse_help -) + --daemon --old-d{,irs} + --no-{blocking-io,detach,whole-file,inc-recursive,i-r}' -X '--no-OPTION' -- "$cur" + )) + [[ ${COMPREPLY-} == *= ]] || compopt +o nospace ;; *:*) # find which remote shell is used local i shell=ssh - for (( i=1; i < cword; i++ )); do - if [[ "${words[i]}" == -@(e|-rsh) ]]; then - shell=${words[i+1]} + for ((i = 1; i < cword; i++)); do + if [[ ${words[i]} == -@(e|-rsh) ]]; then + shell=${words[i + 1]} break fi done @@ -81,6 +65,6 @@ _rsync() ;; esac } && -complete -F _rsync -o nospace rsync + complete -F _rsync -o nospace rsync # ex: filetype=sh diff --git a/completions/sbcl b/completions/sbcl index 3db4a39ac1b..22a93e4ad66 100644 --- a/completions/sbcl +++ b/completions/sbcl @@ -8,14 +8,14 @@ _sbcl() _init_completion || return # completing an option (may or may not be separated by a space) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--core --noinform --help --version + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--core --noinform --help --version --sysinit --userinit --eval --noprint --disable-debugger - --end-runtime-options --end-toplevel-options ' -- "$cur" ) ) + --end-runtime-options --end-toplevel-options ' -- "$cur")) else _filedir fi } && -complete -F _sbcl sbcl sbcl-mt + complete -F _sbcl sbcl sbcl-mt # ex: filetype=sh diff --git a/completions/sbopkg b/completions/sbopkg index e5742af6bd4..35423b303be 100644 --- a/completions/sbopkg +++ b/completions/sbopkg @@ -5,14 +5,14 @@ _sbopkg() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) - [[ $COMPREPLY ]] && return + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) + [[ ${COMPREPLY-} ]] && return fi case "$prev" in -e) - COMPREPLY=( $( compgen -W 'ask continue stop' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ask continue stop' -- "$cur")) return ;; -f) @@ -24,12 +24,12 @@ _sbopkg() return ;; -V) - COMPREPLY=( $( compgen -W "? - $( sbopkg -V ? 2>&1 | cut -s -f1 )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "? + $(sbopkg -V '?' 2>&1 | cut -s -f1)" -- "$cur")) return ;; - -i|-b) - ;; + -i | -b) ;; + *) return ;; @@ -37,34 +37,39 @@ _sbopkg() local i config config="/etc/sbopkg/sbopkg.conf" - for (( i=${#words[@]}-1; i>0; i-- )); do - if [[ "${words[i]}" == -f ]]; then - config="${words[i+1]}" + for ((i = ${#words[@]} - 1; i > 0; i--)); do + if [[ ${words[i]} == -f ]]; then + config="${words[i + 1]}" __expand_tilde_by_ref config break fi done - [[ -r "$config" ]] || return + [[ -r $config ]] || return . $config - for (( i=1; i<${#words[@]}; i++ )); do + for ((i = 1; i < ${#words[@]}; i++)); do case "${words[i]}" in -V) - REPO_NAME="${words[i+1]%%/*}" - REPO_BRANCH="${words[i+1]#*/}" + REPO_NAME="${words[i + 1]%%/*}" + REPO_BRANCH="${words[i + 1]#*/}" ;; -d) - REPO_ROOT="${words[i+1]}" + REPO_ROOT="${words[i + 1]}" ;; esac done [[ -r $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/SLACKBUILDS.TXT ]] || return - COMPREPLY=( $( command sed -ne "/^SLACKBUILD NAME: $cur/{s/^SLACKBUILD NAME: //;p}"\ - $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/SLACKBUILDS.TXT ) - $( cd $QUEUEDIR; compgen -f -X "!*.sqf" -- "$cur" ) ) + COMPREPLY=($( + command sed -ne "/^SLACKBUILD NAME: $cur/{s/^SLACKBUILD NAME: //;p}" \ + $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/SLACKBUILDS.TXT + ) + $( + command cd -- $QUEUEDIR + compgen -f -X "!*.sqf" -- "$cur" + )) } && -complete -F _sbopkg sbopkg + complete -F _sbopkg sbopkg # ex: filetype=sh diff --git a/completions/screen b/completions/screen index eb4b62394fe..ca21a9ac8d9 100644 --- a/completions/screen +++ b/completions/screen @@ -2,93 +2,123 @@ _screen_sessions() { - local sessions=( $( command screen -ls | command sed -ne \ - 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p' ) ) + local sessions=($(command screen -ls | command sed -ne \ + 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p')) + ((${#sessions[@]} == 0)) && return if [[ $cur == +([0-9])?(.*) ]]; then # Complete sessions including pid prefixes - COMPREPLY=( $( compgen -W '${sessions[@]}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '${sessions[@]}' -- "$cur")) else # Create unique completions, dropping pids where possible local -A res local i tmp - for i in ${sessions[@]}; do + for i in "${sessions[@]}"; do res[${i/#+([0-9])./}]+=" $i" done - for i in ${!res[@]}; do - [[ ${res[$i]} == \ *\ * ]] && tmp+=" ${res[$i]}" || tmp+=" $i" + for i in "${!res[@]}"; do + [[ ${res[i]} == \ *\ * ]] && tmp+=" ${res[i]}" || tmp+=" $i" done - COMPREPLY=( $( compgen -W '$tmp' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$tmp' -- "$cur")) fi } && -_screen() -{ - local cur prev words cword - _init_completion || return + _screen() + { + local cur prev words cword + _init_completion || return - if ((cword > 2)); then - case ${words[cword-2]} in - -*[dD]) - _screen_sessions + if ((cword == 1)); then + if [[ $cur == /dev* ]]; then + COMPREPLY=($(compgen -W "$( + shopt -s nullglob + printf '%s\n' \ + /dev/serial/*/* /dev/ttyUSB* /dev/ttyACM* 2>/dev/null + )" \ + -- "$cur")) return - ;; - esac - fi + fi + if [[ $cur == //* ]]; then + COMPREPLY=($(compgen -W '//telnet' -- "$cur")) + return + fi + fi - local i - for (( i=1; i <= cword; i++ )); do - case ${words[i]} in - -*[rRdDxscTehpSt]) - (( i++ )) - continue + case ${words[1]} in + /dev*) + if ((cword == 2)); then + COMPREPLY=($(compgen -W '110 300 600 1200 2400 4800 9600 \ + 14400 19200 38400 57600 115200 128000 256000' -- "$cur")) + # TODO more, comma separated options + fi + return ;; - -*) - continue + //telnet) + ((cword == 2)) && _known_hosts_real -- "$cur" + return ;; esac - _command_offset $i - return - done + if ((cword > 2)); then + case ${words[cword - 2]} in + -*[dD]) + _screen_sessions + return + ;; + esac + fi - case $prev in - -*[rR]) - # list detached - _screen_sessions 'Detached' - return - ;; - -*[dD]) - # list attached - _screen_sessions 'Attached' - return - ;; - -*x) - # list both - _screen_sessions - return - ;; - -*s) - _shells - return - ;; - -*c) - _filedir - return - ;; - -T) - _terms - return - ;; - -*[ehpSt]) + local i + for ((i = 1; i <= cword; i++)); do + case ${words[i]} in + -*[rRdDxscTehpSt]) + ((i++)) + continue + ;; + -*) + continue + ;; + esac + + _command_offset $i return - ;; - esac + done - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln -list - -L -m -O -p -q -r -R -s -S -t -T -U -v -wipe -x -X --help - --version' -- "$cur" ) ) - fi -} && -complete -F _screen screen + case $prev in + -*[rR]) + # list detached + _screen_sessions 'Detached' + return + ;; + -*[dD]) + # list attached + _screen_sessions 'Attached' + return + ;; + -*x) + # list both + _screen_sessions + return + ;; + -*s) + _shells + return + ;; + -*c) + _filedir + return + ;; + -T) + _terms + return + ;; + -*[ehpSt]) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + fi + } && + complete -F _screen screen # ex: filetype=sh diff --git a/completions/scrub b/completions/scrub index 06c694be007..838edcb8336 100644 --- a/completions/scrub +++ b/completions/scrub @@ -6,16 +6,17 @@ _scrub() _init_completion -s || return case $prev in - --version|--help|--blocksize|--device-size|--dirent|-!(-*)[vhbsD]) + --version | --help | --blocksize | --device-size | --dirent | \ + -!(-*)[vhbsD]) return ;; - --pattern|-!(-*)p) - COMPREPLY=( $( compgen -W '$( "$1" --help 2>&1 | - awk "/^Available/{flag=1;next}/^ /&&flag{print \$1}" )' \ - -- "$cur" ) ) + --pattern | -!(-*)p) + COMPREPLY=($(compgen -W '$("$1" --help 2>&1 | + awk "/^Available/{flag=1;next}/^ /&&flag{print \$1}")' \ + -- "$cur")) return ;; - --freespace|-!(-*)X) + --freespace | -!(-*)X) _filedir -d return ;; @@ -24,13 +25,13 @@ _scrub() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi _filedir } && -complete -F _scrub scrub + complete -F _scrub scrub # ex: filetype=sh diff --git a/completions/secret-tool b/completions/secret-tool new file mode 100644 index 00000000000..0722aa0299f --- /dev/null +++ b/completions/secret-tool @@ -0,0 +1,52 @@ +# bash completion for secret-tool(1) -*- shell-script -*- + +_secret_tool() +{ + local cur prev words cword split + _init_completion -s || return + + $split && return + + local -i i + local mode word + for i in ${!words[*]}; do + if [[ $i -gt 0 && ${words[i]} != -* ]]; then + ((i != cword)) && mode=${words[i]} + break + fi + done + if [[ ! -v mode ]]; then + local -a modes + modes=($("$1" nonexistent-mode 2>&1 | + while read -r first second third rest; do + if [[ $first == "${1##*/}" ]]; then + printf "%s\n" "$second" + elif [[ $first == usage: && $second == "${1##*/}" ]]; then + printf "%s\n" "$third" + fi + done)) + ((${#modes[@]})) && + COMPREPLY=($(compgen -W '"${modes[@]}"' -- "$cur")) + return + fi + + case $mode in + store) + if [[ ${words[*]} != *\ --label[\ =]* ]]; then + COMPREPLY=($(compgen -W "--label=" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + fi + ;; + search) + local -A opts=([--all]="" [--unlock]="") + for word in "${words[@]:2}"; do + [[ $word ]] && unset -v 'opts[$word]' + done + ((${#opts[@]})) && + COMPREPLY=($(compgen -W '"${!opts[@]}"' -- "$cur")) + ;; + esac +} && + complete -F _secret_tool secret-tool + +# ex: filetype=sh diff --git a/completions/sh b/completions/sh index 2b0bcd138ed..5624ffa3d7d 100644 --- a/completions/sh +++ b/completions/sh @@ -9,28 +9,28 @@ _sh() -c) return ;; - -o|+o) - COMPREPLY=( $( compgen -W 'allexport errexit ignoreeof monitor + -o | +o) + COMPREPLY=($(compgen -W 'allexport errexit ignoreeof monitor noclobber noglob noexec nolog notify nounset verbose vi - xtrace' -- "$cur" ) ) + xtrace' -- "$cur")) return ;; esac local opts="-a -b -C -e -f -h -i -m -n -o -u -v -x" - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts -c -s" -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W "$opts -c -s" -- "$cur")) return - elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W "${opts//-/+}" -- "$cur" ) ) + elif [[ $cur == +* ]]; then + COMPREPLY=($(compgen -W "${opts//-/+}" -- "$cur")) return fi local args ext= _count_args "" "@(-c|[-+]o)" - [[ $args -eq 1 ]] && ext=sh + ((args == 1)) && ext="sh" _filedir $ext } && -complete -F _sh sh + complete -F _sh sh # ex: filetype=sh diff --git a/completions/sha256sum b/completions/sha256sum new file mode 100644 index 00000000000..63fb16b6817 --- /dev/null +++ b/completions/sha256sum @@ -0,0 +1,38 @@ +# bash completion for sha256(1) and friends -*- shell-script -*- + +_comp_cmd_sha256sum() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -h | --help | --version) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + _longopt "$1" + return + fi + + local sumtype=${1##*/} + sumtype=${sumtype%sum} + + local opt + for opt in "${words[@]}"; do + if [[ $opt == -@(c|-check) ]]; then + _filedir $sumtype + return + fi + done + + _filedir + ((${#COMPREPLY[@]})) && + COMPREPLY=($(compgen -X "*.$sumtype" -W '"${COMPREPLY[@]}"' -- "$cur")) +} && + complete -F _comp_cmd_sha256sum md5sum sha{,1,224,256,384,512}sum + +# ex: filetype=sh diff --git a/completions/shellcheck b/completions/shellcheck new file mode 100644 index 00000000000..6421d7b6e33 --- /dev/null +++ b/completions/shellcheck @@ -0,0 +1,63 @@ +# bash completion for shellcheck(1) -*- shell-script -*- + +_shellcheck_optarg() +{ + local args=$("$1" --help 2>&1 | + command sed -e 's/,/ /g' -ne 's/^.*'$2'\>.*(\([^)]*\)).*/\1/p') + COMPREPLY+=($(compgen -W '$args' -- "$cur")) +} + +_shellcheck() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --version | -!(-*)V*) + return + ;; + --exclude | --include | -!(-*)[ei]) + return + ;; + --format | -!(-*)f) + local args=$("$1" --format=nonexistent-format /dev/null 2>&1 | + command sed -ne '/^Supported formats/,//p' | + command sed -ne '/^[[:space:]]/p') + COMPREPLY=($(compgen -W '$args' -- "$cur")) + return + ;; + --color | -!(-*)C) + _shellcheck_optarg "$1" --color + return + ;; + --shell | -!(-*)s) + _shellcheck_optarg "$1" --shell + return + ;; + --enable | -!(-*)o) + COMPREPLY=($(compgen -W 'all' -- "$cur")) # TODO others? + return + ;; + --source-path | -!(-*)P) + _filedir -d + COMPREPLY+=($(compgen -W 'SCRIPTDIR' -- "$cur")) + return + ;; + --wiki-link-count | -!(-*)W) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + return + fi + + _filedir +} && + complete -F _shellcheck shellcheck + +# ex: filetype=sh diff --git a/completions/sitecopy b/completions/sitecopy index 6aae8f20834..85156875bf0 100644 --- a/completions/sitecopy +++ b/completions/sitecopy @@ -9,17 +9,17 @@ _sitecopy() _init_completion -s || return case $prev in - --debug|-!(-*)d) - COMPREPLY=( $( compgen -W "socket files rcfile ftp http httpbody - rsh sftp xml xmlparse cleartext" -- "$cur" ) ) + --debug | -!(-*)d) + COMPREPLY=($(compgen -W "socket files rcfile ftp http httpbody + rsh sftp xml xmlparse cleartext" -- "$cur")) compopt -o nospace return ;; - --logfile|--rcfile|-!(-*)[gr]) + --logfile | --rcfile | -!(-*)[gr]) _filedir return ;; - --storepath|-!(-*)p) + --storepath | -!(-*)p) _filedir -d return ;; @@ -27,24 +27,24 @@ _sitecopy() case $cur in --*) - COMPREPLY=( $( compgen -W "$(_parse_help $1)" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W "$(_parse_help $1)" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return ;; # only complete long options -) compopt -o nospace - COMPREPLY=( -- ) + COMPREPLY=(--) return ;; esac if [[ -r ~/.sitecopyrc ]]; then - COMPREPLY=( $( compgen -W "$($1 -v | \ - command sed -n '/^Site:/s/Site: //p')" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 -v | + command sed -n '/^Site:/s/Site: //p')" -- "$cur")) fi } && -complete -F _sitecopy -o default sitecopy + complete -F _sitecopy -o default sitecopy # ex: filetype=sh diff --git a/completions/slackpkg b/completions/slackpkg deleted file mode 100644 index 83396a4e0e8..00000000000 --- a/completions/slackpkg +++ /dev/null @@ -1,107 +0,0 @@ -# bash completion for slackpkg(8) -*- shell-script -*- -# options list is based on `grep '\-.*\=.*)' /usr/sbin/slackpkg | cut -f1 -d\)` - -_slackpkg() -{ - local cur prev words cword - _init_completion -n = || return - - local split=false - if [[ "$cur" == -?*=* ]]; then - prev="${cur%%?(\\)=*}" - cur="${cur#*=}" - split=true - fi - - case "$prev" in - -delall|-checkmd5|-checkgpg|-checksize|-postinst|-onoff|-download_all|\ - -dialog|-batch|-only_new_dotnew|-use_includes|-spinning) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) - return - ;; - -default_answer) - COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) ) - return - ;; - -dialog_maxargs|-mirror) - # argument required but no completions available - return - ;; - esac - - $split && return - - if [[ "$cur" == -* ]]; then - compopt -o nospace - COMPREPLY=( $( compgen -W '-delall= -checkmd5= -checkgpg= - -checksize= -postinst= -onoff= -download_all= -dialog= - -dialog_maxargs= -batch= -only_new_dotnew= -use_includes= - -spinning= -default_answer= -mirror=' -- "$cur" ) ) - return - fi - - local confdir="/etc/slackpkg" - local config="$confdir/slackpkg.conf" - - [[ -r "$config" ]] || return - . "$config" - - local i action - for (( i=1; i<${#words[@]}; i++ )); do - if [[ "${words[i]}" != -* ]]; then - action="${words[i]}" - break - fi - done - - case "$action" in - generate-template|search|file-search) - # argument required but no completions available - return - ;; - install-template|remove-template) - if [[ -e $confdir/templates ]]; then - COMPREPLY=( $( cd "$confdir/templates"; \ - compgen -f -X "!*.template" -- "$cur" ) ) - COMPREPLY=( ${COMPREPLY[@]%.template} ) - fi - return - ;; - remove) - _filedir - COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap xfce y' -- "$cur" ) ) - COMPREPLY+=( $( cd /var/log/packages; compgen -f -- "$cur" ) ) - return - ;; - install|reinstall|upgrade|blacklist|download) - _filedir - COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap xfce y' -- "$cur" ) ) - COMPREPLY+=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ - command grep "^$cur" ) ) - return - ;; - info) - COMPREPLY=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ - command grep "^$cur" ) ) - return - ;; - update) - # we should complete the same as the next `list` + "gpg" - COMPREPLY=( $( compgen -W 'gpg' -- "$cur" ) ) - ;& - *) - COMPREPLY+=( $( compgen -W 'install reinstall upgrade remove - blacklist download update install-new upgrade-all - clean-system new-config check-updates help generate-template - install-template remove-template search file-search info' -- \ - "$cur" ) ) - return - ;; - esac - -} && -complete -F _slackpkg slackpkg - -# ex: filetype=sh diff --git a/completions/slapt-get b/completions/slapt-get index 512981b6201..5d6375d59be 100644 --- a/completions/slapt-get +++ b/completions/slapt-get @@ -6,25 +6,28 @@ _slapt_get() _init_completion || return case "$prev" in - --config|-c) + --config | -c) _filedir return ;; - --retry|--search) + --retry | --search) # argument required but no completions available return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - [[ $COMPREPLY ]] && return + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur")) + if [[ ${COMPREPLY-} ]]; then + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi fi local i t - # search for last action (--install|--install-set|--remove|--show|--filelist) - for (( i=${#words[@]}-1; i>0; i-- )); do + # search for last action + # (--install|--install-set|--remove|--show|--filelist) + for ((i = ${#words[@]} - 1; i > 0; i--)); do if [[ ${words[i]} == --show ]]; then t="all" break @@ -42,40 +45,43 @@ _slapt_get() local config="/etc/slapt-get/slapt-getrc" # default config location # search for config - for (( i=${#words[@]}-1; i>0; i-- )); do + for ((i = ${#words[@]} - 1; i > 0; i--)); do if [[ ${words[i]} == -@(c|-config) ]]; then - config="${words[i+1]}" + config="${words[i + 1]}" __expand_tilde_by_ref config break fi done - [[ -r "$config" ]] || return + [[ -r $config ]] || return case $t in all) # --show # slapt-get will fail to search for "^name-version" # it can search for names only local name=${cur%%-*} - COMPREPLY=( $( LC_ALL=C "$1" -c "$config" --search "^$name" 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}" ) ) + COMPREPLY=($(LC_ALL=C "$1" -c "$config" --search "^$name" \ + 2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p;}")) return ;; avl) # --install|-i| - COMPREPLY=( $( LC_ALL=C "$1" -c "$config" --available 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}" ) ) + COMPREPLY=($(LC_ALL=C "$1" -c "$config" --available \ + 2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p;}")) return ;; ins) # --remove|--filelist - COMPREPLY=( $( cd /var/log/packages; compgen -f -- "$cur" ) ) + COMPREPLY=($( + command cd /var/log/packages + compgen -f -- "$cur" + )) return ;; set) # --install-set - COMPREPLY=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap xfce y' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'a ap d e f k kde kdei l n t tcl x + xap xfce y' -- "$cur")) return ;; esac } && -complete -F _slapt_get slapt-get + complete -F _slapt_get slapt-get # ex: filetype=sh diff --git a/completions/slapt-src b/completions/slapt-src index 2f65415f54d..c6efb5c123b 100644 --- a/completions/slapt-src +++ b/completions/slapt-src @@ -6,11 +6,11 @@ _slapt_src() _init_completion -s -n : || return case "$prev" in - --config|-c) + --config | -c) _filedir return ;; - --search|-s|--postprocess|-p) + --search | -s | --postprocess | -p) # argument required but no completions available return ;; @@ -18,15 +18,17 @@ _slapt_src() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - [[ $COMPREPLY ]] && return + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" --help)' -- "$cur")) + if [[ ${COMPREPLY-} ]]; then + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi fi local i t # search for last action (-i|-w|-b|-f) - for (( i=${#words[@]}-1; i>0; i-- )); do + for ((i = ${#words[@]} - 1; i > 0; i--)); do if [[ ${words[i]} == -@([iwfb]|-install|-show|-build|-fetch) ]]; then t="all" break @@ -38,9 +40,9 @@ _slapt_src() local config="/etc/slapt-get/slapt-srcrc" # default config location # search for config - for (( i=${#words[@]}-1; i>0; i-- )); do + for ((i = ${#words[@]} - 1; i > 0; i--)); do if [[ ${words[i]} == -@(c|-config) ]]; then - config="${words[i+1]}" + config="${words[i + 1]}" __expand_tilde_by_ref config break fi @@ -49,19 +51,18 @@ _slapt_src() break fi done - [[ -r "$config" ]] || return + [[ -r $config ]] || return - if [[ "$cur" == *:* ]]; then + if [[ $cur == *:* ]]; then local name=${cur%:*} - local version=${cur##*:} - COMPREPLY=( $( LC_ALL=C "$1" --config "$config" --search "^$name" 2> \ - /dev/null | LC_ALL=C command sed -ne \ - "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}" ) ) + COMPREPLY=($(LC_ALL=C "$1" --config "$config" --search "^$name" \ + 2>/dev/null | LC_ALL=C command sed -ne \ + "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p;}")) else - COMPREPLY=( $( LC_ALL=C "$1" --config "$config" --search "^$cur" 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}" ) ) + COMPREPLY=($(LC_ALL=C "$1" --config "$config" --search "^$cur" \ + 2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p;}")) fi } && -complete -F _slapt_src slapt-src + complete -F _slapt_src slapt-src # ex: filetype=sh diff --git a/completions/smartctl b/completions/smartctl index e55bfa560db..ee45a7c3276 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -2,25 +2,27 @@ _smartctl_quietmode() { - COMPREPLY=( $( compgen -W 'errorsonly silent noserial' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'errorsonly silent noserial' -- "$cur")) } _smartctl_device() { case $cur in - areca*|3ware*|megaraid*|cciss*) - COMPREPLY+=( ${cur%%,*},{0..31} ) - COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) ) + areca* | 3ware* | megaraid* | cciss*) + # shellcheck disable=SC2054 + COMPREPLY+=(${cur%%,*},{0..31}) + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) ;; hpt*) - COMPREPLY+=( hpt,{1..4}/{1..8} hpt,{1..4}/{1..8}/{1..5} ) - COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) ) + # shellcheck disable=SC2054 + COMPREPLY+=(hpt,{1..4}/{1..8} hpt,{1..4}/{1..8}/{1..5}) + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur")) ;; *) - COMPREPLY=( $( compgen -W "ata scsi sat usbcypress usbjmicron + COMPREPLY=($(compgen -W "ata scsi sat usbcypress usbjmicron usbsunplus marvell areca 3ware hpt megaraid cciss auto test" \ - -- "$cur" ) ) + -- "$cur")) case "${COMPREPLY[@]}" in - areca|3ware|hpt|megaraid|cciss) + areca | 3ware | hpt | megaraid | cciss) compopt -o nospace ;; esac @@ -29,64 +31,64 @@ _smartctl_device() } _smartctl_tolerance() { - COMPREPLY=( $( compgen -W 'normal conservative permissive verypermissive' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'normal conservative permissive verypermissive' \ + -- "$cur")) } _smartctl_badsum() { - COMPREPLY=( $( compgen -W 'warn exit ignore' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'warn exit ignore' -- "$cur")) } _smartctl_report() { - COMPREPLY=( $( compgen -W 'ioctl ataioctl scsiioctl' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'ioctl ataioctl scsiioctl' -- "$cur")) } _smartctl_powermode() { - COMPREPLY=( $( compgen -W 'never sleep standby idle' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'never sleep standby idle' -- "$cur")) } _smartctl_feature() { - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) } _smartctl_log() { - COMPREPLY=( $( compgen -W 'error selftest selective directory background + COMPREPLY=($(compgen -W 'error selftest selective directory background sasphy sasphy,reset sataphy sataphy,reset scttemp scttempsts - scttemphist scterc gplog smartlog xerror xselftest' -- "$cur" ) ) + scttemphist scterc gplog smartlog xerror xselftest' -- "$cur")) } _smartctl_vendorattribute() { - COMPREPLY=( $( compgen -W 'help 9,minutes 9,seconds 9,halfminutes 9,temp + COMPREPLY=($(compgen -W 'help 9,minutes 9,seconds 9,halfminutes 9,temp 192,emergencyretractcyclect 193,loadunload 194,10xCelsius 194,unknown 198,offlinescanuncsectorct 200,writeerrorcount 201,detectedtacount - 220,temp' -- "$cur" ) ) + 220,temp' -- "$cur")) } _smartctl_firmwarebug() { - COMPREPLY=( $( compgen -W 'none samsung samsung2 samsung3 swapid' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'none samsung samsung2 samsung3 swapid' \ + -- "$cur")) } _smartctl_presets() { - COMPREPLY=( $( compgen -W 'use ignore show showall' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'use ignore show showall' -- "$cur")) } _smartctl_test() { [[ $cur == @(pending|scttempint|vendor), ]] && return - COMPREPLY=( $( compgen -W 'offline short long conveyance select, + COMPREPLY=($(compgen -W 'offline short long conveyance select, select,redo select,next afterselect,on afterselect,off pending, - scttempint, vendor,' -- "$cur" ) ) - [[ $COMPREPLY == *, ]] && compopt -o nospace + scttempint, vendor,' -- "$cur")) + [[ ${COMPREPLY-} == *, ]] && compopt -o nospace } _smartctl_drivedb() { local prefix= - if [[ $cur == +* ]] ; then + if [[ $cur == +* ]]; then prefix=+ cur="${cur#+}" fi _filedir h - [[ -n $prefix ]] && COMPREPLY=( "${COMPREPLY[@]/#/$prefix}" ) + [[ -n $prefix ]] && COMPREPLY=("${COMPREPLY[@]/#/$prefix}") } _smartctl() @@ -95,54 +97,54 @@ _smartctl() _init_completion -s || return case $prev in - --quietmode|-!(-*)q) + --quietmode | -!(-*)q) _smartctl_quietmode ;; - --device|-!(-*)d) + --device | -!(-*)d) _smartctl_device return ;; - --tolerance|-!(-*)T) + --tolerance | -!(-*)T) _smartctl_tolerance return ;; - --badsum|-!(-*)b) + --badsum | -!(-*)b) _smartctl_badsum return ;; - --report|-!(-*)r) + --report | -!(-*)r) _smartctl_report return ;; - --nocheck|-!(-*)n) + --nocheck | -!(-*)n) _smartctl_powermode return ;; - --smart|--offlineauto|--saveauto|-!(-*)[soS]) + --smart | --offlineauto | --saveauto | -!(-*)[soS]) _smartctl_feature return ;; - --log|-!(-*)l) + --log | -!(-*)l) _smartctl_log return ;; - --vendorattribute|-!(-*)v) + --vendorattribute | -!(-*)v) _smartctl_vendorattribute return ;; - --firmwarebug|-!(-*)F) + --firmwarebug | -!(-*)F) _smartctl_firmwarebug return ;; - --presets|-!(-*)P) + --presets | -!(-*)P) _smartctl_presets return ;; - --drivedb|-!(-*)B) + --drivedb | -!(-*)B) _smartctl_drivedb return ;; - --test|-!(-*)t) + --test | -!(-*)t) _smartctl_test return ;; @@ -150,19 +152,14 @@ _smartctl() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version --info --all --xall - --scan --scan-open --quietmode= --device= --tolerance= --badsum= - --report= --nocheck= --smart= --offlineauto= --saveauto= --health - --capabilities --attributes --log= --vendorattribute= - --firmwarebug= --presets= --drivedb= --test= --captive --abort' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else cur=${cur:=/dev/} _filedir fi } && -complete -F _smartctl smartctl + complete -F _smartctl smartctl # ex: filetype=sh diff --git a/completions/smbclient b/completions/smbclient index 3a64d65fe42..496163fd9d2 100644 --- a/completions/smbclient +++ b/completions/smbclient @@ -2,40 +2,41 @@ _samba_resolve_order() { - COMPREPLY=( $( compgen -W 'lmhosts host wins bcast' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'lmhosts host wins bcast' -- "$cur")) } _samba_domains() { if [[ -n ${COMP_SAMBA_SCAN:-} ]]; then - COMPREPLY=( $( compgen -W '$( smbtree -N -D )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(smbtree -N -D)' -- "$cur")) fi } _samba_hosts() { if [[ -n ${COMP_SAMBA_SCAN:-} ]]; then - COMPREPLY=( $( compgen -W "$( smbtree -N -S | \ - command sed -ne 's/^[[:space:]]*\\\\*\([^[:space:]]*\).*/\1/p' \ - )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$( + smbtree -N -S | + command sed -ne 's/^[[:space:]]*\\\\*\([^[:space:]]*\).*/\1/p' + )" -- "$cur")) fi } _samba_debuglevel() { - COMPREPLY=( $( compgen -W '{0..10}' -- "$cur" ) ) + COMPREPLY=($(compgen -W '{0..10}' -- "$cur")) } _samba_sockopts() { - COMPREPLY=( $( compgen -W 'SO_KEEPALIVE SO_REUSEADDR SO_BROADCAST + COMPREPLY=($(compgen -W 'SO_KEEPALIVE SO_REUSEADDR SO_BROADCAST TCP_NODELAY IPTOS_LOWDELAY IPTOS_THROUGHPUT SO_SNDBUF SO_RCVBUF - SO_SNDLOWAT SO_RCVLOWAT' -- "$cur" ) ) + SO_SNDLOWAT SO_RCVLOWAT' -- "$cur")) } _samba_signing() { - COMPREPLY=( $( compgen -W 'on off required' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on off required' -- "$cur")) } _smbclient() @@ -44,64 +45,65 @@ _smbclient() _init_completion -s || return case $prev in - --name-resolve|-!(-*)R) + --name-resolve | -!(-*)R) _samba_resolve_order return ;; -!(-*)t) - COMPREPLY=( $( compgen -W 'SJIS EUC JIS7 JIS8 JUNET HEX CAP' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'SJIS EUC JIS7 JIS8 JUNET HEX CAP' \ + -- "$cur")) return ;; - --configfile|--authentication-file|-!(-*)[sA]) + --configfile | --authentication-file | -!(-*)[sA]) _filedir return ;; - --log-basename|--directory|-!(-*)[lD]) + --log-basename | --directory | -!(-*)[lD]) _filedir -d return ;; - --socket-options|-!(-*)O) + --socket-options | -!(-*)O) _samba_sockopts return ;; -!(-*)T) - COMPREPLY=( $( compgen -W 'c x I X F b g q r N a' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'c x I X F b g q r N a' -- "$cur")) return ;; - --workgroup|-!(-*)W) + --workgroup | -!(-*)W) _samba_domains return ;; - --debuglevel|-!(-*)d) + --debuglevel | -!(-*)d) _samba_debuglevel return ;; - --list|-!(-*)L) + --list | -!(-*)L) _samba_hosts return ;; - --signing|-!(-*)S) + --signing | -!(-*)S) _samba_signing return ;; - --port|--message|--ip-address|--send-buffer|--user|--netbiosname|\ - --scope|--tar|--command|--max-protocol|-!(-*)[pMIbUniTcm]) + --port | --message | --ip-address | --send-buffer | --user | \ + --netbiosname | --scope | --tar | --command | --max-protocol | \ + -!(-*)[pMIbUniTcm]) return ;; - --help|--version|-!(-*)[?V]) + --help | --version | -!(-*)[?V]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _smbclient smbclient + complete -F _smbclient smbclient _smbget() { @@ -109,31 +111,31 @@ _smbget() _init_completion -s || return case $prev in - --outputfile|--rcfile|-!(-*)[of]) + --outputfile | --rcfile | -!(-*)[of]) _filedir return ;; - --debuglevel|-!(-*)d) + --debuglevel | -!(-*)d) _samba_debuglevel return ;; - --workgroup|-!(-*)w) + --workgroup | -!(-*)w) _samba_domains return ;; - --username|--password|--blocksize|-!(-*)[upb]) + --username | --password | --blocksize | -!(-*)[upb]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _smbget smbget + complete -F _smbget smbget _smbcacls() { @@ -141,15 +143,15 @@ _smbcacls() _init_completion -s || return case $prev in - --configfile|--authentication-file|-!(-*)[As]) + --configfile | --authentication-file | -!(-*)[As]) _filedir return ;; - --log-basename|-!(-*)l) + --log-basename | -!(-*)l) _filedir -d return ;; - --debuglevel|-!(-*)d) + --debuglevel | -!(-*)d) _samba_debuglevel return ;; @@ -157,28 +159,28 @@ _smbcacls() _samba_signing return ;; - --socket-options|-!(-*)O) + --socket-options | -!(-*)O) _samba_sockopts return ;; - --workgroup|-!(-*)W) + --workgroup | -!(-*)W) _samba_domains return ;; - --help|--usage|--delete|--modify|--add|--set|--chown|--chgrp|\ - --netbiosname|--scope|--user|-!(-*)[?DMaSCGniU]) + --help | --usage | --delete | --modify | --add | --set | --chown | \ + --chgrp | --netbiosname | --scope | --user | -!(-*)[?DMaSCGniU]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _smbcacls smbcacls + complete -F _smbcacls smbcacls _smbcquotas() { @@ -186,15 +188,15 @@ _smbcquotas() _init_completion -s || return case $prev in - --configfile|--authentication-file|-!(-*)[sA]) + --configfile | --authentication-file | -!(-*)[sA]) _filedir return ;; - --log-basename|-!(-*)l) + --log-basename | -!(-*)l) _filedir -d return ;; - --debuglevel|-!(-*)d) + --debuglevel | -!(-*)d) _samba_debuglevel return ;; @@ -202,19 +204,19 @@ _smbcquotas() _samba_signing return ;; - --help|--usage|--user|--set|-!(-*)[?UuS]) + --help | --usage | --user | --set | -!(-*)[?UuS]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _smbcquotas smbcquotas + complete -F _smbcquotas smbcquotas _smbpasswd() { @@ -243,11 +245,11 @@ _smbpasswd() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) fi } && -complete -F _smbpasswd smbpasswd + complete -F _smbpasswd smbpasswd _smbtar() { @@ -276,11 +278,11 @@ _smbtar() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _smbtar smbtar + complete -F _smbtar smbtar _smbtree() { @@ -288,34 +290,34 @@ _smbtree() _init_completion -s || return case $prev in - --configfile|--authentication-file|-!(-*)[sA]) + --configfile | --authentication-file | -!(-*)[sA]) _filedir return ;; - --log-basename|-!(-*)l) + --log-basename | -!(-*)l) _filedir -d return ;; - --debuglevel|-!(-*)d) + --debuglevel | -!(-*)d) _samba_debuglevel return ;; - --signing|-!(-*)S) + --signing | -!(-*)S) _samba_signing return ;; - --help|--usage|--user|-!(-*)[?U]) + --help | --usage | --user | -!(-*)[?U]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _smbtree smbtree + complete -F _smbtree smbtree # ex: filetype=sh diff --git a/completions/snownews b/completions/snownews index b5b070da5b8..5b585d92486 100644 --- a/completions/snownews +++ b/completions/snownews @@ -5,11 +5,11 @@ _snownews() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # return list of available options - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) fi } && -complete -F _snownews snownews + complete -F _snownews snownews # ex: filetype=sh diff --git a/completions/sqlite3 b/completions/sqlite3 index 73cad6a60c2..80cc660e2f9 100644 --- a/completions/sqlite3 +++ b/completions/sqlite3 @@ -8,8 +8,8 @@ _sqlite3() local dbexts='@(sqlite?(3)|?(s?(3))db)' case $prev in - -help|-version|-lookaside|-mmap|-newline|-nullvalue|-pagecache|\ - -scratch|-separator|*.$dbexts) + -help | -version | -lookaside | -maxsize | -mmap | -newline | \ + -nullvalue | -pagecache | -scratch | -separator | -vfs | *.$dbexts) return ;; -init) @@ -18,21 +18,21 @@ _sqlite3() ;; -cmd) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) return ;; esac - [[ $cword -gt 2 && ${words[cword-2]} == -@(lookaside|pagecache|scratch) ]] \ - && return + [[ $cword -gt 2 && ${words[cword - 2]} == -@(lookaside|pagecache|scratch) ]] && + return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur")) return fi _filedir "$dbexts" } && -complete -F _sqlite3 sqlite3 + complete -F _sqlite3 sqlite3 # ex: filetype=sh diff --git a/completions/ss b/completions/ss index af501a9bfa3..c7987182ff4 100644 --- a/completions/ss +++ b/completions/ss @@ -6,23 +6,20 @@ _ss() _init_completion -s || return case $prev in - --help|--version|-!(-*)[hV]) + --help | --version | -!(-*)[hV]) return ;; - --family|-!(-*)f) - COMPREPLY=( $( compgen -W 'unix inet inet6 link netlink' \ - -- "$cur" ) ) + --family | -!(-*)f) + COMPREPLY=($(compgen -W 'unix inet inet6 link netlink' \ + -- "$cur")) return ;; - --query|-!(-*)A) - local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -W '$( "$1" --help | \ - command sed -e "s/|/ /g" -ne "s/.*QUERY := {\([^}]*\)}.*/\1/p" )' \ - -- "${cur##*,}" ) ) - [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) + --query | -!(-*)A) + _comp_delimited , -W "$("$1" --help | + command sed -e 's/|/ /g' -ne 's/.*QUERY := {\([^}]*\)}.*/\1/p')" return ;; - --diag|--filter|-!(-*)[DF]) + --diag | --filter | -!(-*)[DF]) _filedir return ;; @@ -31,10 +28,14 @@ _ss() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + elif [[ $prev == state ]]; then + COMPREPLY=($(compgen -W 'all connected synchronized bucket big + established syn-sent syn-recv fin-wait-{1,2} time-wait closed + close-wait last-ack listening closing' -- "$cur")) fi } && -complete -F _ss ss + complete -F _ss ss # ex: filetype=sh diff --git a/completions/ssh b/completions/ssh index 1335f302c48..06ac0bd21f4 100644 --- a/completions/ssh +++ b/completions/ssh @@ -2,9 +2,12 @@ _ssh_queries() { - COMPREPLY+=( $( compgen -W \ - "cipher cipher-auth mac kex key key-cert key-plain protocol-version" \ - -- "$cur" ) ) + local queries=$(_ssh_query "$1" help) + [[ $queries ]] || queries="cipher cipher-auth mac kex key key-cert + key-plain key-sig protocol-version compression sig ciphers macs + kexalgorithms pubkeyacceptedkeytypes hostkeyalgorithms + hostbasedkeytypes hostbasedacceptedkeytypes" + COMPREPLY+=($(compgen -W "$queries help" -- "${cur,,}")) } _ssh_query() @@ -14,50 +17,68 @@ _ssh_query() _ssh_ciphers() { - local ciphers='$( _ssh_query "$1" cipher )' + local ciphers=$(_ssh_query "$1" cipher) [[ $ciphers ]] || ciphers="3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 arcfour256 arcfour blowfish-cbc cast128-cbc" - COMPREPLY+=( $( compgen -W "$ciphers" -- "$cur" ) ) + COMPREPLY+=($(compgen -W "$ciphers" -- "$cur")) } _ssh_macs() { - local macs='$( _ssh_query "$1" mac )' + local macs=$(_ssh_query "$1" mac) [[ $macs ]] || macs="hmac-md5 hmac-sha1 umac-64@openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96" - COMPREPLY+=( $( compgen -W "$macs" -- "$cur" ) ) + COMPREPLY+=($(compgen -W "$macs" -- "$cur")) } _ssh_options() { - compopt -o nospace - COMPREPLY=( $( compgen -S = -W 'AddKeysToAgent AddressFamily BatchMode - BindAddress CanonicalDomains CanonicalizeFallbackLocal - CanonicalizeHostname CanonicalizeMaxDots CanonicalizePermittedCNAMEs - CertificateFile ChallengeResponseAuthentication CheckHostIP Cipher - Ciphers ClearAllForwardings Compression CompressionLevel - ConnectionAttempts ConnectTimeout ControlMaster ControlPath - ControlPersist DynamicForward EnableSSHKeysign EscapeChar - ExitOnForwardFailure FingerprintHash ForwardAgent ForwardX11 - ForwardX11Timeout ForwardX11Trusted GatewayPorts GlobalKnownHostsFile - GSSAPIAuthentication GSSAPIClientIdentity GSSAPIDelegateCredentials - GSSAPIKeyExchange GSSAPIRenewalForcesRekey GSSAPIServerIdentity - GSSAPITrustDns HashKnownHosts Host HostbasedAuthentication - HostbasedKeyTypes HostKeyAlgorithms HostKeyAlias HostName + # curl --silent https://raw.githubusercontent.com/openssh/openssh-portable/master/ssh_config.5 | awk '$1==".It" && $2=="Cm" && $3!="Host" && $3!="Match" {print " "$3}' | sort + local opts=( + AddKeysToAgent AddressFamily BatchMode BindAddress BindInterface + CanonicalDomains CanonicalizeFallbackLocal CanonicalizeHostname + CanonicalizeMaxDots CanonicalizePermittedCNAMEs CASignatureAlgorithms + CertificateFile ChallengeResponseAuthentication CheckHostIP Ciphers + ClearAllForwardings Compression ConnectionAttempts ConnectTimeout + ControlMaster ControlPath ControlPersist DynamicForward + EnableSSHKeysign EscapeChar ExitOnForwardFailure FingerprintHash + ForwardAgent ForwardX11 ForwardX11Timeout ForwardX11Trusted + GatewayPorts GlobalKnownHostsFile GSSAPIAuthentication + GSSAPIDelegateCredentials HashKnownHosts HostbasedAuthentication + HostbasedKeyTypes HostKeyAlgorithms HostKeyAlias Hostname IdentitiesOnly IdentityAgent IdentityFile IgnoreUnknown Include IPQoS KbdInteractiveAuthentication KbdInteractiveDevices KexAlgorithms LocalCommand LocalForward LogLevel MACs NoHostAuthenticationForLocalhost NumberOfPasswordPrompts PasswordAuthentication PermitLocalCommand PKCS11Provider Port - PreferredAuthentications Protocol ProxyCommand ProxyJump ProxyUseFdpass - PubkeyAcceptedKeyTypes PubkeyAuthentication RekeyLimit RemoteForward - RequestTTY RevokedHostKeys RhostsRSAAuthentication RSAAuthentication - SendEnv ServerAliveCountMax ServerAliveInterval SmartcardDevice - StreamLocalBindMask StreamLocalBindUnlink StrictHostKeyChecking - TCPKeepAlive Tunnel TunnelDevice UpdateHostKeys UsePrivilegedPort User - UserKnownHostsFile VerifyHostKeyDNS VisualHostKey XAuthLocation' \ - -- "$cur" ) ) + PreferredAuthentications ProxyCommand ProxyJump ProxyUseFdpass + PubkeyAcceptedKeyTypes PubkeyAuthentication RekeyLimit RemoteCommand + RemoteForward RequestTTY RevokedHostKeys SecurityKeyProvider SendEnv + ServerAliveCountMax ServerAliveInterval SetEnv StreamLocalBindMask + StreamLocalBindUnlink StrictHostKeyChecking SyslogFacility TCPKeepAlive + Tunnel TunnelDevice UpdateHostKeys User UserKnownHostsFile + VerifyHostKeyDNS VisualHostKey XAuthLocation + ) + # Selected old ones + opts+=( + GSSAPIKeyExchange GSSAPIRenewalForcesRekey GSSAPIServerIdentity + GSSAPITrustDns SmartcardDevice UsePrivilegedPort + ) + local protocols=$(_ssh_query "${1:-ssh}" protocol-version) + if [[ -z $protocols || $protocols == *1* ]]; then + opts+=(Cipher CompressionLevel Protocol RhostsRSAAuthentication + RSAAuthentication) + fi + + compopt -o nospace + local IFS=$' \t\n' reset=$(shopt -p nocasematch) + shopt -s nocasematch + local option + COMPREPLY=($(for option in "${opts[@]}"; do + [[ $option == "$cur"* ]] && printf '%s=\n' "$option" + done)) + $reset } # Complete a ssh suboption (like ForwardAgent=y) @@ -70,83 +91,117 @@ _ssh_suboption() # Split into subopt and subval local prev=${1%%=*} cur=${1#*=} - case $prev in - BatchMode|CanonicalDomains|CanonicalizeFallbackLocal|\ - ChallengeResponseAuthentication|CheckHostIP|\ - ClearAllForwardings|ControlPersist|Compression|EnableSSHKeysign|\ - ExitOnForwardFailure|ForwardAgent|ForwardX11|ForwardX11Trusted|\ - GatewayPorts|GSSAPIAuthentication|GSSAPIKeyExchange|\ - GSSAPIDelegateCredentials|GSSAPIRenewalForcesRekey|GSSAPITrustDns|\ - HashKnownHosts|HostbasedAuthentication|IdentitiesOnly|\ - KbdInteractiveAuthentication|KbdInteractiveDevices|\ - NoHostAuthenticationForLocalhost|PasswordAuthentication|\ - ProxyUseFdpass|PubkeyAuthentication|RhostsRSAAuthentication|\ - RSAAuthentication|StrictHostKeyChecking|StreamLocalBindUnlink|\ - TCPKeepAlive|UsePrivilegedPort|VerifyHostKeyDNS|VisualHostKey) - COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) ) - ;; - AddKeysToAgent) - COMPREPLY=( $( compgen -W 'yes ask confirm no' -- "$cur" ) ) - ;; - AddressFamily) - COMPREPLY=( $( compgen -W 'any inet inet6' -- "$cur" ) ) - ;; - BindAddress) + case ${prev,,} in + batchmode | canonicaldomains | canonicalizefallbacklocal | \ + challengeresponseauthentication | checkhostip | \ + clearallforwardings | controlpersist | compression | \ + enablesshkeysign | exitonforwardfailure | forwardagent | \ + forwardx11 | forwardx11trusted | gatewayports | \ + gssapiauthentication | gssapikeyexchange | \ + gssapidelegatecredentials | gssapirenewalforcesrekey | \ + gssapitrustdns | hashknownhosts | hostbasedauthentication | \ + identitiesonly | kbdinteractiveauthentication | \ + kbdinteractivedevices | nohostauthenticationforlocalhost | \ + passwordauthentication | permitlocalcommand | proxyusefdpass | \ + pubkeyauthentication | rhostsrsaauthentication | \ + rsaauthentication | streamlocalbindunlink | \ + tcpkeepalive | useprivilegedport | visualhostkey) + COMPREPLY=($(compgen -W 'yes no' -- "$cur")) + ;; + addkeystoagent) + COMPREPLY=($(compgen -W 'yes ask confirm no' -- "$cur")) + ;; + addressfamily) + COMPREPLY=($(compgen -W 'any inet inet6' -- "$cur")) + ;; + bindaddress) _ip_addresses ;; - CanonicalizeHostname) - COMPREPLY=( $( compgen -W 'yes no always' -- "$cur" ) ) + canonicalizehostname) + COMPREPLY=($(compgen -W 'yes no always' -- "$cur")) + ;; + identityfile) + _ssh_identityfile ;; - *File|IdentityAgent|Include) + *file | identityagent | include | controlpath | revokedhostkeys | \ + xauthlocation) _filedir ;; - Cipher) - COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$cur" ) ) + casignaturealgorithms) + COMPREPLY=($(compgen -W '$(_ssh_query "$2" sig)' -- "$cur")) ;; - Ciphers) + cipher) + COMPREPLY=($(compgen -W 'blowfish des 3des' -- "$cur")) + ;; + ciphers) _ssh_ciphers "$2" ;; - CompressionLevel) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + controlmaster) + COMPREPLY=($(compgen -W 'yes ask auto autoask no' -- "$cur")) + ;; + compressionlevel) + COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) ;; - FingerprintHash) - COMPREPLY=( $( compgen -W 'md5 sha256' -- "$cur" ) ) + fingerprinthash) + COMPREPLY=($(compgen -W 'md5 sha256' -- "$cur")) ;; - IPQoS) - COMPREPLY=( $( compgen -W 'af1{1..4} af2{2..3} af3{1..3} af4{1..3} - cs{0..7} ef lowdelay throughput reliability' -- "$cur" ) ) + ipqos) + COMPREPLY=($(compgen -W 'af1{1..4} af2{2..3} af3{1..3} af4{1..3} + cs{0..7} ef lowdelay throughput reliability' -- "$cur")) ;; - HostbasedKeyTypes|HostKeyAlgorithms) - COMPREPLY=( $( compgen -W '$( _ssh_query "$2" key )' -- "$cur" ) ) + hostbasedkeytypes | hostkeyalgorithms) + COMPREPLY=($(compgen -W '$(_ssh_query "$2" key)' -- "$cur")) ;; - KexAlgorithms) - COMPREPLY=( $( compgen -W '$( _ssh_query "$2" kex )' -- "$cur" ) ) + kexalgorithms) + COMPREPLY=($(compgen -W '$(_ssh_query "$2" kex)' -- "$cur")) ;; - MACs) + loglevel) + COMPREPLY=($( + compgen -W 'QUIET FATAL ERROR INFO VERBOSE DEBUG{,1,2,3}' \ + -- "$cur" + )) + ;; + macs) _ssh_macs "$2" ;; - PreferredAuthentications) - COMPREPLY=( $( compgen -W 'gssapi-with-mic host-based publickey - keyboard-interactive password' -- "$cur" ) ) + pkcs11provider) + _filedir so + ;; + preferredauthentications) + COMPREPLY=($(compgen -W 'gssapi-with-mic host-based publickey + keyboard-interactive password' -- "$cur")) + ;; + protocol) + local protocols=($(_ssh_query "$2" protocol-version)) + [[ $protocols ]] || protocols=(1 2) + if ((${#protocols[@]} > 1)); then + COMPREPLY=($(compgen -W '${protocols[@]}' -- "$cur")) + fi + ;; + proxyjump) + _known_hosts_real -a ${configfile:+-F "$configfile"} -- "$cur" + ;; + proxycommand | remotecommand | localcommand) + COMPREPLY=($(compgen -c -- "$cur")) ;; - Protocol) - COMPREPLY=( $( compgen -W '1 2 1,2 2,1' -- "$cur" ) ) + pubkeyacceptedkeytypes) + COMPREPLY=($(compgen -W '$(_ssh_query "$2" key)' -- "$cur")) ;; - ProxyJump) - _known_hosts_real -a -F "$configfile" -- "$cur" + requesttty) + COMPREPLY=($(compgen -W 'no yes force auto' -- "$cur")) ;; - PubkeyAcceptedKeyTypes) - COMPREPLY=( $( compgen -W '$( _ssh_query "$2" key )' -- "$cur" ) ) + stricthostkeychecking) + COMPREPLY=($(compgen -W 'accept-new ask no off' -- "$cur")) ;; - RequestTTY) - COMPREPLY=( $( compgen -W 'no yes force auto' -- "$cur" ) ) + syslogfacility) + COMPREPLY=($(compgen -W 'DAEMON USER AUTH LOCAL{0..7}' -- "$cur")) ;; - Tunnel) - COMPREPLY=( $( compgen -W 'yes no point-to-point ethernet' \ - -- "$cur" ) ) + tunnel) + COMPREPLY=($(compgen -W 'yes no point-to-point ethernet' \ + -- "$cur")) ;; - UpdateHostKeys) - COMPREPLY=( $( compgen -W 'yes no ask' -- "$cur" ) ) + updatehostkeys | verifyhostkeydns) + COMPREPLY=($(compgen -W 'yes no ask' -- "$cur")) ;; esac return 0 @@ -158,9 +213,9 @@ _ssh_suboption() _ssh_suboption_check() { # Get prev and cur words without splitting on = - local cureq=`_get_cword :=` preveq=`_get_pword :=` - if [[ $cureq == *=* && $preveq == -o ]]; then - _ssh_suboption $cureq "$1" + local cureq=$(_get_cword :=) preveq=$(_get_pword :=) + if [[ $cureq == *=* && $preveq == -*o ]]; then + _ssh_suboption $cureq "${1-}" return $? fi return 1 @@ -170,13 +225,13 @@ _ssh_suboption_check() _ssh_configfile() { set -- "${words[@]}" - while [[ $# -gt 0 ]]; do + while (($# > 0)); do if [[ $1 == -F* ]]; then - if [[ ${#1} -gt 2 ]]; then + if ((${#1} > 2)); then configfile="$(dequote "${1:2}")" else shift - [[ $1 ]] && configfile="$(dequote "$1")" + [[ ${1-} ]] && configfile="$(dequote "$1")" fi break fi @@ -184,13 +239,23 @@ _ssh_configfile() done } +# With $1 set, look for public key files, else private +# shellcheck disable=SC2120 +_ssh_identityfile() +{ + [[ -z $cur && -d ~/.ssh ]] && cur=~/.ssh/id + _filedir + if ((${#COMPREPLY[@]} > 0)); then + COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' \ + -X "${1:+!}*.pub" -- "$cur")) + fi +} + _ssh() { local cur prev words cword _init_completion -n : || return - local -a config - local configfile _ssh_configfile @@ -198,12 +263,12 @@ _ssh() local ipvx + # Keep cases sorted the same they're in ssh's usage message + # (but do group ones with same arg completion) case $prev in - -*4*) - ipvx=-4 - ;; - -*6*) - ipvx=-6 + -*B) + _available_interfaces -a + return ;; -*b) _ip_addresses @@ -216,7 +281,7 @@ _ssh() -*[DeLpRW]) return ;; - -*[EFiS]) + -*[EFS]) _filedir return ;; @@ -224,12 +289,16 @@ _ssh() _filedir so return ;; + -*i) + _ssh_identityfile + return + ;; -*J) - _known_hosts_real -a -F "$configfile" -- "$cur" + _known_hosts_real -a ${configfile:+-F "$configfile"} -- "$cur" return ;; -*l) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=($(compgen -u -- "$cur")) return ;; -*m) @@ -237,11 +306,11 @@ _ssh() return ;; -*O) - COMPREPLY=( $( compgen -W 'check forward exit stop' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'check forward cancel exit stop' -- "$cur")) return ;; -*o) - _ssh_options + _ssh_options "$1" return ;; -*Q) @@ -252,28 +321,36 @@ _ssh() _available_interfaces return ;; + -*4*) + ipvx=-4 + ;; + -*6*) + ipvx=-6 + ;; esac - if [[ "$cur" == -F* ]]; then + if [[ $cur == -F* ]]; then cur=${cur#-F} _filedir # Prefix completions with '-F' - COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) - cur=-F$cur # Restore cur - elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=("${COMPREPLY[@]/#/-F}") + cur=-F$cur # Restore cur + elif [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) else - _known_hosts_real $ipvx -a -F "$configfile" -- "$cur" - local args - _count_args - if [[ $args -gt 1 ]]; then + # Keep glob sort in sync with cases above + _count_args "=" "-*[BbcDeLpRWEFSIiJlmOoQw]" + if ((args > 1)); then compopt -o filenames - COMPREPLY+=( $( compgen -c -- "$cur" ) ) + COMPREPLY+=($(compgen -c -- "$cur")) + else + _known_hosts_real ${ipvx-} -a ${configfile:+-F "$configfile"} \ + -- "$cur" fi fi } && -shopt -u hostcomplete && complete -F _ssh ssh slogin autossh sidedoor + shopt -u hostcomplete && complete -F _ssh ssh slogin autossh sidedoor # sftp(1) completion # @@ -290,52 +367,63 @@ _sftp() local ipvx case $prev in - -*4*) - ipvx=-4 - ;; - -*6*) - ipvx=-6 - ;; -*[BDlPRs]) return ;; - -*[bFi]) + -*[bF]) _filedir return ;; + -*i) + _ssh_identityfile + return + ;; -*c) _ssh_ciphers return ;; + -*J) + _known_hosts_real -a ${configfile:+-F "$configfile"} -- "$cur" + return + ;; -*o) _ssh_options return ;; -*S) - _command + compopt -o filenames + COMPREPLY=($(compgen -c -- "$cur")) return ;; + -*4*) + ipvx=-4 + ;; + -*6*) + ipvx=-6 + ;; esac - if [[ "$cur" == -F* ]]; then + if [[ $cur == -F* ]]; then cur=${cur#-F} _filedir # Prefix completions with '-F' - COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) - cur=-F$cur # Restore cur - elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=("${COMPREPLY[@]/#/-F}") + cur=-F$cur # Restore cur + elif [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) else - _known_hosts_real $ipvx -a -F "$configfile" -- "$cur" + _known_hosts_real ${ipvx-} -a ${configfile:+-F "$configfile"} -- "$cur" fi } && -shopt -u hostcomplete && complete -F _sftp sftp + shopt -u hostcomplete && complete -F _sftp sftp # things we want to backslash escape in scp paths -_scp_path_esc='[][(){}<>",:;^&!$=?`|\\'"'"'[:space:]]' +# shellcheck disable=SC2089 +_scp_path_esc='[][(){}<>"'"'"',:;^&!$=?`\\|[:space:]]' # Complete remote files with ssh. If the first arg is -d, complete on dirs # only. Returns paths escaped with three backslashes. +# shellcheck disable=SC2120 _scp_remote_files() { local IFS=$'\n' @@ -347,28 +435,31 @@ _scp_remote_files() local path=${cur#*:} # unescape (3 backslashes to 1 for chars we escaped) - path=$( command sed -e 's/\\\\\\\('$_scp_path_esc'\)/\\\1/g' <<<"$path" ) + # shellcheck disable=SC2090 + path=$(command sed -e 's/\\\\\\\('"$_scp_path_esc"'\)/\\\1/g' <<<"$path") # default to home dir of specified user on remote host if [[ -z $path ]]; then - path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null) + path=$(ssh -o 'Batchmode yes' "$userhost" pwd 2>/dev/null) fi local files - if [[ $1 == -d ]]; then + if [[ ${1-} == -d ]]; then # escape problematic characters; remove non-dirs - files=$( ssh -o 'Batchmode yes' $userhost \ - command ls -aF1dL "$path*" 2>/dev/null | \ - command sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e '/[^\/]$/d' ) + # shellcheck disable=SC2090 + files=$(ssh -o 'Batchmode yes' "$userhost" \ + command ls -aF1dL "$path*" 2>/dev/null | + command sed -e 's/'"$_scp_path_esc"'/\\\\\\&/g' -e '/[^\/]$/d') else # escape problematic characters; remove executables, aliases, pipes # and sockets; add space at end of file names - files=$( ssh -o 'Batchmode yes' $userhost \ - command ls -aF1dL "$path*" 2>/dev/null | \ - command sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e 's/[*@|=]$//g' \ - -e 's/[^\/]$/& /g' ) + # shellcheck disable=SC2090 + files=$(ssh -o 'Batchmode yes' "$userhost" \ + command ls -aF1dL "$path*" 2>/dev/null | + command sed -e 's/'"$_scp_path_esc"'/\\\\\\&/g' -e 's/[*@|=]$//g' \ + -e 's/[^\/]$/& /g') fi - COMPREPLY+=( $files ) + COMPREPLY+=($files) } # This approach is used instead of _filedir to get a space appended @@ -380,18 +471,19 @@ _scp_local_files() local IFS=$'\n' local dirsonly=false - if [[ $1 == -d ]]; then + if [[ ${1-} == -d ]]; then dirsonly=true shift fi - if $dirsonly ; then - COMPREPLY+=( $( command ls -aF1dL $cur* 2>/dev/null | \ - command sed -e "s/$_scp_path_esc/\\\\&/g" -e '/[^\/]$/d' -e "s/^/$1/") ) + if $dirsonly; then + COMPREPLY+=($(command ls -aF1dL $cur* 2>/dev/null | + command sed -e "s/$_scp_path_esc/\\\\&/g" -e '/[^\/]$/d' \ + -e "s/^/${1-}/")) else - COMPREPLY+=( $( command ls -aF1dL $cur* 2>/dev/null | \ + COMPREPLY+=($(command ls -aF1dL $cur* 2>/dev/null | command sed -e "s/$_scp_path_esc/\\\\&/g" -e 's/[*@|=]$//g' \ - -e 's/[^\/]$/& /g' -e "s/^/$1/") ) + -e 's/[^\/]$/& /g' -e "s/^/${1-}/")) fi } @@ -406,29 +498,32 @@ _scp() _ssh_configfile _ssh_suboption_check && { - COMPREPLY=( "${COMPREPLY[@]/%/ }" ) + COMPREPLY=("${COMPREPLY[@]/%/ }") return } local ipvx case $prev in - -*4*) - ipvx=-4 - ;; - -*6*) - ipvx=-6 - ;; -*c) _ssh_ciphers - COMPREPLY=( "${COMPREPLY[@]/%/ }" ) + COMPREPLY=("${COMPREPLY[@]/%/ }") return ;; - -*[Fi]) + -*F) _filedir compopt +o nospace return ;; + -*i) + _ssh_identityfile + compopt +o nospace + return + ;; + -*J) + _known_hosts_real -a ${configfile:+-F "$configfile"} -- "$cur" + return + ;; -*[lP]) return ;; @@ -437,43 +532,53 @@ _scp() return ;; -*S) - _command - compopt +o nospace + compopt +o nospace -o filenames + COMPREPLY=($(compgen -c -- "$cur")) return ;; + -*4*) + ipvx=-4 + ;; + -*6*) + ipvx=-6 + ;; esac _expand || return case $cur in - !(*:*)/*|[.~]*) ;; # looks like a path - *:*) _scp_remote_files ; return ;; + !(*:*)/* | [.~]*) ;; # looks like a path + *:*) + _scp_remote_files + return + ;; esac local prefix - if [[ "$cur" == -F* ]]; then + if [[ $cur == -F* ]]; then cur=${cur#-F} prefix=-F else case $cur in -*) - COMPREPLY=( $( compgen -W '$( _parse_usage "${words[0]}" )' \ - -- "$cur" ) ) - COMPREPLY=( "${COMPREPLY[@]/%/ }" ) + COMPREPLY=($(compgen -W '$(_parse_usage "${words[0]}")' \ + -- "$cur")) + COMPREPLY=("${COMPREPLY[@]/%/ }") return ;; - */*|[.~]*) + */* | [.~]*) # not a known host, pass through ;; *) - _known_hosts_real $ipvx -c -a -F "$configfile" -- "$cur" + _known_hosts_real ${ipvx-} -c -a \ + ${configfile:+-F "$configfile"} -- "$cur" ;; esac fi - _scp_local_files "$prefix" + _scp_local_files "${prefix-}" } && -complete -F _scp -o nospace scp + complete -F _scp -o nospace scp # ex: filetype=sh diff --git a/completions/ssh-add b/completions/ssh-add index dcfd2385906..d8f74926458 100644 --- a/completions/ssh-add +++ b/completions/ssh-add @@ -6,7 +6,15 @@ _ssh_add() _init_completion || return case $prev in - -*[tE]) + -*E) + COMPREPLY=($(compgen -W 'md5 sha256' -- "$cur")) + return + ;; + -*t) + return + ;; + -*T) + _filedir return ;; -*[se]) @@ -16,12 +24,12 @@ _ssh_add() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" "-\?" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_help "$1" "-\?")' -- "$cur")) return fi _filedir } && -complete -F _ssh_add ssh-add + complete -F _ssh_add ssh-add # ex: filetype=sh diff --git a/completions/ssh-copy-id b/completions/ssh-copy-id index cb5731ca29e..f62819477ad 100644 --- a/completions/ssh-copy-id +++ b/completions/ssh-copy-id @@ -9,7 +9,7 @@ _ssh_copy_id() case $prev in -i) - _filedir pub + _xfunc ssh _ssh_identityfile pub return ;; -p) @@ -21,12 +21,12 @@ _ssh_copy_id() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" --help)' -- "$cur")) else _known_hosts_real -a -- "$cur" fi } && -complete -F _ssh_copy_id ssh-copy-id + complete -F _ssh_copy_id ssh-copy-id # ex: filetype=sh diff --git a/completions/ssh-keygen b/completions/ssh-keygen index f13de384491..838be242e7e 100644 --- a/completions/ssh-keygen +++ b/completions/ssh-keygen @@ -3,14 +3,31 @@ _ssh_keygen() { local cur prev words cword - _init_completion -n = || return + _init_completion -n := || return case $prev in - -*[abCIJjMNnrPSVWz]) + -*[aCIJjMNPSVWz]) + return + ;; + -*b) + local -a sizes=() + case "${words[*]}" in + *" -t dsa"?( *)) + sizes=(1024) + ;; + *" -t ecdsa"?( *)) + sizes=(256 384 521) + ;; + *" -t rsa"?( *)) + sizes=(1024 2048 3072 4096) + ;; + esac + ((${#sizes[@]})) && + COMPREPLY=($(compgen -W '"${sizes[@]}"' -- "$cur")) return ;; -*E) - COMPREPLY=( $( compgen -W 'md5 sha256' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'md5 sha256' -- "$cur")) return ;; -*[FR]) @@ -18,7 +35,7 @@ _ssh_keygen() _known_hosts_real -- "$cur" return ;; - -*D) + -*[Dw]) _filedir so return ;; @@ -27,32 +44,88 @@ _ssh_keygen() return ;; -*m) - COMPREPLY=( $( compgen -W 'PEM PKCS8 RFC4716' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'PEM PKCS8 RFC4716' -- "$cur")) + return + ;; + -*n) + [[ ${words[*]} != *\ -*Y\ * ]] || return + if [[ ${words[*]} == *\ -*h\ * ]]; then + _known_hosts_real -- "${cur##*,}" + ((${#COMPREPLY[@]})) && + _comp_delimited , -W '"${COMPREPLY[@]}"' + else + _comp_delimited , -u + fi return ;; -*O) if [[ $cur != *=* ]]; then - COMPREPLY=( $( compgen -W 'clear force-command= + COMPREPLY=($(compgen -W ' + clear critical: extension: force-command= no-agent-forwarding no-port-forwarding no-pty no-user-rc no-x11-forwarding permit-agent-forwarding permit-port-forwarding permit-pty permit-user-rc - permit-x11-forwarding source-address=' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + permit-X11-forwarding no-touch-required source-address= + verify-required + + lines= start-line= checkpoint= memory= start= generator= + + application= challenge= device= no-touch-required resident + user= write-attestation= + ' -- "$cur")) + [[ ${COMPREPLY-} == *[:=] ]] && compopt -o nospace + __ltrim_colon_completions "$cur" + else + case $cur in + force-command=*) + compopt -o filenames + COMPREPLY=($(compgen -c -- "${cur#*=}")) + ;; + checkpoint=* | challenge=* | write-attestation=*) + cur=${cur#*=} + _filedir + ;; + application=*([^:=])) + COMPREPLY=($(compgen -W "ssh:" -- "${cur#*=}")) + compopt -o nospace + ;; + user=*) + COMPREPLY=($(compgen -u -- "${cur#*=}")) + ;; + esac fi return ;; + -*r) + [[ ${words[*]} != *\ -*Y\ * ]] || _filedir + return + ;; -*t) - COMPREPLY=( $( compgen -W 'dsa ecdsa ed25519 rsa rsa1' -- "$cur" ) ) + local protocols=$(_xfunc ssh _ssh_query "$1" protocol-version) + local types='dsa ecdsa ecdsa-sk ed25519 ed25519-sk rsa' + if [[ $protocols == *1* ]]; then + types+=' rsa1' + fi + COMPREPLY=($(compgen -W "$types" -- "$cur")) + return + ;; + -*Y) + COMPREPLY=($(compgen -W 'find-principals check-novalidate sign + verify' -- "$cur")) return ;; esac if [[ $cur == -* ]]; then - local opts=$( _parse_usage "$1" "-?" ) - [[ -z "$opts" ]] && opts=$( _parse_help "$1" "-?" ) # OpenSSH < 7 - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts=$(_parse_usage "$1" "-?") + [[ -z $opts ]] && opts=$(_parse_help "$1" "-?") # OpenSSH < 7 + COMPREPLY=($(compgen -W "$opts" -- "$cur")) + fi + + if [[ ${words[*]} == *\ -*s\ * ]]; then + _filedir pub fi } && -complete -F _ssh_keygen ssh-keygen + complete -F _ssh_keygen ssh-keygen # ex: filetype=sh diff --git a/completions/ssh-keyscan b/completions/ssh-keyscan new file mode 100644 index 00000000000..ed57234079f --- /dev/null +++ b/completions/ssh-keyscan @@ -0,0 +1,39 @@ +# ssh-keyscan(1) completion -*- shell-script -*- + +_comp_cmd_ssh_keyscan() +{ + local cur prev words cword + _init_completion || return + + local ipvx + + case $prev in + -*4*) + ipvx=-4 + ;; + -*6*) + ipvx=-6 + ;; + -*f) + _filedir + return + ;; + -*p | -*T) + return + ;; + -*t) + _comp_delimited , -W "dsa ecdsa ed25519 rsa" + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) + return + fi + + _known_hosts_real ${ipvx-} -- "$cur" +} && + complete -F _comp_cmd_ssh_keyscan ssh-keyscan + +# ex: filetype=sh diff --git a/completions/sshfs b/completions/sshfs index 4afcc994317..223d029bacb 100644 --- a/completions/sshfs +++ b/completions/sshfs @@ -5,21 +5,19 @@ _sshfs() local cur prev words cword _init_completion -n : || return - local userhost path - _expand || return - if [[ "$cur" == *:* ]]; then + if [[ $cur == *:* ]]; then _xfunc ssh _scp_remote_files -d # unlike scp and rsync, sshfs works with 1 backslash instead of 3 - COMPREPLY=( "${COMPREPLY[@]//\\\\\\/\\}" ) + COMPREPLY=("${COMPREPLY[@]//\\\\\\/\\}") return fi - [[ "$cur" == @(*/|[.~])* ]] || _known_hosts_real -c -a -- "$cur" + [[ $cur == @(*/|[.~])* ]] || _known_hosts_real -c -a -- "$cur" _xfunc ssh _scp_local_files -d } && -complete -F _sshfs -o nospace sshfs + complete -F _sshfs -o nospace sshfs # ex: filetype=sh diff --git a/completions/sshmitm b/completions/sshmitm index 192835c0d30..ee893e59a54 100644 --- a/completions/sshmitm +++ b/completions/sshmitm @@ -5,13 +5,13 @@ _sshmitm() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) else _known_hosts_real -- "$cur" fi } && -complete -F _sshmitm sshmitm + complete -F _sshmitm sshmitm # ex: filetype=sh diff --git a/completions/sshow b/completions/sshow index 331349e1ec0..917444ea311 100644 --- a/completions/sshow +++ b/completions/sshow @@ -16,11 +16,11 @@ _sshow() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) fi } && -complete -F _sshow sshow + complete -F _sshow sshow # ex: filetype=sh diff --git a/completions/strace b/completions/strace index 47a5e884e6c..ada1202d424 100644 --- a/completions/strace +++ b/completions/strace @@ -7,10 +7,10 @@ _strace() # check if we're still completing strace local offset=0 i - for (( i=1; i <= cword; i++ )); do - case ${words[$i]} in - -o|-e|-p) - i=$((i+1)) + for ((i = 1; i <= cword; i++)); do + case ${words[i]} in + -o | -e | -p) + ((i++)) continue ;; -*) @@ -21,13 +21,13 @@ _strace() break done - if [[ $offset -gt 0 ]]; then + if ((offset > 0)); then _command_offset $offset else case $prev in -*e) - if [[ "$cur" == *=* ]]; then + if [[ $cur == *=* ]]; then prev=${cur/=*/} cur=${cur/*=/} @@ -38,34 +38,34 @@ _strace() local define syscall rest local -A syscalls while read -r define syscall rest; do - [[ $define == "#define" && \ - $syscall =~ ^__NR_(.+) ]] && \ + [[ $define == "#define" && + $syscall =~ ^__NR_(.+) ]] && syscalls[${BASH_REMATCH[1]}]=1 - done 2>/dev/null < /usr/include/asm/unistd.h + done 2>/dev/null /dev/null < $unistd + done 2>/dev/null <$unistd fi - COMPREPLY=( $( compgen -W '${!syscalls[@]} file + COMPREPLY=($(compgen -W '${syscalls[@]+"${!syscalls[@]}"} file process network signal ipc desc all none' \ - -- "$cur" ) ) + -- "$cur")) return ;; esac else compopt -o nospace - COMPREPLY=( $( compgen -S"=" -W 'trace abbrev verbose raw - signal read write' -- "$cur" ) ) + COMPREPLY=($(compgen -S"=" -W 'trace abbrev verbose raw + signal read write' -- "$cur")) fi return ;; @@ -78,8 +78,7 @@ _strace() return ;; -*S) - COMPREPLY=( $( compgen -W 'time calls name nothing' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'time calls name nothing' -- "$cur")) return ;; -*u) @@ -88,13 +87,13 @@ _strace() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1" -h)' -- "$cur")) else - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=($(compgen -c -- "$cur")) fi fi } && -complete -F _strace -o default strace + complete -F _strace -o default strace # ex: filetype=sh diff --git a/completions/strings b/completions/strings index 6069a248c63..51abe94d90e 100644 --- a/completions/strings +++ b/completions/strings @@ -6,20 +6,27 @@ _strings() _init_completion -s || return case $prev in - --help|--version|--bytes|-!(-*)[hvVn]) + --help | --version | --bytes | --output-separator | -arch | \ + -!(-*)[hvVns]) return ;; - --radix|-!(-*)t) - COMPREPLY=( $( compgen -W 'o d x' -- "$cur" ) ) + --radix | -!(-*)t) + COMPREPLY=($(compgen -W 'o d x' -- "$cur")) return ;; - --target|-!(-*)T) - COMPREPLY=( $( compgen -W '$( LC_ALL=C "$1" --help 2>/dev/null | \ - command sed -ne "s/: supported targets: \(.*\)/\1/p" )' -- "$cur" ) ) + --target | -!(-*)T) + COMPREPLY=($(compgen -W '$(LC_ALL=C "$1" --help 2>/dev/null | \ + command sed -ne "s/: supported targets: \(.*\)/\1/p")' \ + -- "$cur")) return ;; - --encoding|-!(-*)e) - COMPREPLY=( $( compgen -W 's S b l B L' -- "$cur" ) ) + --encoding | -!(-*)e) + COMPREPLY=($( + IFS=, compgen -W \ + '$(LC_ALL=C "$1" --help 2>/dev/null | \ + command sed -ne "s/.*--encoding={\([^}]*\)}.*/\1/p")' \ + -- "$cur" + )) return ;; esac @@ -27,18 +34,25 @@ _strings() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + # macOS: ... [-t format] [-number] [-n number] ... + COMPREPLY=($( + compgen -W \ + '$(_parse_help "$1" || + "$1" --help 2>&1 | \ + command sed -e "s/\[-number\]//" | _parse_usage -)' \ + -- "$cur" + )) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return elif [[ $cur == @* ]]; then cur=${cur:1} _filedir - COMPREPLY=( "${COMPREPLY[@]/#/@}" ) + COMPREPLY=("${COMPREPLY[@]/#/@}") return fi _filedir } && -complete -F _strings strings + complete -F _strings strings # ex: filetype=sh diff --git a/completions/sudo b/completions/sudo index 17f28d33a12..1f1782b8ca8 100644 --- a/completions/sudo +++ b/completions/sudo @@ -9,49 +9,48 @@ _sudo() [[ $1 == *sudoedit ]] && mode=edit [[ $mode == normal ]] && - for (( i=1; i <= cword; i++ )); do - if [[ ${words[i]} != -* ]]; then - local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin - local root_command=${words[i]} - _command_offset $i - return - fi - if [[ ${words[i]} == -@(!(-*)e*|-edit) ]]; then - mode=edit - break - fi - [[ ${words[i]} == \ - -@(user|other-user|group|close-from|prompt|!(-*)[uUgCp]) ]] \ - && ((i++)) - done + for ((i = 1; i <= cword; i++)); do + if [[ ${words[i]} != -* ]]; then + local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin + local root_command=${words[i]} + _command_offset $i + return + fi + if [[ ${words[i]} == -@(!(-*)e*|-edit) ]]; then + mode=edit + break + fi + [[ ${words[i]} == -@(user|other-user|group|close-from|prompt|!(-*)[uUgCp]) ]] && + ((i++)) + done case "$prev" in - --user|--other-user|-!(-*)[uU]) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + --user | --other-user | -!(-*)[uU]) + COMPREPLY=($(compgen -u -- "$cur")) return ;; - --group|-!(-*)g) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + --group | -!(-*)g) + COMPREPLY=($(compgen -g -- "$cur")) return ;; - --close-from|--prompt|-!(-*)[Cp]) + --close-from | --prompt | -!(-*)[Cp]) return ;; esac $split && return - if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* ]]; then + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi if [[ $mode == edit ]]; then _filedir fi } && -complete -F _sudo sudo sudoedit + complete -F _sudo sudo sudoedit # ex: filetype=sh diff --git a/completions/svcadm b/completions/svcadm index f23af1ff252..9209af7904a 100644 --- a/completions/svcadm +++ b/completions/svcadm @@ -11,23 +11,23 @@ # but to not clutter the interface with all completions, we will only # cut every completion alternative at the next slash. # -# For example, if the user types , we will propose for svc://foo/bar/bar/baz -# the following completion: foo/, bar/ and baz +# For example, if the user types , we will propose +# for svc://foo/bar/bar/baz the following completion: foo/, bar/ and baz # If the user types , we will propose: bar/ and baz # If the user types , we will propose: bar/bar/ and bar/baz # -# By default, the function proproses only abbreviated completions except if the user already -# began to type svc:. In that case we will propose only the complete FMRI beginning with the -# pattern +# By default, the function proproses only abbreviated completions except if the +# user already began to type svc:. In that case we will propose only the +# complete FMRI beginning with the pattern # -_smf_complete_fmri () +_smf_complete_fmri() { local cur="$1" prefix="$2" local cur_prefix fmri fmri_list="" local exact_mode pattern - if [[ "$cur" == $prefix* ]]; then - [[ "$cur" == $prefix ]] && cur+="/" + if [[ $cur == $prefix* ]]; then + [[ $cur == "$prefix" ]] && cur+="/" pattern="$cur*" exact_mode=1 else @@ -38,18 +38,20 @@ _smf_complete_fmri () for fmri in $(svcs -H -o FMRI "$pattern" 2>/dev/null); do local fmri_part_list fmri_part - if [[ -z "$exact_mode" ]]; then - fmri=${fmri#$prefix/} + if [[ -z $exact_mode ]]; then + fmri=${fmri#"$prefix/"} - # we generate all possibles abbrevations for the FMRI + # we generate all possibles abbreviations for the FMRI # no need to have a generic loop as we will have a finite # number of components - local OIFS="$IFS"; IFS="/"; set -- $fmri; IFS="$OIFS" + local IFS="/" + set -- $fmri + _comp_unlocal IFS case $# in - 1) fmri_part_list=" $1";; - 2) fmri_part_list=" $2 $1/$2";; - 3) fmri_part_list=" $3 $2/$3 $1/$2/$3";; - 4) fmri_part_list=" $4 $3/$4 $2/$3/$4 $1/$2/$3/$4";; + 1) fmri_part_list=" $1" ;; + 2) fmri_part_list=" $2 $1/$2" ;; + 3) fmri_part_list=" $3 $2/$3 $1/$2/$3" ;; + 4) fmri_part_list=" $4 $3/$4 $2/$3/$4 $1/$2/$3/$4" ;; esac else fmri_part_list="$fmri" @@ -58,28 +60,28 @@ _smf_complete_fmri () # Here we make sure the completions begins with the pattern and # we cut them at the first slash for fmri_part in $fmri_part_list; do - [[ "$fmri_part" == $cur* ]] || continue - local first_part=${fmri_part#$cur_prefix} + [[ $fmri_part == $cur* ]] || continue + local first_part=${fmri_part#"$cur_prefix"} first_part=$cur_prefix${first_part%%/*} - [[ "$first_part" != "$fmri_part" ]] && first_part+="/" + [[ $first_part != "$fmri_part" ]] && first_part+="/" fmri_list+=" $first_part" done done - COMPREPLY=( $fmri_list ) + COMPREPLY=($fmri_list) # here we want to detect if there only one completion proposed and that # it ends with a slash. That means the users will still have to complete # after, so we gain him one tab keystroke by immediately proposing the # next completion alternatives local i=${#COMPREPLY[*]} - if [[ $i -gt 0 ]] && [[ "${COMPREPLY[$((--i))]}" == */ ]]; then + if [[ $i -gt 0 && ${COMPREPLY[--i]} == */ ]]; then # we have to iterate through the list as we may have duplicate - while [[ $i -ne 0 ]]; do - [[ "${COMPREPLY[$i]}" != "${COMPREPLY[$((i - 1))]}" ]] && break + while ((i != 0)); do + [[ ${COMPREPLY[i]} != "${COMPREPLY[i - 1]}" ]] && break ((i--)) done - if [[ $i -eq 0 ]]; then + if ((i == 0)); then _smf_complete_fmri "${COMPREPLY[0]}" "$prefix" return fi @@ -90,12 +92,12 @@ _smf_complete_fmri () # it from darcs completion code :) local colonprefixes=${cur%"${cur##*:}"} local i=${#COMPREPLY[*]} - while [ $((--i)) -ge 0 ]; do - COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"} + while ((i-- > 0)); do + COMPREPLY[i]=${COMPREPLY[i]#"$colonprefixes"} done } -_svcadm () +_svcadm() { local cur prev words cword _init_completion -n : || return @@ -103,34 +105,38 @@ _svcadm () local command_list="enable disable restart refresh clear mark milestone" local command i - for (( i=1; i < $cword; i++ )); do + for ((i = 1; i < cword; i++)); do if [[ ${words[i]} == @(enable|disable|restart|refresh|clear|mark|milestone) ]]; then command=${words[i]} fi done - if [[ -z "$command" ]]; then - if [[ ${cur} == -* ]] ; then - COMPREPLY=( $(compgen -W "-v" -- ${cur}) ) + if [[ ! -v command ]]; then + if [[ ${cur} == -* ]]; then + COMPREPLY=($(compgen -W "-v" -- ${cur})) else - COMPREPLY=( $(compgen -W "$command_list" -- ${cur}) ) + COMPREPLY=($(compgen -W "$command_list" -- ${cur})) fi else if [[ ${cur} == -* ]]; then case "$command" in enable) - COMPREPLY=( $(compgen -W "-r -s -t" -- ${cur}) );; + COMPREPLY=($(compgen -W "-r -s -t" -- ${cur})) + ;; disable) - COMPREPLY=( $(compgen -W "-s -t" -- ${cur}) );; + COMPREPLY=($(compgen -W "-s -t" -- ${cur})) + ;; mark) - COMPREPLY=( $(compgen -W "-I -t" -- ${cur}) );; + COMPREPLY=($(compgen -W "-I -t" -- ${cur})) + ;; milestone) - COMPREPLY=( $(compgen -W "-d" -- ${cur}) );; + COMPREPLY=($(compgen -W "-d" -- ${cur})) + ;; esac else - if [[ "$command" == "mark" ]] && [[ "$prev" != @(degraded|maintenance) ]]; then - COMPREPLY=( $(compgen -W "degraded maintenance" -- ${cur}) ) - elif [[ "$command" == "milestone" ]]; then + if [[ $command == "mark" && $prev != @(degraded|maintenance) ]]; then + COMPREPLY=($(compgen -W "degraded maintenance" -- ${cur})) + elif [[ $command == "milestone" ]]; then _smf_complete_fmri "${cur}" "svc:/milestone" else _smf_complete_fmri "${cur}" "svc:" @@ -138,6 +144,6 @@ _svcadm () fi fi } && -complete -F _svcadm svcadm + complete -F _svcadm svcadm # ex: filetype=sh diff --git a/completions/svk b/completions/svk index d78d3557053..9079df1c1cd 100644 --- a/completions/svk +++ b/completions/svk @@ -14,71 +14,70 @@ _svk() propget pg pget proplist pl plist propset ps pset pull push resolved revert smerge sm status st stat switch sw sync sy update up verify' - if [[ $cword -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + if ((cword == 1)); then + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--version' -- "$cur")) else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$commands" -- "$cur")) fi else case $prev in - -F|--file|--targets) + -F | --file | --targets) _filedir return ;; --encoding) - COMPREPLY=( $( compgen -W \ - '$( iconv --list | command sed -e "s@//@@;" )' -- "$cur" ) ) + _xfunc iconv _iconv_charsets return ;; esac command=${words[1]} - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then # possible options for the command case $command in add) options=' --non-recursive -N -q --quiet' ;; - blame|annotate|ann|praise) + blame | annotate | ann | praise) options='-r --revisions -x --cross' ;; cat) options='-r --revision' ;; - checkout|co) + checkout | co) options='-r --revision -q --quiet -N --non-recursive -l --list -d --detach --export --relocate --purge' ;; cleanup) options='-a --all' ;; - cmerge|cm) + cmerge | cm) options='-c --change -l --log -r --revision -a --auto --verbatim --no-ticket -m --message -F --file --template --encoding -P --patch -S --sign -C --check-only --direct' ;; - commit|ci) + commit | ci) options='--import -m --message -F --file --encoding --template -P --patch -S --sign -C --check-only -N --non-recursive --direct' ;; - copy|cp) + copy | cp) options='-r --revision -p --parent -q --quiet -m --message -F --file --template --encoding -P --patch -S --sign -C --check-only --direct' ;; - delete|del|remove|rm) + delete | del | remove | rm) options='-k --keep-local -m --message -F --file --encoding --template -P --patch -S --sign -C --check-only --direct' ;; - depotmap|depot) + depotmap | depot) options='-i --init -l --list -d --detach --relocate' ;; - diff|di) + diff | di) options='-r --revision -s --summarize -b --verbose -N --non-recursive' ;; @@ -87,7 +86,7 @@ _svk() -F --file --template --encoding -P --patch -S --sign -C --check-only -N --non-recursive --direct' ;; - list|ls) + list | ls) options='-r --revision -v --verbose -R --recursive -d --depth -f --full-path' ;; @@ -102,7 +101,7 @@ _svk() --template --encoding -P --patch -S --sign -C --check-only --direct' ;; - mirror|mi) + mirror | mi) options='-l --list -d --detach --relocate --recover --unlock --upgrade' ;; @@ -111,7 +110,7 @@ _svk() --encoding -P --patch -S --sign -C --check-only --direct' ;; - move|mv|rename|ren) + move | mv | rename | ren) options='-r --revision -p --parent -q --quiet -m --message -F --file --encoding --template -P --patch -S --sign -C --check-only --direct' @@ -119,20 +118,20 @@ _svk() patch) options='--depot' ;; - propdel|propset|pdel|pset|pd|ps) + propdel | propset | pdel | pset | pd | ps) options='-R --recursive -r --revision --revprop -m --message -F --file --template --encoding -P --patch -S --sign -C --check-only -q --quiet --direct' ;; - propedit|pedit|pe) + propedit | pedit | pe) options='-R --recursive -r --revision --revprop -m --message -F --file --template --encoding -P --patch -S --sign -C --check-only --direct' ;; - propget|pget|pg) + propget | pget | pg) options='-R --recursive -r --revision --revprop --strict' ;; - proplist|plist|pl) + proplist | plist | pl) options='-R --recursive -v --verbose -r --revision --revprop' ;; @@ -149,59 +148,59 @@ _svk() revert) options='-R --recursive -q --quiet' ;; - smerge|sm) + smerge | sm) options='-I --incremental -l --log -B --baseless -b --base -s --sync -t --to -f --from --verbatim --no-ticket --track-rename --host --remoterev -m --message -F --file --template --encoding -P --patch -S --sign -C --check-only --direct' ;; - status|stat|st) + status | stat | st) options='-q --quiet --no-ignore -N --non-recursive -v --verbose' ;; - switch|sw) + switch | sw) options='-r --revision -d --detach -q --quiet' ;; - sync|sy) + sync | sy) options='-a --all -s --skipto -t --torev' ;; - update|up) + update | up) options='-r --revision -N --non-recursive -C --check-only -s --sync -m --merge -q --quiet' ;; esac options+=" --help -h" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$options" -- "$cur")) else case $command in - help|h|\?) - COMPREPLY=( $( compgen -W "$commands environment commands - intro" -- "$cur" ) ) + help | h | \?) + COMPREPLY=($(compgen -W "$commands environment commands + intro" -- "$cur")) ;; admin) - COMPREPLY=( $( compgen -W 'help deltify dump hotcopy + COMPREPLY=($(compgen -W 'help deltify dump hotcopy list-dblogs list-unused-dblogs load lstxns recover - rmtxns setlog verify rmcache' -- "$cur" ) ) + rmtxns setlog verify rmcache' -- "$cur")) ;; patch) - COMPREPLY=( $( compgen -W '--ls --list --cat --view + COMPREPLY=($(compgen -W '--ls --list --cat --view --regen --regenerate --up --update --apply --rm - --delete' -- "$cur" ) ) + --delete' -- "$cur")) ;; sync) - COMPREPLY=( $( compgen -W "$( $1 mirror --list \ - 2>/dev/null | awk '/^\//{print $1}' )" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 mirror --list \ + 2>/dev/null | awk '/^\//{print $1}')" -- "$cur")) ;; - co|checkout|push|pull) - if [[ "$cur" == //*/* ]]; then + co | checkout | push | pull) + if [[ $cur == //*/* ]]; then path=${cur%/*}/ else path=// fi - COMPREPLY=( $( compgen -W "$( $1 list $path 2>/dev/null | \ - command sed -e 's|\(.*\)|'$path'\1|')" -- "$cur" ) ) + COMPREPLY=($(compgen -W "$($1 list $path 2>/dev/null | + command sed -e 's|\(.*\)|'$path'\1|')" -- "$cur")) ;; *) _filedir @@ -210,6 +209,6 @@ _svk() fi fi } && -complete -F _svk svk + complete -F _svk svk # ex: filetype=sh diff --git a/completions/sync_members b/completions/sync_members index 2fe50eaf06e..397f8b089a9 100644 --- a/completions/sync_members +++ b/completions/sync_members @@ -6,11 +6,11 @@ _sync_members() _init_completion -s || return case $prev in - -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + -w | -g | -d | --welcome-msg | --goodbye-msg | --digest) + COMPREPLY=($(compgen -W 'y n' -- "$cur")) return ;; - -d|--file) + --file) _filedir return ;; @@ -18,14 +18,14 @@ _sync_members() $split && return - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-change --welcome-msg --goodbye-msg - --digest --notifyadmin --file --help' -- "$cur" ) ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '--no-change --welcome-msg --goodbye-msg + --digest --notifyadmin --file --help' -- "$cur")) else _xfunc list_lists _mailman_lists fi } && -complete -F _sync_members sync_members + complete -F _sync_members sync_members # ex: filetype=sh diff --git a/completions/synclient b/completions/synclient index b7ebf02607e..c4a0d42ff42 100644 --- a/completions/synclient +++ b/completions/synclient @@ -2,23 +2,23 @@ _synclient() { - local cur prev words cword split + local cur prev words cword _init_completion -n = || return case $prev in - -\?|-h|-V) + -\? | -h | -V) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) elif [[ $cur != *=?* ]]; then - COMPREPLY=( $( compgen -S = -W '$( $1 -l 2>/dev/null | \ - awk "/^[ \t]/ { print \$1 }" )' -- "$cur" ) ) + COMPREPLY=($(compgen -S = -W '$($1 -l 2>/dev/null | \ + awk "/^[ \t]/ { print \$1 }")' -- "$cur")) compopt -o nospace fi } && -complete -F _synclient synclient + complete -F _synclient synclient # ex: filetype=sh diff --git a/completions/sysbench b/completions/sysbench index 3d2b7b1ebb3..0af7cc33b35 100644 --- a/completions/sysbench +++ b/completions/sysbench @@ -6,85 +6,84 @@ _sysbench() _init_completion -s || return case $prev in - --num-threads|--max-requests|--max-time|--thread-stack-size| \ - --help|--version|help|version) + --num-threads | --max-requests | --max-time | --thread-stack-size | \ + --help | --version | help | version) return ;; - --init-rng|--debug|--validate) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + --init-rng | --debug | --validate) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) return ;; --test) - COMPREPLY=( $( compgen -W 'fileio cpu memory threads mutex oltp' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'fileio cpu memory threads mutex oltp' \ + -- "$cur")) return ;; --cpu-max-prime) return ;; --file-test-mode) - COMPREPLY=( $( compgen -W 'seqwr seqrewr seqrd rndrd rndwr rndrw' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'seqwr seqrewr seqrd rndrd rndwr rndrw' \ + -- "$cur")) return ;; --file-io-mode) - COMPREPLY=( $( compgen -W 'sync async fastmmap slowmmap' \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W 'sync async fastmmap slowmmap' -- "$cur")) return ;; --file-extra-flags) - COMPREPLY=( $( compgen -W 'sync dsync direct' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'sync dsync direct' -- "$cur")) return ;; - --file-fsync-all|--file-fsync-end) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + --file-fsync-all | --file-fsync-end) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) return ;; --file-fsync-mode) - COMPREPLY=( $( compgen -W 'fsync fdatasync' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'fsync fdatasync' -- "$cur")) return ;; --memory-scope) - COMPREPLY=( $( compgen -W 'global local' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'global local' -- "$cur")) return ;; --memory-hugetlb) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) return ;; --memory-oper) - COMPREPLY=( $( compgen -W 'read write none' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'read write none' -- "$cur")) return ;; --memory-access-mode) - COMPREPLY=( $( compgen -W 'seq rnd' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'seq rnd' -- "$cur")) return ;; --oltp-test-mode) - COMPREPLY=( $( compgen -W 'simple complex nontrx sp' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'simple complex nontrx sp' -- "$cur")) return ;; - --oltp-read-only|--oltp-skip-trx|--oltp-quto-inc|--mysql-ssl) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + --oltp-read-only | --oltp-skip-trx | --oltp-quto-inc | --mysql-ssl) + COMPREPLY=($(compgen -W 'on off' -- "$cur")) return ;; --oltp-nontrx-mode) - COMPREPLY=( $( compgen -W 'select update_key update_nokey insert - delete' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'select update_key update_nokey insert + delete' -- "$cur")) return ;; --oltp-dist-type) - COMPREPLY=( $( compgen -W 'uniform gaussian special' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'uniform gaussian special' -- "$cur")) return ;; --db-driver) - COMPREPLY=( $( compgen -W "$( $1 --test=oltp help 2>/dev/null | + COMPREPLY=($(compgen -W "$($1 --test=oltp help 2>/dev/null | command sed -e '/^.*database drivers:/,/^$/!d' \ - -ne 's/^ *\([^ ]*\) .*/\1/p' )" -- "$cur" ) ) + -ne 's/^ *\([^ ]*\) .*/\1/p')" -- "$cur")) return ;; --db-ps-mode) - COMPREPLY=( $( compgen -W 'auto disable' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'auto disable' -- "$cur")) return ;; --mysql-socket) @@ -92,12 +91,12 @@ _sysbench() return ;; --mysql-table-engine) - COMPREPLY=( $( compgen -W 'myisam innodb bdb heap ndbcluster - federated' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'myisam innodb bdb heap ndbcluster + federated' -- "$cur")) return ;; --mysql-engine-trx) - COMPREPLY=( $( compgen -W 'yes no auto' -- "$cur" ) ) + COMPREPLY=($(compgen -W 'yes no auto' -- "$cur")) return ;; --*) @@ -107,27 +106,27 @@ _sysbench() # find out which test we're running local i test - for (( i=1 ; $i < ${#words[@]}-1 ; i++ )); do + for ((i = 1; i < ${#words[@]} - 1; i++)); do + # TODO --test= is deprecated, bare test name preferred if [[ ${words[i]} == --test* ]]; then test=${words[i]#*=} break fi done - local opts=$( _parse_help "$1" ) - if [[ $test ]]; then - local help=( $( _parse_help "$1" "--test=$test help" ) ) - opts="${opts[@]/--test=/} ${help[@]} prepare run cleanup help version" + local opts=$(_parse_help "$1") + if [[ -v test ]]; then + local help=($(_parse_help "$1" "--test=$test help")) + opts="${opts/--test=/} ${help[*]} prepare run cleanup help version" fi - if [[ "$cur" == -* || ! $test ]]; then - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == -* || ! -v test ]]; then + COMPREPLY=($(compgen -W "$opts" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W "prepare run cleanup help version" \ - -- "$cur" ) ) + COMPREPLY=($(compgen -W "prepare run cleanup help version" -- "$cur")) fi } && -complete -F _sysbench sysbench + complete -F _sysbench sysbench # ex: filetype=sh diff --git a/completions/sysctl b/completions/sysctl index 2c3893b2838..b33356ef769 100644 --- a/completions/sysctl +++ b/completions/sysctl @@ -6,27 +6,27 @@ _sysctl() _init_completion || return case $prev in - --help|--version|--pattern|-!(-*)[hVr]) + --help | --version | --pattern | -!(-*)[hVr]) return ;; - --load|-!(-*)p) + --load | -!(-*)[pf]) _filedir conf return ;; esac if [[ $cur == -* ]]; then - local opts="$( _parse_help "$1" )" - [[ $opts ]] || opts="$( _parse_usage "$1" )" - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + COMPREPLY=($( + compgen -W '$(_parse_help "$1" || _parse_usage "$1")' -- "$cur" + )) else local suffix= - [[ $prev == -w ]] && suffix== - COMPREPLY=( $( compgen -S "$suffix" -W \ - "$( PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null )" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + [[ $prev == -w ]] && suffix="=" + COMPREPLY=($(compgen -S "$suffix" -W \ + "$(PATH="$PATH:/sbin" $1 -N -a 2>/dev/null)" -- "$cur")) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi } && -complete -F _sysctl sysctl + complete -F _sysctl sysctl # ex: filetype=sh diff --git a/completions/tar b/completions/tar index 6d04d46d818..2eac109b527 100644 --- a/completions/tar +++ b/completions/tar @@ -12,7 +12,7 @@ # # We rather advice the 'tar -czf /tmp/archive.tar -T patterns.txt' format of # arguments. Though, if user starts the 'first' tar argument without leading -# dash, we treat the command line apropriately. +# dash, we treat the command line appropriately. # # # long/short options origin @@ -37,6 +37,24 @@ # - mode option should be advised only once # - format option should be advised only once # ... +# +# Tar files vs internal paths +# =========================== +# +# bash's programmable completion is limited in how it handles the list of +# possible completions it returns. +# +# Because the paths returned from within the tar file are likely not existing +# paths on the file system, `-o dirnames` must be passed to the `complete` +# built-in to make it treat them as such. However, then bash will append a +# space when completing on directories during pathname completion to the tar +# files themselves. +# +# It's more important to have proper completion of paths to tar files than it +# is to have completion for their contents, so this sacrifice was made and +# `-o filenames` is used with complete instead by default. Setting the +# `$COMP_TAR_INTERNAL_PATHS` environment variable to a non-null +# value *before sourcing* this completion toggles that the other way around. __gtar_parse_help_opt() { @@ -47,17 +65,18 @@ __gtar_parse_help_opt() separator=" " case "$opt" in - --*) - ;; + --*) ;; + -\?) - return ;; + return + ;; -*) opttype=short opt=${opt##-} separator= ;; *) - echo >&2 "not an option $opt" + echo "bash_completion: $FUNCNAME: unknown option $opt" >&2 return 1 ;; esac @@ -76,36 +95,36 @@ __gtar_parse_help_opt() eval "$optvar=\"\$$optvar$separator\"\"$opt\"" } - __gtar_parse_help_line() { local i - - for i in $1; do - case "$i" in - # regular options - --*|-*) - __gtar_parse_help_opt "$i" "$2" - ;; - - # end once there is single non-option word - *) - break - esac - done + local -a tmp + while read -ra tmp; do + for i in "${tmp[@]}"; do + case "$i" in + # regular options + --* | -*) + __gtar_parse_help_opt "$i" "$2" + ;; + + # end once there is single non-option word + *) + break + ;; + esac + done + done <<<"$1" } - __gnu_tar_parse_help() { local str line arg - while IFS= read line; do + while IFS= read -r line; do # Ok, this requires some comment probably. The GNU help output prints # options on lines beginning with spaces. After that, there is one # or more options separated by ', ' separator string. We are matching # like this then: ^(?