Skip to content

Commit

Permalink
feat(mailman): prefer list_lists in same dir as command
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed May 23, 2023
1 parent 9b443a9 commit a46ccf1
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions completions/add_members
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ _comp_cmd_add_members()
_comp_compgen -- -W '--regular-members-file --digest-members-file
--welcome-msg --admin-notify --help'
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/arch
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ _comp_have_command mailmanctl &&
done
case $args in
1)
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
;;
2)
Expand Down
3 changes: 3 additions & 0 deletions completions/change_pw
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ _comp_cmd_change_pw()

case $prev in
-l | --listname)
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
return
;;
Expand Down
3 changes: 3 additions & 0 deletions completions/check_db
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ _comp_cmd_check_db()
if [[ $cur == -* ]]; then
_comp_compgen -- -W '--all --verbose --help'
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/clone_member
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ _comp_cmd_clone_member()

case $prev in
-l | --listname)
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
return
;;
Expand Down
3 changes: 3 additions & 0 deletions completions/config_list
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ _comp_cmd_config_list()
COMPREPLY=($(compgen -W '--inputfile --outputfile --checkonly
--verbose --help' -- "$cur"))
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/find_member
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ _comp_cmd_find_member()

case $prev in
-l | -x | --listname | --exclude)
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
return
;;
Expand Down
3 changes: 3 additions & 0 deletions completions/inject
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ _comp_cmd_inject()

case $prev in
-l | --listname)
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
return
;;
Expand Down
3 changes: 3 additions & 0 deletions completions/list_admins
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ _comp_cmd_list_admins()
if [[ $cur == -* ]]; then
_comp_compgen -- -W '--all-vhost --all --help'
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/list_members
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ _comp_cmd_list_members()
COMPREPLY=($(compgen -W '--output --regular --digest --nomail
--fullnames --preserve --help' -- "$cur"))
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/list_owners
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ _comp_cmd_list_owners()
if [[ $cur == -* ]]; then
_comp_compgen -- -W '--with-listnames --moderators --help'
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/newlist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ _comp_cmd_newlist()
_comp_compgen_help
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi
} &&
Expand Down
3 changes: 3 additions & 0 deletions completions/remove_members
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ _comp_cmd_remove_members()
_comp_compgen -- -W '--file --all --fromall --nouserack --noadminack
--help'
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/rmlist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ _comp_cmd_rmlist()
if [[ $cur == -* ]]; then
_comp_compgen -- -W '--archives --help'
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/sync_members
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ _comp_cmd_sync_members()
_comp_compgen -- -W '--no-change --welcome-msg --goodbye-msg --digest
--notifyadmin --file --help'
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down
3 changes: 3 additions & 0 deletions completions/withlist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ _comp_cmd_withlist()
if [[ $cur == -* ]]; then
_comp_compgen -- -W '--lock --interactive --run --all --quiet --help'
else
# Prefer `list_lists` in the same dir as command
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
_comp_xfunc list_lists mailman_lists
fi

Expand Down

0 comments on commit a46ccf1

Please sign in to comment.