diff options
author | Koni Marti <koni.marti@gmail.com> | 2023-11-24 16:03:03 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-12-30 15:42:09 +0100 |
commit | cf47763e5582563f712b4a40a9b299378aba9003 (patch) | |
tree | af83b863a644a90a69eef891a4ce06023224a213 /app/aerc.go | |
parent | fdd9f7991aa50bd99d21c178a2816fc075eead6b (diff) | |
download | aerc-cf47763e5582563f712b4a40a9b299378aba9003.tar.gz |
patch/list: add list sub-cmd
Implement the :patch list command. List the the current project and add
a flag to list all saved projects. Use the pager to display the data and
extract the pager commands and move them into the config package.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'app/aerc.go')
-rw-r--r-- | app/aerc.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/aerc.go b/app/aerc.go index 046c7871..c7307540 100644 --- a/app/aerc.go +++ b/app/aerc.go @@ -873,9 +873,9 @@ func (aerc *Aerc) isExKey(event *tcell.EventKey, exKey config.KeyStroke) bool { return event.Modifiers() == exKey.Modifiers && event.Key() == exKey.Key } -// cmdFallbackSearch checks cmds for the first executable availabe in PATH. An error is +// CmdFallbackSearch checks cmds for the first executable availabe in PATH. An error is // returned if none are found -func cmdFallbackSearch(cmds []string) (string, error) { +func CmdFallbackSearch(cmds []string, silent bool) (string, error) { var tried []string for _, cmd := range cmds { if cmd == "" { @@ -885,8 +885,10 @@ func cmdFallbackSearch(cmds []string) (string, error) { _, err := exec.LookPath(params[0]) if err != nil { tried = append(tried, cmd) - warn := fmt.Sprintf("cmd '%s' not found in PATH, using fallback", cmd) - PushWarning(warn) + if !silent { + warn := fmt.Sprintf("cmd '%s' not found in PATH, using fallback", cmd) + PushWarning(warn) + } continue } return cmd, nil |