Skip to content

Commit 219e381

Browse files
authored
Docs cmd (#67)
1 parent 0923291 commit 219e381

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

cmd/docs.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package cmd
2+
3+
import (
4+
"github.com/pkg/browser"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var docsCmd = &cobra.Command{
9+
Use: "docs",
10+
Short: "Open docs page in browser",
11+
Run: func(cmd *cobra.Command, args []string) {
12+
_ = browser.OpenURL("https://github.com/cloudentity/oauth2c/blob/master/docs/examples.md")
13+
},
14+
}

cmd/oauth2.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func NewOAuth2Cmd() (cmd *OAuth2Cmd) {
4040
cmd.Command.Run = cmd.Run(&cconfig)
4141

4242
cmd.AddCommand(versionCmd)
43+
cmd.AddCommand(docsCmd)
4344

4445
cmd.PersistentFlags().StringVar(&cconfig.RedirectURL, "redirect-url", "http://localhost:9876/callback", "client redirect url")
4546
cmd.PersistentFlags().StringVar(&cconfig.ClientID, "client-id", "", "client identifier")

0 commit comments

Comments
 (0)