-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.go
51 lines (42 loc) · 1.2 KB
/
options.go
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
44
45
46
47
48
49
50
51
package main
import (
"flag"
"fmt"
)
type cliOptions struct {
generate bool
sign bool
verify bool
version bool
secKey string
pubKey string
fout string
fin string
cmt string
nopp bool
pp string
help bool
}
var cliOpt cliOptions
func parseCliOptions() {
flag.BoolVar(&cliOpt.generate, "G", false, "Generate")
flag.BoolVar(&cliOpt.sign, "S", false, "Sign")
flag.BoolVar(&cliOpt.verify, "V", false, "Verify")
flag.BoolVar(&cliOpt.version, "v", false, "Version")
flag.StringVar(&cliOpt.secKey, "s", "", "secret key")
flag.StringVar(&cliOpt.pubKey, "p", "", "public key")
flag.StringVar(&cliOpt.fout, "fout", "", "file out")
flag.StringVar(&cliOpt.fin, "fin", "", "file in")
flag.StringVar(&cliOpt.cmt, "c", "", "comment")
flag.BoolVar(&cliOpt.nopp, "n", false, "don't ask for passphrase, read from stdin")
flag.StringVar(&cliOpt.pp, "passphrase", "", "passphrase")
flag.BoolVar(&cliOpt.help, "h", false, "print help")
flag.Parse()
}
func helpText() {
fmt.Println(`
signify-gzip -G [-n] [-c comment] -p pubkey -s seckey
signify-gzip -S [-n] [-passphrase phrase] -s seckey -fin input-file -fout output-file
signify-gzip -V [-q] -p pubkey -fin input-file
`)
}