f / f/omelette

Fall back to _filedir, compgen -f, etc. if no matches are returned

Open
#4 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
CoffeeScript
Stars
1.4k
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Programs that use omelette completion can no longer complete files and directories. I modified my completion script to fall back to `_filedir` (it relies on the `$cur` and `$prev` variables):

``` bash
_p_complette() {
local cur prev

cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}

COMPREPLY=( $(compgen -W '$(projects --compbash --compgen "${COMP_CWORD}" "${prev}" "${COMP_LINE}")' -- "$cur") )

[[ $COMPREPLY ]] && return

_filedir
}
complete -F _p_complette p
```

In the same way `compgen -f` with `compopt -o filenames` could be used, I think.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.