File: chsh

package info (click to toggle)
yash 2.60-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,152 kB
  • sloc: ansic: 34,578; makefile: 851; sh: 808; sed: 16
file content (58 lines) | stat: -rw-r--r-- 1,668 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# (C) 2011 magicant

# Completion script for the "chsh" command.
# Supports util-linux 2.18, FreeBSD 8.1, OpenBSD 4.9, NetBSD 5.0,
# Mac OS X 10.6.4, HP-UX 11i v3.

function completion/chsh {

        case $(uname 2>/dev/null) in
        (Linux)
                typeset OPTIONS ARGOPT PREFIX
                OPTIONS=( #>#
                "s: --shell:; specify the new shell"
                "l --list-shells; print available shells"
                "u --help; print help"
                "v --version; print version into"
                ) #<#
                ;;
        (*BSD|Darwin)
                command -f completion//reexecute chpass
                return
                ;;
        (HP-UX)
                typeset OPTIONS ARGOPT PREFIX
                OPTIONS=( #>#
                "r:; specify the repository to operate on"
                ) #<#
                ;;
        esac

        command -f completion//parseoptions ${long:+-es}
        case $ARGOPT in
        (-)
                command -f completion//completeoptions
                ;;
        (r)
                complete -P "$PREFIX" dce files nis
                ;;
        (s|--shell)
                complete -P "$PREFIX" -- $(grep -v ^# /etc/shells 2>/dev/null)
                ;;
        (*)
                command -f completion//getoperands
                case ${WORDS[#]} in
                (0)
                        complete -u
                        ;;
                (*)
                        complete -P "$PREFIX" -- $(grep -v ^# /etc/shells 2>/dev/null)
                        ;;
                esac
                ;;
        esac

}


# vim: set ft=sh ts=8 sts=8 sw=8 et: