This is an automated email from the ASF dual-hosted git repository. ccollins pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git
commit b558e21a7f49b893aca1edfc7f0c2a84f686936f Author: Christopher Collins <ccoll...@apache.org> AuthorDate: Mon Jan 27 10:33:36 2020 -0800 `newt version`: Print all details on one line The `newt version` output was spread over three lines. Putting all the output on a single line makes it easier for users to report their version number in slack or email. --- newt/newt.go | 6 +----- newt/newtutil/newtutil.go | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/newt/newt.go b/newt/newt.go index bffe29b..2c1fd6c 100644 --- a/newt/newt.go +++ b/newt/newt.go @@ -20,7 +20,6 @@ package main import ( - "fmt" "os" "runtime" @@ -136,10 +135,7 @@ func newtCmd() *cobra.Command { Long: versHelpText, Example: versHelpEx, Run: func(cmd *cobra.Command, args []string) { - fmt.Printf("Apache Newt\n") - fmt.Printf(" Version: %s\n", newtutil.NewtVersionStr) - fmt.Printf(" Git Hash: %s\n", newtutil.NewtGitHash) - fmt.Printf("Build Date: %s\n", newtutil.NewtDate) + newtutil.PrintNewtVersion() }, } diff --git a/newt/newtutil/newtutil.go b/newt/newtutil/newtutil.go index 7037338..7dcd91c 100644 --- a/newt/newtutil/newtutil.go +++ b/newt/newtutil/newtutil.go @@ -185,3 +185,8 @@ func ProjRelPath(path string) string { proj := interfaces.GetProject() return strings.TrimPrefix(path, proj.Path()+"/") } + +func PrintNewtVersion() { + util.StatusMessage(util.VERBOSITY_DEFAULT, "Apache Newt %s / %s / %s\n", + NewtVersionStr, NewtGitHash, NewtDate) +}