Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 0dfde15fb -> 7a7b63871


MYNEWT-519 img_mgmt - Allow test+confirm as 1 act


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/7a7b6387
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/7a7b6387
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/7a7b6387

Branch: refs/heads/develop
Commit: 7a7b638716f7a83d05ea11d13dc26e07a9e8d714
Parents: 0dfde15
Author: Christopher Collins <[email protected]>
Authored: Wed Dec 21 10:50:56 2016 -0800
Committer: Christopher Collins <[email protected]>
Committed: Wed Dec 21 10:50:56 2016 -0800

----------------------------------------------------------------------
 newtmgr/cli/image.go | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7a7b6387/newtmgr/cli/image.go
----------------------------------------------------------------------
diff --git a/newtmgr/cli/image.go b/newtmgr/cli/image.go
index f4a200e..47bcb9e 100644
--- a/newtmgr/cli/image.go
+++ b/newtmgr/cli/image.go
@@ -168,6 +168,10 @@ func imageStateConfirmCmd(cmd *cobra.Command, args 
[]string) {
                nmUsage(nil, err)
        }
 
+       if len(args) >= 1 {
+               hexBytes, _ := hex.DecodeString(args[0])
+               req.Hash = hexBytes
+       }
        req.Confirm = true
 
        nmr, err := req.Encode()
@@ -691,9 +695,12 @@ func imageCmd() *cobra.Command {
        imageCmd.AddCommand(testCmd)
 
        confirmCmd := &cobra.Command{
-               Use:   "confirm",
-               Short: "Confirm current image setup",
-               Run:   imageStateConfirmCmd,
+               Use:   "confirm [hex-image-hash]",
+               Short: "Permanently run image",
+               Long: "If a hash is specified, permanently switch to the " +
+                       "corresponding image.  If no hash is specified, the 
current " +
+                       "image setup is made permanent.",
+               Run: imageStateConfirmCmd,
        }
        imageCmd.AddCommand(confirmCmd)
 

Reply via email to