Skip to content

Commit

Permalink
fix: userkey create description and help usage
Browse files Browse the repository at this point in the history
Also returns a more user-friendly error message when the user doesn't exist
  • Loading branch information
libvoid committed Sep 7, 2023
1 parent 2a27cce commit e8fd4f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/bastion/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -2105,8 +2105,8 @@ GLOBAL OPTIONS:
{
Name: "create",
ArgsUsage: "<user ID or email>",
Usage: "Creates a new userkey",
Description: "$> userkey create bob\n $> user create --name=mykey bob",
Usage: "Creates a new userkey for an existing user",
Description: "$> userkey create bob",
Flags: []cli.Flag{
cli.StringFlag{Name: "comment", Usage: "Adds a comment"},
},
Expand All @@ -2121,7 +2121,7 @@ GLOBAL OPTIONS:

var user dbmodels.User
if err := dbmodels.UsersByIdentifiers(db, c.Args()).First(&user).Error; err != nil {
return err
return fmt.Errorf("User %s does not exist ", c.Args().First())
}

var reader *bufio.Reader
Expand Down

0 comments on commit e8fd4f7

Please sign in to comment.