summary refs log tree commit diff stats
path: root/aerc.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-06-18 09:42:41 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-13 12:46:34 -0400
commit61a9e72f4c7276771d4ae966918358c27b90bc23 (patch)
treeb45c75f31c5b6ffecc91787c80d9faf17452cfce /aerc.go
parentb34242560e361d0fd73a9f49e4be7052b96cde5e (diff)
downloadaerc-61a9e72f4c7276771d4ae966918358c27b90bc23.tar.gz
Add aerc -v to print the installed version 0.1.3
Diffstat (limited to 'aerc.go')
-rw-r--r--aerc.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/aerc.go b/aerc.go
index ffce931..20e2bb1 100644
--- a/aerc.go
+++ b/aerc.go
@@ -8,6 +8,7 @@ import (
 	"os"
 	"time"
 
+	"git.sr.ht/~sircmpwn/getopt"
 	"github.com/mattn/go-isatty"
 
 	"git.sr.ht/~sircmpwn/aerc/commands"
@@ -53,9 +54,26 @@ func getCommands(selected libui.Drawable) []*commands.Commands {
 var (
 	Prefix   string
 	ShareDir string
+	Version  string
 )
 
 func main() {
+	// TODO: Support starting with mailto links, ad-hoc accounts, etc
+	opts, optind, err := getopt.Getopts(os.Args, "v")
+	if err != nil {
+		panic(err)
+	}
+	for _, opt := range opts {
+		switch opt.Option {
+		case 'v':
+			fmt.Println("aerc " + Version)
+			return
+		}
+	}
+	if optind != len(os.Args) {
+		log.Fatal("Usage: aerc [-v]")
+	}
+
 	var (
 		logOut io.Writer
 		logger *log.Logger
ef2d489e5071f4e6d7223a33cb3b3'>^
5c210a96 ^

3de15ddd ^

5c210a96 ^
fb275079 ^

5c210a96 ^
3d566884 ^
a1d7ed6e ^
3d566884 ^
f8e96a97 ^
465bff73 ^





f027adc0 ^
f8e96a97 ^

0b5c4cbe ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43