summaryrefslogtreecommitdiffstats
path: root/completions/lftp
diff options
context:
space:
mode:
Diffstat (limited to 'completions/lftp')
-rw-r--r--completions/lftp22
1 files changed, 12 insertions, 10 deletions
diff --git a/completions/lftp b/completions/lftp
index 72dedb4..16264cf 100644
--- a/completions/lftp
+++ b/completions/lftp
@@ -1,28 +1,30 @@
# lftp(1) completion -*- shell-script -*-
-_lftp()
+_comp_cmd_lftp()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
+ local noargopts='!(-*|*[fceups]*)'
+ # shellcheck disable=SC2254
case $prev in
- -!(-*)f)
- _filedir
+ -${noargopts}f)
+ _comp_compgen_filedir
return
;;
- --help | --version | -!(-*)[chveups])
+ --help | --version | -${noargopts}[chveups])
return
;;
esac
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
+ _comp_compgen_help
return
fi
- COMPREPLY=($(compgen -W '$("$1" -c "bookmark list" 2>/dev/null)' -- "$cur"))
- _known_hosts_real -- "$cur"
+ _comp_compgen_split -- "$("$1" -c "bookmark list" 2>/dev/null)"
+ _comp_compgen -a known_hosts -- "$cur"
} &&
- complete -F _lftp lftp
+ complete -F _comp_cmd_lftp lftp
# ex: filetype=sh