Skip to content

Commit

Permalink
feat: add auth show command to print login details (#109)
Browse files Browse the repository at this point in the history
Co-authored-by: Robin Trietsch <robin@strmprivacy.io>
  • Loading branch information
trietsch and trietsch authored Aug 17, 2022
1 parent 1da95a4 commit b03e18c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/auth/cmd.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package auth

import (
"fmt"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -59,3 +60,16 @@ func PrintTokenCmd() *cobra.Command {
}
return cmd
}

func ShowCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "show",
Short: "Show your current login credentials",
Long: `Show the email address of your current login credentials`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(fmt.Sprintf("Currently logged in as [%v]", Auth.Email))
},
DisableAutoGenTag: true,
}
return cmd
}
1 change: 1 addition & 0 deletions pkg/cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ func init() {
AuthCmd.AddCommand(auth.LoginCmd())
AuthCmd.AddCommand(auth.RevokeCmd())
AuthCmd.AddCommand(auth.PrintTokenCmd())
AuthCmd.AddCommand(auth.ShowCmd())
}

0 comments on commit b03e18c

Please sign in to comment.