Skip to content

Commit

Permalink
feat: add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mehditeymorian committed Aug 31, 2022
1 parent 41ff9fc commit f9a0a5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions internal/cmd/decode/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import (

func Decode() *cobra.Command {
command := &cobra.Command{
Use: "decode",
Short: "decode jwt token",
Long: "decode jwt token",
Run: decode,
Use: "decode",
Short: "decode jwt token",
Long: "decode jwt token",
Example: "jwt decode <TOKEN>",
Run: decode,
}

return command
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/encode/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (

func Encode() *cobra.Command {
root := &cobra.Command{ //nolint:exhaustivestruct
Use: "encode",
Short: "Create JWT Token",
Long: "Create JWT Token",
Run: main,
Use: "encode",
Short: "Create JWT Token",
Example: `jwt encode -e 2h -s finance -i "jwt-cli" -a people -A RS512`,
Run: main,
}
root.Flags().StringP("expiration", "e", "1h", "token expires after how long")
root.Flags().StringP("subject", "s", "", "token subject")
Expand Down

0 comments on commit f9a0a5c

Please sign in to comment.