Welcome to mirror list, hosted at ThFree Co, Russian Federation.

lynis « bash_completion.d « extras - github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 299f5a1e43e079b40e52cd96440eb038ac788ade (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# bash completion for lynis

# version 1.0.0 (22 September 2014)
# Michael Boelen <michael.boelen@cisofy.com>

# lynis(8) completion
_lynis()
{
    local cur prev
    # opts nodig nosig

    COMPREPLY=()
    _get_comp_words_by_ref cur prev

    if [ $COMP_CWORD -eq 1 ]; then
        # first parameter on line
        case $cur in
            -*)
                COMPREPLY=( $( compgen -W '--check-all --help --info --version' -- "$cur" ) )
                ;;
            *)
                COMPREPLY=( $( compgen -W 'audit --help --info --version' -- "$cur" ) )
                ;;
        esac

    return 0
    fi

    case $prev in
        audit)
            COMPREPLY=( $( compgen -W 'dockerfile system ' -- "$cur" ) )
            ;;
        show)
            COMPREPLY=( $( compgen -W 'help version ' -- "$cur" ) )
            ;;

        --auditor)
            COMPREPLY=( '"Mr. Auditor"' )
            return 0
            ;;
        --check-update|--help|--info|--version)
            # all other options are noop with this command
            return 0
            ;;
        --logfile)
            COMPREPLY=( 'myfile.log' )
            return 0
            ;;
        --plugin-dir)
            _filedir -d
            return 0
            ;;
        --profile)
            COMPREPLY=( 'default.prf' )
            return 0
            ;;
        --tests)
            COMPREPLY=( '"TEST-0001 TEST-0002 TEST-0003"' )
            return 0
            ;;
        --tests-category)
            COMPREPLY=( '"accounting authentication"' )
            return 0
            ;;
        *)
            COMPREPLY=( $( compgen -W ' \
                --auditor --cronjob --debug --quick --quiet --logfile --no-colors --no-log --pentest --reverse-colors \
                --tests --tests-category --upload --verbose --view-categories' -- "$cur" ) )
            ;;
    esac

    return 0
}

complete -F _lynis lynis

# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh