On Sun, 31 May 2020 15:00:46 -0300 "Gabriel F. T. Gomes" 
<[email protected]> wrote:
> On the other, you are saying that the completions do not work from this
> location, and that's puzzling me. Could you provide more details about
> the problem you are actually getting? Bash-completion is supposed to
> work with files in this location.

One detail is, if you invoke the program fsmtool2 or fsmtool2_mtest for which I 
have the completion scripts, the directory listing of $PWD is shown if I press 
TAB two times consecutively.

As another detail find attached the completion script.


Thanks
Jürgen
have fsmtool2 && {
_fsmtool2_commands() {
    COMPREPLY=( $(compgen -W "help showconfig showfiles showfileslex deleteall" 
-- $1) )
}

_fsmtool2()
{
    local areas command cur
    cur=${COMP_WORDS[COMP_CWORD]}
    command=${COMP_WORDS[1]}
    case $COMP_CWORD in
        1)
            _fsmtool2_commands $cur
            ;;
        2)
            case $command in
                help)
                    _fsmtool2_commands $cur
                    ;;
                showconfig|showfiles|showfileslex|deleteall)
                    areas=$(grep '^\s*AREA' /etc/fsmd2/fsmd2.conf | awk '{print 
$2}')
                    COMPREPLY=( $(compgen -W "$areas" -- $cur) )
                    ;;
            esac
            ;;
        3)
            case $command in
                showfiles|showfileslex)
                    COMPREPLY=-n
                    ;;
            esac
            ;;
    esac
}
complete -F _fsmtool2 fsmtool2
}

Attachment: 0xA811F9F222306A1E.asc
Description: application/pgp-keys

Reply via email to