cli; mention 'save' as a possible action with 'config' command. 105/head
authorMarko Kiiskila <marko@runtime.io>
Mon, 1 Oct 2018 08:43:17 +0000 (11:43 +0300)
committerMarko Kiiskila <marko@runtime.io>
Mon, 1 Oct 2018 08:43:17 +0000 (11:43 +0300)
newtmgr/cli/config.go

index d860839..f91337e 100644 (file)
@@ -106,12 +106,17 @@ func configRunCmd(cmd *cobra.Command, args []string) {
 
 func configCmd() *cobra.Command {
        configCmdLongHelp := "Read or write a config value for <var-name> variable on " +
-               "a device.\nSpecify a var-value to write a value to a device.\n"
+               "a device.\nSpecify a var-value to write a value to a device.\n" +
+               "To persist existing configuration use 'save' as the var-name.\n"
+       configEx := "    " + nmutil.ToolInfo.ExeName + " -c olimex config test/8\n"
+       configEx += "    " + nmutil.ToolInfo.ExeName + " -c olimex config test/8 1\n"
+       configEx += "    " + nmutil.ToolInfo.ExeName + " -c olimex config save\n"
        configCmd := &cobra.Command{
-               Use:   "config <var-name> [var-value] -c <conn_profile>",
-               Short: "Read or write a config value on a device",
-               Long:  configCmdLongHelp,
-               Run:   configRunCmd,
+               Use:     "config <var-name> [var-value] -c <conn_profile>",
+               Short:   "Read or write a config value on a device",
+               Long:    configCmdLongHelp,
+               Example: configEx,
+               Run:     configRunCmd,
        }
 
        return configCmd