晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 sh-3ll

HOME


sh-3ll 1.0
DIR:/proc/thread-self/root/opt/cpguard/3rdparty/lynis/extras/bash_completion.d/
Upload File :
Current File : //proc/thread-self/root/opt/cpguard/3rdparty/lynis/extras/bash_completion.d/lynis
# bash completion for lynis

# version 1.0.1 (2019-07-13)
# Michael Boelen <michael.boelen@cisofy.com>

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

    COMPREPLY=()
    _get_comp_words_by_ref cur prev words

    if [ $COMP_CWORD -eq 1 ]; then
        # first parameter on line
        case $cur in
            -*)
                COMPREPLY=( $( compgen -W '--help --info --version' -- "$cur" ) )
                ;;
            *)
                COMPREPLY=( $( compgen -W 'audit generate show' -- "$cur" ) )
                ;;
        esac
        return 0
    elif [ $COMP_CWORD -eq 4 ]; then
        # Stop after some specifics
        if [ "${COMP_WORDS[1]}" = "show" -a "${COMP_WORDS[2]}" = "details" ]; then
            return 0
        fi
    fi

    # Check previous argument to share the available options
    case $prev in
        audit)
            COMPREPLY=( $( compgen -W 'dockerfile system ' -- "$cur" ) )
            ;;

        show)
            COMPREPLY=( $( compgen -W 'categories changelog commands dbdir details environment eol groups help hostids includedir language license logfile man options os pidfile plugindir profiles release releasedate report settings tests  version workdir ' -- "$cur" ) )
            ;;

        # Related items to show (lynis show XYZ)
        categories)
            return 0
            ;;
        changelog)
            return 0
            ;;
        commands)
            return 0
            ;;
        dbdir)
            return 0
            ;;
        details)
            local dbfile=""
            local dirs="/data/development/lynis /usr/local/lynis /usr/share/lynis"
            for d in ${dirs}; do
                if [ -f "${d}/db/tests.db" ]; then
                    local dbfile="/data/development/lynis/db/tests.db"
                fi
            done
            if [ -f "${dbfile}" ]; then
                local suggestions=($(compgen -W "$(awk -F: '$1 ~ /^[A-Z]/ {print $1}' ${dbfile})" -- "${cur}"))
                COMPREPLY=("${suggestions[@]}")
            else
                COMPREPLY=($(compgen -W "TEST-1234" -- "$cur"))
            fi
            ;;
        environment)
            return 0
            ;;
        eol)
            return 0
            ;;
        groups)
            return 0
            ;;
        help)
            return 0
            ;;
        hostids)
            if [ "${COMP_WORDS[1]}" = "generate" -a "${COMP_WORDS[2]}" = "hostids" ]; then
                COMPREPLY=($(compgen -W "save" -- "$cur"))
            else
                return 0
            fi
            ;;
        includedir)
            return 0
            ;;
        language)
            return 0
            ;;
        license)
            return 0
            ;;
        logfile)
            return 0
            ;;
        man)
            return 0
            ;;
        options)
            return 0
            ;;
        os)
            return 0
            ;;
        pidfile)
            return 0
            ;;
        plugindir)
            return 0
            ;;
        profiles)
            return 0
            ;;
        release)
            return 0
            ;;
        releasedate)
            return 0
            ;;
        report)
            return 0
            ;;
        settings)
            return 0
            ;;
        tests)
            return 0
            ;;
        version)
            return 0
            ;;
        workdir)
            return 0
            ;;

        generate)
            COMPREPLY=( $( compgen -W 'hostids ' -- "$cur" ) )
            ;;

        # Options
        --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-from-category)
            COMPREPLY=( '"performance privacy security"' )
            return 0
            ;;
        --tests-from-groups)
            COMPREPLY=( '"accounting authentication"' )
            return 0
            ;;
        *)
            COMPREPLY=( $( compgen -W ' \
                --auditor --cronjob --debug --quick --quiet --logfile --no-colors --no-log --pentest --reverse-colors \
                --tests --tests-from-category --tests-from-group --upload --verbose --slow-warning' -- "$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