diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
commit | 95623d39d6029ba78ec96ad5ea08e9ac12629b91 (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /completions/postcat | |
parent | 019f3cc463db63abc6460f97deb488deec43840b (diff) | |
download | bash-completion-95623d39d6029ba78ec96ad5ea08e9ac12629b91.tar.gz |
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'completions/postcat')
-rw-r--r-- | completions/postcat | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/completions/postcat b/completions/postcat index 22006233..a58b0e57 100644 --- a/completions/postcat +++ b/completions/postcat @@ -13,20 +13,20 @@ _postcat() esac if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi local idx qfile=0 for idx in "${words[@]}"; do - [[ "$idx" == -q ]] && qfile=1 && break + [[ $idx == -q ]] && qfile=1 && break done - if [[ $qfile -eq 1 ]]; then + if ((qfile == 1)); then local len=${#cur} pval - for pval in $(mailq 2>/dev/null | \ + for pval in $(mailq 2>/dev/null | command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//'); do - if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY+=( $pval ) + if [[ $cur == "${pval:0:len}" ]]; then + COMPREPLY+=($pval) fi done return @@ -34,6 +34,6 @@ _postcat() _filedir } && -complete -F _postcat postcat + complete -F _postcat postcat # ex: filetype=sh |