# HG changeset patch # User Mikael Berthe # Date 1494625695 -7200 # Node ID 2b4d0f198a940697d43af2cd4e02dd734d9b4076 # Parent 7d712d2bde73b8d77ff8aa3716f45d2700041789 Update online documention to config and oauth2 commands diff -r 7d712d2bde73 -r 2b4d0f198a94 cmd/config.go --- a/cmd/config.go Fri May 12 23:31:21 2017 +0200 +++ b/cmd/config.go Fri May 12 23:48:15 2017 +0200 @@ -18,6 +18,16 @@ var configCmd = &cobra.Command{ Use: "config", Short: "Display configuration", + Long: `Display configuration + +Display current configuration. You can use this command to generate an +initial configuration file (see the examples below). + +This command is disabled if the safe_mode setting is set to true in the +configuration file.`, + Example: ` madonctl config dump -i INSTANCE -L USERNAME -P PASS > config.yaml + madonctl whoami + madonctl whoami --template '{{.access_token}}'`, } func init() { @@ -29,8 +39,9 @@ var configSubcommands = []*cobra.Command{ &cobra.Command{ - Use: "dump", - Short: "Dump the configuration", + Use: "dump", + Short: "Dump the configuration", + Example: ` madonctl config dump -i INSTANCE -L USERNAME -P PASS > config.yaml`, RunE: func(cmd *cobra.Command, args []string) error { return configDump() }, diff -r 7d712d2bde73 -r 2b4d0f198a94 cmd/oauth2.go --- a/cmd/oauth2.go Fri May 12 23:31:21 2017 +0200 +++ b/cmd/oauth2.go Fri May 12 23:48:15 2017 +0200 @@ -17,9 +17,11 @@ var oauth2Cmd = &cobra.Command{ Use: "oauth2", Short: "OAuth2 authentication/authorization", - Example: ` madonctl oauth2 # Interactive OAuth2 login - madonctl oauth2 get-url # Display OAuth2 auhtorization URL - madonctl oauth2 code CODE # Enter OAuth2 code`, + Example: ` madonctl oauth2 # Interactive OAuth2 login + madonctl oauth2 get-url # Display OAuth2 auhtorization URL + madonctl oauth2 code CODE # Enter OAuth2 code + + madonctl oauth2 > config.yaml # Redirect to configuration file`, RunE: func(cmd *cobra.Command, args []string) error { return oAuth2Interactive(args) },