Code View

plugin / plugin-2.2.0.0 / tools / auto-complete / dso-verify.bash
#!/bin/bash
# SPDX-License-Identifier: MIT
# dso-verify — Bash completion
_ffs_dso_verify() {
    local cur prev words cword
    _init_completion || return
    local opts="--keys --quiet -q -h --help"
    case "${prev}" in
        --keys)
            COMPREPLY=( $( compgen -d -- "${cur}" ) ); return ;;
    esac
    if [[ "${cur}" == -* ]]; then
        COMPREPLY=( $( compgen -W "${opts}" -- "${cur}" ) )
    else
        # First positional is the addon to verify (.ffs, or a plain .so).
        COMPREPLY=( $( compgen -f -X '!*.ffs' -- "${cur}" ) )
        COMPREPLY+=( $( compgen -f -X '!*.so' -- "${cur}" ) )
        COMPREPLY+=( $( compgen -d -- "${cur}" ) )
    fi
}
complete -F _ffs_dso_verify dso-verify