aboutsummaryrefslogtreecommitdiff
path: root/commands/msg/archive.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msg/archive.go')
-rw-r--r--commands/msg/archive.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/commands/msg/archive.go b/commands/msg/archive.go
index f4d6e3be..34cba8b8 100644
--- a/commands/msg/archive.go
+++ b/commands/msg/archive.go
@@ -21,7 +21,7 @@ const (
var ARCHIVE_TYPES = []string{ARCHIVE_FLAT, ARCHIVE_YEAR, ARCHIVE_MONTH}
type Archive struct {
- Type string `opt:"type" action:"ParseArchiveType" metavar:"flat|year|month"`
+ Type string `opt:"type" action:"ParseArchiveType" metavar:"flat|year|month" complete:"CompleteType"`
}
func (a *Archive) ParseArchiveType(arg string) error {
@@ -42,9 +42,8 @@ func (Archive) Aliases() []string {
return []string{"archive"}
}
-func (Archive) Complete(args []string) []string {
- valid := []string{"flat", "year", "month"}
- return commands.CompletionFromList(valid, args)
+func (*Archive) CompleteType(arg string) []string {
+ return commands.CompletionFromList(ARCHIVE_TYPES, arg)
}
func (a Archive) Execute(args []string) error {