diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:18 +0000 |
commit | f2621414ee5f2f601424c22f00e207903e3b6104 (patch) | |
tree | 56a856dafd1ca684bb23263cacaa723ee4f404fc /completions/truncate | |
parent | Adding debian version 1:2.11-8. (diff) | |
download | bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.zip |
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/truncate')
-rw-r--r-- | completions/truncate | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/completions/truncate b/completions/truncate new file mode 100644 index 0000000..94534a2 --- /dev/null +++ b/completions/truncate @@ -0,0 +1,32 @@ +# truncate(1) completion -*- shell-script -*- + +_comp_cmd_truncate() +{ + local cur prev words cword was_split comp_args + _comp_initialize -s -- "$@" || return + + local noargopts='!(-*|*[sr]*)' + # shellcheck disable=SC2254 + case $prev in + -${noargopts}s | --size | --help | --version) + return + ;; + -${noargopts}r | --reference) + _comp_compgen_filedir + return + ;; + esac + + [[ $was_split ]] && return + + if [[ $cur == -* ]]; then + _comp_compgen_help + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace + return + fi + + _comp_compgen_filedir +} && + complete -F _comp_cmd_truncate truncate + +# ex: filetype=sh |