aboutsummaryrefslogtreecommitdiffstats
path: root/commands/prompt.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2023-05-10 23:56:23 +0200
committerRobin Jarry <robin@jarry.cc>2023-05-16 13:39:17 +0200
commit5c9d22bb84eb8a6ddd4477bae3c081964d6e7b51 (patch)
tree263083c1f55d60d55d2b005d6504c64393432186 /commands/prompt.go
parentcd68adc4630ed834eeac33f09ef58891c18c2dee (diff)
downloadaerc-5c9d22bb84eb8a6ddd4477bae3c081964d6e7b51.tar.gz
commands: add OptionsProvider and OptionCompleter
Improve command completion by supporting option flags and option arguments completion. Option completion is activated when the command implements the OptionsProvider interface. Implementing the OptionCompleter allows the completion of individual option arguments. The completion interfaces harmonizes the completion behavior in aerc, makes the completion code clearer and simplifies the completion functionality. With this patch, the Complete method on commands will only have to deal with the actual completion, i.e. paths, folders, etc and not worry about options. To remove all options and its mandatory arguments from args, use commands.Operands(). Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/prompt.go')
-rw-r--r--commands/prompt.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/prompt.go b/commands/prompt.go
index 8746bcfe..a93d19a9 100644
--- a/commands/prompt.go
+++ b/commands/prompt.go
@@ -36,7 +36,7 @@ func (Prompt) Complete(aerc *widgets.Aerc, args []string) []string {
if hascommand {
return nil
}
- cs = GlobalCommands.GetCompletions(aerc, args[1])
+ cs, _ = GlobalCommands.GetCompletions(aerc, args[1])
}
if cs == nil {
return nil