aboutsummaryrefslogtreecommitdiff
path: root/verify.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-05-04 16:48:53 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-05-04 16:48:53 +0200
commit4a7233c2ee6c6d586f3523cdeab43747750833cb (patch)
tree4b401d1814ece0ff9764685704511eff1aec5793 /verify.go
parent7e2b496200d8281f28bb12997d9f8223d25fcb40 (diff)
pass args
Diffstat (limited to 'verify.go')
-rw-r--r--verify.go23
1 files changed, 11 insertions, 12 deletions
diff --git a/verify.go b/verify.go
index 1e35f23..3ea4fea 100644
--- a/verify.go
+++ b/verify.go
@@ -5,7 +5,6 @@ import (
"flag"
"fmt"
"io/ioutil"
- "os"
"dim13.org/signify/file"
"dim13.org/signify/key"
@@ -13,23 +12,23 @@ import (
// Usage: signify -V [-eqz] [-p pubkey] [-t keytype] [-x sigfile] -m message
-func verify() error {
- args := flag.NewFlagSet("verify", flag.ExitOnError)
+func verify(args []string) error {
+ opts := flag.NewFlagSet("verify", flag.ExitOnError)
var (
- embedded = args.Bool("e", false, "Embed message")
- quiet = args.Bool("q", false, "Quiet mode")
- zip = args.Bool("z", false, "Verify gzip archive")
- pubFile = args.String("p", "", "Public key file")
- keyType = args.String("t", "", "Key type") // TODO
- sigFile = args.String("x", "", "Signature file")
- msgFile = args.String("m", "", "Message file (required)")
+ embedded = opts.Bool("e", false, "Embed message")
+ quiet = opts.Bool("q", false, "Quiet mode")
+ zip = opts.Bool("z", false, "Verify gzip archive")
+ pubFile = opts.String("p", "", "Public key file")
+ keyType = opts.String("t", "", "Key type") // TODO
+ sigFile = opts.String("x", "", "Signature file")
+ msgFile = opts.String("m", "", "Message file (required)")
)
- args.Parse(os.Args[2:])
+ opts.Parse(args)
if *embedded && *zip {
return errors.New("can't combine -e and -z options")
}
if *msgFile == "" {
- args.Usage()
+ opts.Usage()
return nil
}
if *sigFile == "" {