about summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-04-11 04:12:38 +0200
committerDrew DeVault <sir@cmpwn.com>2020-04-11 10:46:46 -0400
commit1fbce012ed85f385be4add710c2de5bb09c81998 (patch)
treee5a8f8a9d0795d8c9764104a05c4bac8c78f353b /commands
parent2b53347d0de8ca3b2bfdf539539dac01f7424678 (diff)
downloadaerc-1fbce012ed85f385be4add710c2de5bb09c81998.tar.gz
msg/archive: complete the possible options
Diffstat (limited to 'commands')
-rw-r--r--commands/commands.go15
-rw-r--r--commands/msg/archive.go3
2 files changed, 17 insertions, 1 deletions
diff --git a/commands/commands.go b/commands/commands.go
index 39720bf..0c761d1 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -128,6 +128,21 @@ func GetFolders(aerc *widgets.Aerc, args []string) []string {
 	return out
 }
 
+// CompletionFromList provides a convenience wrapper for commands to use in the
+// Complete function. It simply matches the items provided in valid
+func CompletionFromList(valid []string, args []string) []string {
+	out := make([]string, 0)
+	if len(args) == 0 {
+		return valid
+	}
+	for _, v := range valid {
+		if hasCaseSmartPrefix(v, args[0]) {
+			out = append(out, v)
+		}
+	}
+	return out
+}
+
 func GetLabels(aerc *widgets.Aerc, args []string) []string {
 	if len(args) == 0 {
 		return aerc.SelectedAccount().Labels()
diff --git a/commands/msg/archive.go b/commands/msg/archive.go
index 966d598..783ab04 100644
--- a/commands/msg/archive.go
+++ b/commands/msg/archive.go
@@ -32,7 +32,8 @@ func (Archive) Aliases() []string {
 }
 
 func (Archive) Complete(aerc *widgets.Aerc, args []string) []string {
-	return nil
+	valid := []string{"flat", "year", "month"}
+	return commands.CompletionFromList(valid, args)
 }
 
 func (Archive) Execute(aerc *widgets.Aerc, args []string) error {
xt.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
.TH DWM 1 dwm-0.5
.SH NAME
dwm \- dynamic window manager
.SH SYNOPSIS
.B dwm
.RB [ \-v ]
.SH DESCRIPTION
.B dwm
is a dynamic window manager for X11. It manages windows in tiling and floating
modes. Either mode can be applied dynamically, depending on the application in
use and the task performed.
.P
In tiling mode windows are managed in a master and stacking column. The master
column contains the window which needs most attention at a time, whereas the
stacking column contains all other windows in a stack.  Dialog windows are
managed floating, however. In floating mode windows can be resized and moved
freely.
.P
Windows are grouped by tags. All windows with a specific tag can be viewed at a
time. But each window may contain more than one tag, which makes it visible in
several views.
.P
.B dwm
has a small status bar which reads the text displayed from standard
input, if written. It draws 1-pixel borders around windows to indicate the
focus state. Unfocused windows contain a small bar in front of the window
displaying the tags and the window title.
.SH OPTIONS
.TP
.B \-v
prints version information to standard output, then exits.
.SH USAGE
.TP
.B Mod1-Return
Zoom
.B window
to the 
.B master
column
.TP
.B Mod1-k
Focus previous
.B window
.TP
.B Mod1-j
Focus next
.B window
.TP
.B Mod1-m
Maximize current
.B window
.TP
.B Mod1-[0..n]
Focus
.B nth
tag
.TP
.B Mod1-space
Toggle between
.B tiled
and
.B floating
mode (affects
.BR "all windows" )
.TP
.B Mod1-Shift-[0..n]
Apply
.B nth
tag to current
.B window
.TP
.B Mod1-Shift-q
Quit
.B dwm
.TP
.B Mod1-Shift-Return
Start
.B terminal
.TP
.B Mod1-Control-[0..n]
Append
.B nth
tag to current
.B window
.TP
.B Mod1-Button1
Moves current
.B window
while dragging
.TP
.B Mod1-Button2
Lowers current
.B window
.TP
.B Mod1-Button3
Resizes current
.B window
while dragging
.SH CUSTOMIZATION
.B dwm
is customized through editing config.h of the source code.  This keeps it fast,
secure and simple.