summaryrefslogtreecommitdiffstats
path: root/completions/lastlog
diff options
context:
space:
mode:
Diffstat (limited to 'completions/lastlog')
-rw-r--r--completions/lastlog20
1 files changed, 11 insertions, 9 deletions
diff --git a/completions/lastlog b/completions/lastlog
index 214a174..8faf82b 100644
--- a/completions/lastlog
+++ b/completions/lastlog
@@ -1,25 +1,27 @@
# lastlog(8) completion -*- shell-script -*-
-_lastlog()
+_comp_cmd_lastlog()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -- "$@" || return
+ local noargopts='!(-*|*[btu]*)'
+ # shellcheck disable=SC2254
case $prev in
- --before | --help | --time | -!(-*)@([bt]|h*))
+ --before | --help | --time | -${noargopts}@([bt]|h*))
return
;;
- --user | -!(-*)u)
- COMPREPLY=($(compgen -u -- "$cur"))
+ --user | -${noargopts}u)
+ _comp_compgen -- -u
return
;;
esac
- $split && return
+ [[ $was_split ]] && return
- COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
+ _comp_compgen_help
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
} &&
- complete -F _lastlog lastlog
+ complete -F _comp_cmd_lastlog lastlog
# ex: filetype=sh