cmd/oauth2.go
changeset 127 2b4d0f198a94
parent 113 2e411da68fd3
child 185 564d92b54b00
equal deleted inserted replaced
126:7d712d2bde73 127:2b4d0f198a94
    15 )
    15 )
    16 
    16 
    17 var oauth2Cmd = &cobra.Command{
    17 var oauth2Cmd = &cobra.Command{
    18 	Use:   "oauth2",
    18 	Use:   "oauth2",
    19 	Short: "OAuth2 authentication/authorization",
    19 	Short: "OAuth2 authentication/authorization",
    20 	Example: `  madonctl oauth2           # Interactive OAuth2 login
    20 	Example: `  madonctl oauth2                 # Interactive OAuth2 login
    21   madonctl oauth2 get-url   # Display OAuth2 auhtorization URL
    21   madonctl oauth2 get-url         # Display OAuth2 auhtorization URL
    22   madonctl oauth2 code CODE # Enter OAuth2 code`,
    22   madonctl oauth2 code CODE       # Enter OAuth2 code
       
    23 
       
    24   madonctl oauth2 > config.yaml   # Redirect to configuration file`,
    23 	RunE: func(cmd *cobra.Command, args []string) error {
    25 	RunE: func(cmd *cobra.Command, args []string) error {
    24 		return oAuth2Interactive(args)
    26 		return oAuth2Interactive(args)
    25 	},
    27 	},
    26 	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
    28 	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
    27 		// Initialize application; do not log in yet
    29 		// Initialize application; do not log in yet