Skip to content

Commit

Permalink
modified: cmd/ssh-vault/main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
nbari committed Feb 2, 2017
1 parent ceabaad commit 088564e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/ssh-vault/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func main() {
os.Exit(0)
}

if flag.NArg() < 1 && !*f {
exit1(fmt.Errorf("Missing option, use (\"%s -h\") for help.\n", os.Args[0]))
}

usr, _ := user.Current()
if len(*k) > 2 {
if (*k)[:2] == "~/" {
Expand All @@ -54,12 +58,12 @@ func main() {

vault, err := sv.New(*k, *u, flag.Arg(0), flag.Arg(1))
if err != nil {
exit1(fmt.Errorf("%s, use (\"%s -h\") for help.\n", os.Args[0]))
exit1(err)
}

// ssh-keygen -f id_rsa.pub -e -m PKCS8
if err := vault.PKCS8(); err != nil {
exit1(fmt.Errorf("%s, use (\"%s -h\") for help.\n", os.Args[0]))
exit1(err)
}

// print fingerprint and exit
Expand All @@ -68,9 +72,6 @@ func main() {
os.Exit(0)
}

if flag.NArg() < 1 {
exit1(fmt.Errorf("Missing option, use (\"%s -h\") for help.\n", os.Args[0]))
}
// check options
exit := true
for _, v := range options {
Expand Down

0 comments on commit 088564e

Please sign in to comment.