summaryrefslogtreecommitdiff
path: root/completions/mutt
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2019-08-07 09:17:13 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2019-08-07 09:17:13 -0300
commit5732da2af736c40cf693354485446ab4867ecb4d (patch)
tree76d76cdfa16ca62d20fb109da13895ec64fff110 /completions/mutt
parent9cd22d1df8f0f5b554858471c86faa9f37b8fed4 (diff)
downloadbash-completion-5732da2af736c40cf693354485446ab4867ecb4d.tar.gz
New upstream version 2.9upstream/2.9
Diffstat (limited to 'completions/mutt')
-rw-r--r--completions/mutt34
1 files changed, 17 insertions, 17 deletions
diff --git a/completions/mutt b/completions/mutt
index 568479ec..43a8842e 100644
--- a/completions/mutt
+++ b/completions/mutt
@@ -9,7 +9,7 @@ _muttaddr()
_muttaliases "$1"
_muttquery "$1"
- COMPREPLY+=( $( compgen -u -- "$1" ) )
+ COMPREPLY+=( $(compgen -u -- "$1") )
}
@@ -78,9 +78,9 @@ _muttaliases()
[[ -z $muttrc ]] && return
conffiles=( $(eval _muttconffiles $muttrc $muttrc) )
- aliases=( $( command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \
- $(eval echo "${conffiles[@]}") ) )
- COMPREPLY+=( $( compgen -W "${aliases[*]}" -- "$cur" ) )
+ aliases=( $(command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \
+ $(eval echo "${conffiles[@]}")) )
+ COMPREPLY+=( $(compgen -W "${aliases[*]}" -- "$cur") )
}
@@ -90,16 +90,16 @@ _muttquery()
local cur=$1 querycmd muttcmd=${words[0]}
local -a queryresults
- querycmd="$( $muttcmd -Q query_command 2>/dev/null | command sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'$cur'|' )"
+ querycmd="$($muttcmd -Q query_command 2>/dev/null | command sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'$cur'|')"
if [[ -z "$cur" || -z "$querycmd" ]]; then
queryresults=()
else
__expand_tilde_by_ref querycmd
- queryresults=( $( $querycmd | \
- command sed -n '2,$s|^\([^[:space:]]\{1,\}\).*|\1|p' ) )
+ queryresults=( $($querycmd | \
+ command sed -n '2,$s|^\([^[:space:]]\{1,\}\).*|\1|p') )
fi
- COMPREPLY+=( $( compgen -W "${queryresults[*]}" -- "$cur" ) )
+ COMPREPLY+=( $(compgen -W "${queryresults[*]}" -- "$cur") )
}
@@ -110,18 +110,18 @@ _muttfiledir()
muttrc=$(_muttrc)
if [[ $cur == [=+]* ]]; then
- folder="$( $muttcmd -F "$muttrc" -Q folder 2>/dev/null | command sed -e 's|^folder=\"\(.*\)\"$|\1|' )"
+ folder="$($muttcmd -F "$muttrc" -Q folder 2>/dev/null | command sed -e 's|^folder=\"\(.*\)\"$|\1|')"
: folder:=~/Mail
# Match any file in $folder beginning with $cur
# (minus the leading '=' sign).
compopt -o filenames
- COMPREPLY=( $( compgen -f -- "$folder/${cur:1}" ) )
+ COMPREPLY=( $(compgen -f -- "$folder/${cur:1}") )
COMPREPLY=( ${COMPREPLY[@]#$folder/} )
return
elif [[ $cur == !* ]]; then
- spoolfile="$( $muttcmd -F "$muttrc" -Q spoolfile 2>/dev/null | \
- command sed -e 's|^spoolfile=\"\(.*\)\"$|\1|' )"
+ spoolfile="$($muttcmd -F "$muttrc" -Q spoolfile 2>/dev/null | \
+ command sed -e 's|^spoolfile=\"\(.*\)\"$|\1|')"
[[ ! -z $spoolfile ]] && eval cur="${cur/^!/$spoolfile}"
fi
_filedir
@@ -135,21 +135,21 @@ _mutt()
case $cur in
-*)
- COMPREPLY=( $( compgen -W '-A -a -b -c -e -f -F -H -i -m -n -p -Q -R -s
- -v -x -y -z -Z -h' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W '-A -a -b -c -e -f -F -H -i -m -n -p -Q -R -s
+ -v -x -y -z -Z -h' -- "$cur") )
return
;;
*)
case $prev in
- -a|-f|-F|-H|-i)
+ -*[afFHi])
_muttfiledir "$cur"
return
;;
- -A)
+ -*A)
_muttaliases "$cur"
return
;;
- -e|-m|-Q|-s|-h|-p|-R|-v|-y|-z|-Z)
+ -*[emQshpRvyzZ])
return
;;
*)