--- 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()
},
--- 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)
},