PageRenderTime 12ms CodeModel.GetById 9ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion.d/ntpdate

http://github.com/brinkman83/bashrc
#! | 38 lines | 33 code | 5 blank | 0 comment | 0 complexity | 45cdc0602fb6a6a13e5d28948b04097e MD5 | raw file
 1# bash completion for ntpdate
 2
 3have ntpdate &&
 4_ntpdate()
 5{
 6    local cur prev
 7
 8    COMPREPLY=()
 9    cur=`_get_cword`
10    prev=${COMP_WORDS[COMP_CWORD-1]}
11
12    case $prev in
13        -k)
14            _filedir
15            return 0
16            ;;
17        -U)
18            COMPREPLY=( $( compgen -u "$cur"  ) )
19            return 0
20            ;;
21    esac
22
23    if [[ "$cur" == -* ]]; then
24        COMPREPLY=( $( compgen -W '-4 -6 -b -B -d -Q -q -s -u -v -a\
25            -e -k -p -o -r -t' -- "$cur" ) )
26    else
27        _known_hosts_real "$cur"
28    fi
29} &&
30complete -F _ntpdate ntpdate
31
32# Local variables:
33# mode: shell-script
34# sh-basic-offset: 4
35# sh-indent-comment: t
36# indent-tabs-mode: nil
37# End:
38# ex: ts=4 sw=4 et filetype=sh