From 3a2ccd3792b6eec96059462fffc9a08f07bb7dc9 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:04:19 +0200 Subject: [PATCH 01/17] Add license notice to django completion --- completion/available/django.completion.bash | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/completion/available/django.completion.bash b/completion/available/django.completion.bash index aca13ce4..cfd1ae9c 100644 --- a/completion/available/django.completion.bash +++ b/completion/available/django.completion.bash @@ -30,6 +30,36 @@ # ============ # # To uninstall, just remove the line from your .bash_profile and .bashrc. +# +# This file is licensed under the following license: +# Copyright (c) Django Software Foundation and individual contributors. +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. + +# 3. Neither the name of Django nor the names of its contributors may be used +# to endorse or promote products derived from this software without +# specific prior written permission. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + _django_completion() { From 2329b4395bfd3550e3d6ecb70973a2d85773e8e9 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:07:18 +0200 Subject: [PATCH 02/17] Add license notice to gradle completion --- completion/available/gradle.completion.bash | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/completion/available/gradle.completion.bash b/completion/available/gradle.completion.bash index d3ce6eb5..2b33383f 100644 --- a/completion/available/gradle.completion.bash +++ b/completion/available/gradle.completion.bash @@ -1,3 +1,23 @@ +# Copyright (c) 2017 Eric Wendelin + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is furnished to do +# so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + # Bash breaks words on : by default. Subproject tasks have ':' # Avoid inaccurate completions for subproject tasks COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g') From 17211b0b1aa426c3ce448ef51339cd3da432502c Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:08:41 +0200 Subject: [PATCH 03/17] Add license to apm completion script --- completion/available/apm.completion.bash | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/completion/available/apm.completion.bash b/completion/available/apm.completion.bash index a0a4e13c..c9940743 100644 --- a/completion/available/apm.completion.bash +++ b/completion/available/apm.completion.bash @@ -1,6 +1,27 @@ #!/usr/bin/env bash -# apm-bash-completion is written by Ugur Ozyilmazel +# The MIT License (MIT) + +# Copyright (c) 2015 Uğur "vigo" Özyılmazel + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + # repo: https://github.com/vigo/apm-bash-completion __apm(){ From f221cdca9e85f03850d54f4839a5c47d07dafac7 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:09:30 +0200 Subject: [PATCH 04/17] Clarify license on bundler completion --- completion/available/bundler.completion.bash | 25 +++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/completion/available/bundler.completion.bash b/completion/available/bundler.completion.bash index 4ad04bdc..663a26d2 100644 --- a/completion/available/bundler.completion.bash +++ b/completion/available/bundler.completion.bash @@ -1,9 +1,28 @@ #! bash # bash completion for the `bundle` command. # -# Copyright (c) 2011-2017 Daniel Luz . -# Distributed under the MIT license. -# http://mernen.com/projects/completion-ruby +# Copyright (c) 2008 Daniel Luz + +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. # # To use, source this file on bash: # . completion-bundle From 6a69931240665f9cc52bf77b488bf71edde24b75 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:33:49 +0200 Subject: [PATCH 05/17] Add license to invoke completion --- completion/available/invoke.completion.bash | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/completion/available/invoke.completion.bash b/completion/available/invoke.completion.bash index f90097f2..708596b4 100644 --- a/completion/available/invoke.completion.bash +++ b/completion/available/invoke.completion.bash @@ -1,4 +1,28 @@ # Invoke (pyinvoke.org) tab-completion script to be sourced with Bash shell. + +# Copyright (c) 2020 Jeff Forcier. +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: + +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # https://github.com/pyinvoke/invoke/blob/master/completion/bash _complete_invoke() { From f4f229573dd3660ce86d0b5483ad646e1e45c534 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:38:24 +0200 Subject: [PATCH 06/17] Clean up packer completion and add to clean_files.txt --- clean_files.txt | 1 + completion/available/packer.completion.bash | 166 +------------------- 2 files changed, 6 insertions(+), 161 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index 464fd78f..c90c5bb7 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -32,6 +32,7 @@ themes/powerline # completion/available/cargo.completion.bash completion/available/knife.completion.bash +completion/available/packer.completion.bash completion/available/pipx.completion.bash completion/available/rustup.completion.bash diff --git a/completion/available/packer.completion.bash b/completion/available/packer.completion.bash index fb940c9b..ea4b7b8c 100644 --- a/completion/available/packer.completion.bash +++ b/completion/available/packer.completion.bash @@ -1,163 +1,7 @@ #!/usr/bin/env bash +cite "about-completion" +about-completion "packer completion" -# Packer (http://www.packer.io) bash completion -# -# This script provides bash completion for packer and supports: -# -# - template filename completion (*.json) in cwd -# - support for basic options (i.e.. -debug) -# - support for complex options (i.e. -parallel=[true|false] -# -# The scirpt has been successfully tested with packer-0.6.0 and the -# following OS: -# -# - OS X 10.9 -# - CentOS-6.5 -# - Ubuntu 12.04 Server -# -# The script technically is heavily inspired by the git-completion.bash -# script. Kudos to Shawn O. Pearce and all other -# contributors for the inspiration and especially to the bash-completion -# team in general. -# -# Copyright (c) 2014 IT Services Department, University of Bern -# -# This script is licensed under the MIT License (MIT) -# For licsense details see the LICENSE file included in the repository -# or read the license text at http://opensource.org/licenses/MIT. -# - -# Generates completion reply, appending a space to possible completion words, -# if necessary. -# It accepts 2 arguments though the second is optional: -# 1: List of possible completion words. -# 2: Generate possible completion matches for this word (optional). -__packercomp () -{ - local cur_="${2-$cur}" - - case "$cur_" in - -*=) - ;; - *) - local c i=0 IFS=$' \t\n' - for c in $1; do - if [[ $c == "$cur_"* ]]; then - case $c in - -*=*|*.) ;; - *) c="$c " ;; - esac - COMPREPLY[i++]="$c" - fi - done - ;; - esac -} - -# Generates completion reply for template files in cwd. -__packercomp_template_file () -{ - local IFS=$'\n' - - COMPREPLY=($(compgen -S " " -A file -X '!*.json' -- "${cur}")) -} - -# Generates completion for the build command. -__packer_build () -{ - local builders=" - amazon-ebs amazon-instance amazon-chroot digitalocean docker - googlecompute openstack parallels-iso parallels-pvm qemu - virtualbox-iso virtualbox-ovf vmware-iso vmware-vmx" - - case "$cur" in - -parallel=*) - __packercomp "false true" "${cur##-parallel=}" - return - ;; - -except=*) - __packercomp "$builders" "${cur##-except=}" - return - ;; - -only=*) - __packercomp "$builders" "${cur##-only=}" - return - ;; - -*) - __packercomp "-debug -force -machine-readable -except= -only= -parallel= -var -var-file" - return - ;; - *) - esac - - __packercomp_template_file -} - -# Generates completion for the fix command. -__packer_fix () -{ - __packercomp_template_file -} - -# Generates completion for the inspect command. -__packer_inspect () -{ - case "$cur" in - -*) - __packercomp "-machine-readable" - return - ;; - *) - esac - - __packercomp_template_file -} - -# Generates completion for the validate command. -__packer_validate () -{ - __packercomp_template_file -} - -# Main function for packer completion. -# -# Searches for a command in $COMP_WORDS. If one is found -# the appropriate function from above is called, if not -# completion for global options is done. -_packer_completion () -{ - cur=${COMP_WORDS[COMP_CWORD]} - # Words containing an equal sign get split into tokens in bash > 4, which - # doesn't come in handy here. - # This is handled here. bash < 4 does not split. - declare -f _get_comp_words_by_ref >/dev/null && _get_comp_words_by_ref -n = cur - - COMPREPLY=() - local i c=1 command - - while [ $c -lt $COMP_CWORD ]; do - i="${COMP_WORDS[c]}" - case "$i" in - -*) ;; - *) command="$i"; break ;; - esac - ((c++)) - done - - if [ -z $command ]; then - case "$cur" in - '-'*) - __packercomp "-machine-readable --help --version" - ;; - *) - __packercomp "build fix inspect validate" - ;; - esac - return - fi - - local completion_func="__packer_${command}" - declare -f $completion_func >/dev/null && $completion_func -} - -complete -o nospace -F _packer_completion packer +if _binary_exists packer; then + complete -C packer packer +fi From 3ba1a14eb95690af7b2c10cfa995d4cf70dfb600 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:44:19 +0200 Subject: [PATCH 07/17] Remove broken link from tmux completion --- completion/available/tmux.completion.bash | 1 - 1 file changed, 1 deletion(-) diff --git a/completion/available/tmux.completion.bash b/completion/available/tmux.completion.bash index 6bb8293f..7992ccb4 100644 --- a/completion/available/tmux.completion.bash +++ b/completion/available/tmux.completion.bash @@ -3,7 +3,6 @@ # tmux completion # See: http://www.debian-administration.org/articles/317 for how to write more. # Usage: Put "source bash_completion_tmux.sh" into your .bashrc -# Based upon the example at http://paste-it.appspot.com/Pj4mLycDE _tmux_expand () { From 6eb5802080a53cfe26e054c3b113e8a1087c88cc Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:49:44 +0200 Subject: [PATCH 08/17] Add license notice to hub completion --- completion/available/hub.completion.bash | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/completion/available/hub.completion.bash b/completion/available/hub.completion.bash index 8653084c..79d76bf0 100644 --- a/completion/available/hub.completion.bash +++ b/completion/available/hub.completion.bash @@ -1,6 +1,27 @@ # hub tab-completion script for bash. # This script complements the completion script that ships with git. +# Copyright (c) 2009 Chris Wanstrath + +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + # If there is no git tab completion, but we have the _completion loader try to load it if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then _completion_loader git From 334005ead33f7058197015fe9324b67642565870 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:57:12 +0200 Subject: [PATCH 09/17] Clean up vault completion and add to clean_files.txt --- clean_files.txt | 1 + completion/available/vault.completion.bash | 56 +++------------------- 2 files changed, 7 insertions(+), 50 deletions(-) diff --git a/clean_files.txt b/clean_files.txt index c90c5bb7..da5034d9 100644 --- a/clean_files.txt +++ b/clean_files.txt @@ -35,6 +35,7 @@ completion/available/knife.completion.bash completion/available/packer.completion.bash completion/available/pipx.completion.bash completion/available/rustup.completion.bash +completion/available/vault.completion.bash # aliases aliases/available/vim.aliases.bash diff --git a/completion/available/vault.completion.bash b/completion/available/vault.completion.bash index f0c747c1..7d082ee7 100644 --- a/completion/available/vault.completion.bash +++ b/completion/available/vault.completion.bash @@ -1,51 +1,7 @@ -# --------------------------------------------------------------------------- -# vault-bash-completion -# -# This adds bash completions for [HashiCorp Vault](https://www.vaultproject.io/) -# -# see https://github.com/iljaweis/vault-bash-completion -# --------------------------------------------------------------------------- +#!/usr/bin/env bash +cite "about-completion" +about-completion "vault completion" -function _vault_mounts() { - ( - set -euo pipefail - if ! vault mounts 2> /dev/null | awk 'NR > 1 {print $1}'; then - echo "secret" - fi - ) -} - -function _vault() { - local VAULT_COMMANDS=$(vault 2>&1 | egrep '^ +' | awk '{print $1}') - - local cur - local prev - - if [ $COMP_CWORD -gt 0 ]; then - cur=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - fi - - local line=${COMP_LINE} - - if [[ $prev =~ ^(policies|policy-write|policy-delete) ]]; then - local policies=$(vault policies 2> /dev/null) - COMPREPLY=($(compgen -W "$policies" -- $cur)) - elif [ "$(echo $line | wc -w)" -le 2 ]; then - if [[ "$line" =~ ^vault\ (read|write|delete|list)\ $ ]]; then - COMPREPLY=($(compgen -W "$(_vault_mounts)" -- '')) - else - COMPREPLY=($(compgen -W "$VAULT_COMMANDS" -- $cur)) - fi - elif [[ "$line" =~ ^vault\ (read|write|delete|list)\ (.*)$ ]]; then - path=${BASH_REMATCH[2]} - if [[ "$path" =~ ^([^ ]+)/([^ /]*)$ ]]; then - list=$(vault list -format=yaml ${BASH_REMATCH[1]} 2> /dev/null | awk '{ print $2 }') - COMPREPLY=($(compgen -W "$list" -P "${BASH_REMATCH[1]}/" -- ${BASH_REMATCH[2]})) - else - COMPREPLY=($(compgen -W "$(_vault_mounts)" -- $path)) - fi - fi -} - -complete -o default -o nospace -F _vault vault +if _binary_exists vault; then + complete -C vault vault +fi From 5188b3b0c0dc8bfb8c6685adb0bb2be22b352dfe Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 18:04:47 +0200 Subject: [PATCH 10/17] Add license notice to gulp and grunt completion --- completion/available/grunt.completion.bash | 32 +++++++++++++++++++-- completion/available/gulp.completion.bash | 33 ++++++++++++++++++++-- 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/completion/available/grunt.completion.bash b/completion/available/grunt.completion.bash index 99a96b5b..e655c4ee 100644 --- a/completion/available/grunt.completion.bash +++ b/completion/available/grunt.completion.bash @@ -3,9 +3,35 @@ # grunt-cli # http://gruntjs.com/ # -# Copyright (c) 2012 Tyler Kellen, contributors -# Licensed under the MIT license. -# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT +# Copyright jQuery Foundation and other contributors, https://jquery.org/ + +# This software consists of voluntary contributions made by many +# individuals. For exact contribution history, see the revision history +# available at https://github.com/gruntjs/grunt . + +# The following license applies to all parts of this software except as +# documented below: + +# ==== + +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Usage: # diff --git a/completion/available/gulp.completion.bash b/completion/available/gulp.completion.bash index 17e91765..91e28764 100644 --- a/completion/available/gulp.completion.bash +++ b/completion/available/gulp.completion.bash @@ -2,9 +2,36 @@ # Borrowed from grunt-cli # http://gruntjs.com/ # -# Copyright (c) 2012 Tyler Kellen, contributors -# Licensed under the MIT license. -# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT +# Copyright jQuery Foundation and other contributors, https://jquery.org/ + +# This software consists of voluntary contributions made by many +# individuals. For exact contribution history, see the revision history +# available at https://github.com/gruntjs/grunt . + +# The following license applies to all parts of this software except as +# documented below: + +# ==== + +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + # Usage: # # To enable bash completion for gulp, add the following line (minus the From 8cc7327c0bf862cf9a75bd03a0537724cb870afc Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 18:20:07 +0200 Subject: [PATCH 11/17] Add license notice to salt completion --- completion/available/salt.completion.bash | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/completion/available/salt.completion.bash b/completion/available/salt.completion.bash index de493af9..03595f9f 100644 --- a/completion/available/salt.completion.bash +++ b/completion/available/salt.completion.bash @@ -1,3 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Copyright (c) 2020 SaltStack Team + +# Original Author: # written by David Pravec # - feel free to /msg alekibango on IRC if you want to talk about this file From 59439c2f622a8b6810df46e16d359c3cd2502348 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 18:33:35 +0200 Subject: [PATCH 12/17] Add license notice to docker-machine/compose completion --- .../available/docker-compose.completion.bash | 15 +++++++++++++++ .../available/docker-machine.completion.bash | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/completion/available/docker-compose.completion.bash b/completion/available/docker-compose.completion.bash index 941f25a3..bf2c13fb 100644 --- a/completion/available/docker-compose.completion.bash +++ b/completion/available/docker-compose.completion.bash @@ -1,5 +1,20 @@ #!/bin/bash # + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Copyright (c) 2014 Docker, Inc + # bash completion for docker-compose # # This work is based on the completion for the docker command. diff --git a/completion/available/docker-machine.completion.bash b/completion/available/docker-machine.completion.bash index 07d39d1e..677412ba 100644 --- a/completion/available/docker-machine.completion.bash +++ b/completion/available/docker-machine.completion.bash @@ -1,5 +1,20 @@ # # bash completion file for docker-machine commands + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Copyright (c) 2014 Docker, Inc + # # This script provides completion of: # - commands and their options From 292da7ef77164091cc8ce86a969221b24d7ad27c Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Wed, 16 Dec 2020 18:49:45 +0200 Subject: [PATCH 13/17] Add license notice to jboss7 completion --- completion/available/jboss7.completion.bash | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/completion/available/jboss7.completion.bash b/completion/available/jboss7.completion.bash index 0bb44f15..4479b45a 100644 --- a/completion/available/jboss7.completion.bash +++ b/completion/available/jboss7.completion.bash @@ -3,8 +3,27 @@ # DATE: 2012-10-30 # rparree-at-edc4it-dot-com +# MIT License +# Copyright (c) 2020 Raphael Parree +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. _serverProfiles(){ if [[ $COMP_WORDS == *standalone.sh* ]] From cd44880c156d38d29126f817a8b1cdefc0061bc8 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:45:42 +0200 Subject: [PATCH 14/17] Deprecate todo completion scripts as it is GPLv3 --- completion/available/todo.completion.bash | 72 +---------------------- 1 file changed, 2 insertions(+), 70 deletions(-) diff --git a/completion/available/todo.completion.bash b/completion/available/todo.completion.bash index 6e38c6f5..c2ec1b1f 100644 --- a/completion/available/todo.completion.bash +++ b/completion/available/todo.completion.bash @@ -1,70 +1,2 @@ -# link: https://github.com/ginatrapani/todo.txt-cli/blob/master/todo_completion - -_todo() -{ - local cur prev opts - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - - local -r OPTS="-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x" - local -r COMMANDS="\ - add a addto addm append app archive command del \ - rm depri dp do help list ls listaddons listall lsa listcon \ - lsc listfile lf listpri lsp listproj lsprj move \ - mv prepend prep pri p replace report shorthelp" - local -r MOVE_COMMAND_PATTERN='^(move|mv)$' - - local _todo_sh=${_todo_sh:-todo.sh} - local completions - if [ $COMP_CWORD -eq 1 ]; then - completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS" - elif [[ $COMP_CWORD -gt 2 && ( \ - "${COMP_WORDS[COMP_CWORD-2]}" =~ $MOVE_COMMAND_PATTERN || \ - "${COMP_WORDS[COMP_CWORD-3]}" =~ $MOVE_COMMAND_PATTERN ) ]]; then - completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile) - else - case "$prev" in - command) - completions=$COMMANDS;; - help) - completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons)";; - addto|listfile|lf) - completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile);; - -*) completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS";; - *) case "$cur" in - +*) completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listproj) - COMPREPLY=( $( compgen -W "$completions" -- $cur )) - [ ${#COMPREPLY[@]} -gt 0 ] && return 0 - completions=$(eval 'TODOTXT_VERBOSE=0 TODOTXT_SOURCEVAR=\$DONE_FILE' $_todo_sh command listproj) - ;; - @*) completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listcon) - COMPREPLY=( $( compgen -W "$completions" -- $cur )) - [ ${#COMPREPLY[@]} -gt 0 ] && return 0 - completions=$(eval 'TODOTXT_VERBOSE=0 TODOTXT_SOURCEVAR=\$DONE_FILE' $_todo_sh command listcon) - ;; - *) if [[ "$cur" =~ ^[0-9]+$ ]]; then - local todo=$( \ - eval TODOTXT_VERBOSE=0 $_todo_sh '-@ -+ -p -x command ls "^ *${cur} "' | \ - sed -e 's/^ *[0-9]\{1,\} //' -e 's/^\((.) \)\{0,1\}[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} /\1/' \ - -e 's/^\([xX] \)\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{1,2\}/\1/' \ - -e 's/[[:space:]]*$//' \ - -e '1q' \ - ) - [ "$todo" ] && COMPREPLY[0]="$cur # $todo" - return 0 - else - return 0 - fi - ;; - esac - ;; - esac - fi - - COMPREPLY=( $( compgen -W "$completions" -- $cur )) - return 0 -} - -complete -F _todo todo.sh -complete -F _todo t +_log_error 'Bash completion for "todo.txt-cli" is now deprecated, as it used code with incompatible license. +Please disable this completion and use the instructions from "todo.txt-cli" developers instead.' From a369cc7c0ad1e1d16e00fe784a4fcfe03476fa3e Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 17:47:56 +0200 Subject: [PATCH 15/17] Deprecate virsh completion as it is GPLv2 --- completion/available/virsh.completion.bash | 150 +-------------------- 1 file changed, 2 insertions(+), 148 deletions(-) diff --git a/completion/available/virsh.completion.bash b/completion/available/virsh.completion.bash index 4090a24a..f73f4b99 100644 --- a/completion/available/virsh.completion.bash +++ b/completion/available/virsh.completion.bash @@ -1,148 +1,2 @@ -#!/usr/bin/env bash -# bash completion for virsh - main CLI of libvirt - -# This script provides bash completion for virsh, -# borrowed from https://github.com/LuyaoHuang/virsh-bash-completion - - - -_contain_cmd() -{ - local e f - local array1=($1) array2=($2) - - for e in "${array1[@]}" - do - for f in "${array2[@]}" - do - if [[ "$e" == "$f" ]] ; then - echo $e - return - fi - done - done - - echo "notfound" - return -} - -_virsh_list_networks() -{ - local flag_all=$1 flags - - if [ "$flag_all" -eq 1 ]; then - flags="--all" - else - flags="--inactive" - fi - virsh -q net-list $flags | cut -d\ -f2 | awk '{print $1}' -} - -_virsh_list_domains() -{ - local flag_all=$1 flags - - if [ "$flag_all" -eq 1 ]; then - flags="--all" - else - flags="--inactive" - fi - virsh -q list $flags | cut -d\ -f7 | awk '{print $1}' -} - -_virsh_list_pools() -{ - local flag_all=$1 flags - - if [ "$flag_all" -eq 1 ]; then - flags="--all" - else - flags="--inactive" - fi - virsh -q pool-list $flags | cut -d\ -f2 | awk '{print $1}' -} - -_virsh_list_ifaces() -{ - local flag_all=$1 flags - - if [ "$flag_all" -eq 1 ]; then - flags="--all" - else - flags="--inactive" - fi - virsh -q iface-list $flags | cut -d\ -f2 | awk '{print $1}' -} - -_virsh_list_nwfilters() -{ - - virsh -q nwfilter-list | cut -d\ -f4 | awk '{print $1}' -} - -_virsh() -{ - local cur prev cmds doms options nets pools cmds_help - local flag_all=1 array ret a b ifaces nwfilters files - -# not must use bash-completion now :) -# _init_completion -s || return - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - - cmds=$( echo "$(virsh -h| grep '^ ' | cut -d\ -f5)" \ - "$(virsh -h| grep '\--' | cut -d\ -f7 | cut -d= -f1)") - cmds_help=$(virsh help| grep '^ ' | cut -d\ -f5) - case "$prev" in - --domain) - doms=$(_virsh_list_domains "$flag_all") - COMPREPLY=( $(compgen -W "$doms" -- "$cur") ) - return 0 - ;; - --network) - nets=$(_virsh_list_networks "$flag_all") - COMPREPLY=( $(compgen -W "$nets" -- "$cur") ) - return 0 - ;; - --pool) - pools=$(_virsh_list_pools "$flag_all") - COMPREPLY=( $(compgen -W "$pools" -- "$cur") ) - return 0 - ;; - --interface) - ifaces=$(_virsh_list_ifaces "$flag_all") - COMPREPLY=( $(compgen -W "$ifaces" -- "$cur") ) - return 0 - ;; - --nwfilter) - nwfilters=$(_virsh_list_nwfilters) - COMPREPLY=( $(compgen -W "$nwfilters" -- "$cur") ) - return 0 - ;; - --file|--xml) - files=$(ls) - COMPREPLY=( $(compgen -W "$files" -- "$cur") ) - return 0 - ;; - esac - - array=$(IFS=$'\n'; echo "${COMP_WORDS[*]}") - ret=$(_contain_cmd "$array" "$cmds_help") - - if [[ "$ret" != "notfound" && "$ret" != "$cur" ]]; then - a=$(virsh help "$ret" |grep '^ --'|cut -d\ -f5) - b=$(virsh help "$ret" |grep '^ \[--'|cut -d\ -f5|cut -d[ -f2|cut -d] -f1) - options=$( echo $a $b ) - COMPREPLY=( $(compgen -W "$options" -- "$cur") ) - return 0 - fi - - case "$cur" in - *) - COMPREPLY=( $(compgen -W "$cmds" -- "$cur") ) - return 0 - ;; - esac -} && -complete -o default -F _virsh virsh +_log_error 'Bash completion for "virsh" is now deprecated, as it used code with incompatible license. +Please disable this completion and use the instructions from "virsh" developers instead.' From 012552d8b7852f1bee8d80f5215be57082d19a6c Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 14 Dec 2020 18:26:00 +0200 Subject: [PATCH 16/17] Deprecate drush completion as it is GPLv2 --- completion/available/drush.completion.bash | 39 ++-------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/completion/available/drush.completion.bash b/completion/available/drush.completion.bash index 4f3f784f..1437dc66 100644 --- a/completion/available/drush.completion.bash +++ b/completion/available/drush.completion.bash @@ -1,37 +1,2 @@ -#!/usr/bin/env bash -# -# bash completion support for Drush: -# https://github.com/drush-ops/drush -# -# Originally from: -# http://github.com/drush-ops/drush/blob/master/drush.complete.sh - -# Ensure drush is available. -which drush &> /dev/null || alias drush &> /dev/null || return - -__drush_ps1() { - f="${TMPDIR:-/tmp/}/drush-env/drush-drupal-site-$$" - if [ -f $f ] - then - __DRUPAL_SITE=$(cat "$f") - else - __DRUPAL_SITE="$DRUPAL_SITE" - fi - - [[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE" -} - -# Completion function, uses the "drush complete" command to retrieve -# completions for a specific command line COMP_WORDS. -_drush_completion() { - # Set IFS to newline (locally), since we only use newline separators, and - # need to retain spaces (or not) after completions. - local IFS=$'\n' - # The '< /dev/null' is a work around for a bug in php libedit stdin handling. - # Note that libedit in place of libreadline in some distributions. See: - # https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214 - COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) ) -} - -# Register our completion function. We include common short aliases for Drush. -complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush6 drush.php +_log_error 'Bash completion for "drush" is now deprecated, as it used code with incompatible license. +Please disable this completion and use the instructions from "drush" developers instead.' From 8e73b538eac5faf8a6d10fad9eab717db3825bc7 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Mon, 21 Dec 2020 00:08:11 +0200 Subject: [PATCH 17/17] Deprecate homesick completion as it is unlicensed --- completion/available/homesick.completion.bash | 61 +------------------ 1 file changed, 2 insertions(+), 59 deletions(-) diff --git a/completion/available/homesick.completion.bash b/completion/available/homesick.completion.bash index 31104f5b..49ff4d37 100644 --- a/completion/available/homesick.completion.bash +++ b/completion/available/homesick.completion.bash @@ -1,59 +1,2 @@ -# Bash completion script for homesick -# -# The homebrew bash completion script was used as inspiration. -# Originally from https://github.com/liborw/homesick-completion - -_homesick_complete() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local options="--skip --force --pretend --quiet" - local actions="cd clone commit destroy diff generate help list open pull push rc show_path status symlink track unlink version" - local repos=$(\ls ~/.homesick/repos) - - # Subcommand list - [[ ${COMP_CWORD} -eq 1 ]] && { - COMPREPLY=( $(compgen -W "${options} ${actions}" -- ${cur}) ) - return - } - - # Find the first non-switch word - local prev_index=1 - local prev="${COMP_WORDS[prev_index]}" - while [[ $prev == -* ]]; do - prev_index=$((++prev_index)) - prev="${COMP_WORDS[prev_index]}" - done - - # Find the number of non-"--" commands - local num=0 - for word in ${COMP_WORDS[@]} - do - if [[ $word != -* ]]; then - num=$((++num)) - fi - done - - case "$prev" in - # Commands that take a castle - cd|commit|destroy|diff|open|pull|push|rc|show_path|status|symlink|unlink) - COMPREPLY=( $(compgen -W "${repos}" -- ${cur}) ) - return - ;; - # Commands that take command - help) - COMPREPLY=( $(compgen -W "${actions}" -- ${cur}) ) - return - ;; - # Track command take file and repo - track) - if [[ "$num" -eq 2 ]]; then - COMPREPLY=( $(compgen -X -f ${cur}) ) - elif [[ "$num" -ge 3 ]]; then - COMPREPLY=( $(compgen -W "${repos}" -- ${cur}) ) - fi - return - ;; - esac -} - -complete -o bashdefault -o default -F _homesick_complete homesick +_log_error 'Bash completion for "homesick" is now deprecated, as it used unlicensed code. +Please disable this completion and use the instructions from "homesick" bash completion developers instead.'