fix flag parsing
This commit is contained in:
parent
f46e11257b
commit
94f22e1948
|
@ -0,0 +1,5 @@
|
||||||
|
/keypairs
|
||||||
|
/dist/
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
.*.sw*
|
|
@ -18,11 +18,15 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// gen subcommand
|
||||||
|
args := os.Args[2:]
|
||||||
|
|
||||||
var privname string
|
var privname string
|
||||||
var pubname string
|
var pubname string
|
||||||
flag.StringVar(&privname, "o", "", "private key file (should have .jwk.json or pkcs8.pem extension)")
|
flags := flag.NewFlagSet("gen", flag.ExitOnError)
|
||||||
flag.StringVar(&pubname, "pub", "", "public key file (should have .jwk.json or spki.pem extension)")
|
flags.StringVar(&privname, "o", "", "private key file (should have .jwk.json or pkcs8.pem extension)")
|
||||||
flag.Parse()
|
flags.StringVar(&pubname, "pub", "", "public key file (should have .jwk.json or spki.pem extension)")
|
||||||
|
flags.Parse(args)
|
||||||
|
|
||||||
priv := keypairs.NewDefaultPrivateKey()
|
priv := keypairs.NewDefaultPrivateKey()
|
||||||
marshalPriv(priv, privname)
|
marshalPriv(priv, privname)
|
||||||
|
|
Loading…
Reference in New Issue