bash-completion.sh
author František Kučera <franta-hg@frantovo.cz>
Thu, 15 Dec 2022 21:43:59 +0100
branchv_0
changeset 8 9f89ecc071bf
parent 3 be6f2e307a65
permissions -rw-r--r--
bash-completion.sh: local variables
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Relational pipes
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
# Copyright © 2022 František Kučera (Frantovo.cz, GlobalCode.info)
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# This program is free software: you can redistribute it and/or modify
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
# it under the terms of the GNU General Public License as published by
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
# the Free Software Foundation, version 3 of the License.
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
#
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
# This program is distributed in the hope that it will be useful,
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# GNU General Public License for more details.
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
#
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
# You should have received a copy of the GNU General Public License
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
_relpipe_out_posixmq_completion() {
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
	local w0 w1 w2 w3
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
	COMPREPLY=()
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
	w0=${COMP_WORDS[COMP_CWORD]}
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
	w1=${COMP_WORDS[COMP_CWORD-1]}
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
	w2=${COMP_WORDS[COMP_CWORD-2]}
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
	w3=${COMP_WORDS[COMP_CWORD-3]}
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
8
9f89ecc071bf bash-completion.sh: local variables
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    25
	local DATA_TYPE=(
3
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
		"string"
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
		"integer"
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
		"boolean"
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
	)
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
8
9f89ecc071bf bash-completion.sh: local variables
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    31
	local BOOLEAN_VALUES=(
3
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
		"true"
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
		"false"
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
	)
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
	if   [[ "$w1" == "--relation"                      && "x$w0" == "x" ]];    then COMPREPLY=("''")
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	elif [[ "$w1" == "--unlink-on-close"                                ]];    then COMPREPLY=($(compgen -W "${BOOLEAN_VALUES[*]}" -- "$w0"))
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
	elif [[ "$w1" == "--queue"                         && "x$w0" == "x" ]];    then COMPREPLY=("''")
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
	else
8
9f89ecc071bf bash-completion.sh: local variables
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    40
		local OPTIONS=(
3
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
			"--relation"
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
			"--unlink-on-close"
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
			"--queue"
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
		)
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
		COMPREPLY=($(compgen -W "${OPTIONS[*]}" -- "$w0"))
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
	fi
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
}
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
be6f2e307a65 configuration + option: --unlink-on-close
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
complete -F _relpipe_out_posixmq_completion relpipe-out-posixmq