You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2015/11/21 00:30:24 UTC

incubator-mynewt-newt git commit: Sort target fields in 'target show' output.

Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/master af00aad0f -> 38dc3a5ee


Sort target fields in 'target show' output.


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/38dc3a5e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/38dc3a5e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/38dc3a5e

Branch: refs/heads/master
Commit: 38dc3a5ee6d196e1b63544b84a17aeed3eef8232
Parents: af00aad
Author: Christopher Collins <cc...@gmail.com>
Authored: Fri Nov 20 15:30:04 2015 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Fri Nov 20 15:30:04 2015 -0800

----------------------------------------------------------------------
 newt.go | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/38dc3a5e/newt.go
----------------------------------------------------------------------
diff --git a/newt.go b/newt.go
index 5331039..02b32a5 100644
--- a/newt.go
+++ b/newt.go
@@ -150,9 +150,16 @@ func targetShowCmd(cmd *cobra.Command, args []string) {
 	for _, target := range targets {
 		if dispSect == "" || dispSect == target.Vars["name"] {
 			cli.StatusMessage(cli.VERBOSITY_QUIET, target.Vars["name"]+"\n")
+
 			vars := target.GetVars()
-			for k, v := range vars {
-				cli.StatusMessage(cli.VERBOSITY_QUIET, "	%s: %s\n", k, v)
+			var keys []string
+			for k := range vars {
+				keys = append(keys, k)
+			}
+
+			sort.Strings(keys)
+			for _, k := range keys {
+				cli.StatusMessage(cli.VERBOSITY_QUIET, "	%s: %s\n", k, vars[k])
 			}
 		}
 	}