You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2019/07/16 15:17:04 UTC
[mynewt-newt] branch master updated: Allow to override path
escaping from command line
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git
The following commit(s) were added to refs/heads/master by this push:
new 65bdd2a Allow to override path escaping from command line
65bdd2a is described below
commit 65bdd2a1792f16a77c816fa7271d3240b29f174a
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Tue Jul 16 16:22:10 2019 +0200
Allow to override path escaping from command line
With this patch it is possible to disable path escaping on Windows.
It looks like some shells on Windows require no escaping.
---
newt/newt.go | 6 ++----
util/util.go | 2 +-
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/newt/newt.go b/newt/newt.go
index d277645..bffe29b 100644
--- a/newt/newt.go
+++ b/newt/newt.go
@@ -91,9 +91,7 @@ func newtCmd() *cobra.Command {
verbosity = util.VERBOSITY_VERBOSE
}
- if newtEscapeShellCmds {
- util.EscapeShellCmds = true
- }
+ util.EscapeShellCmds = newtEscapeShellCmds
var err error
NewtLogLevel, err = log.ParseLevel(logLevelStr)
@@ -128,7 +126,7 @@ func newtCmd() *cobra.Command {
newtCmd.PersistentFlags().BoolVarP(&newtHelp, "help", "h",
false, "Help for newt commands")
newtCmd.PersistentFlags().BoolVarP(&newtEscapeShellCmds, "escape", "",
- false, "Apply Windows escapes to shell commands")
+ runtime.GOOS == "windows", "Apply Windows escapes to shell commands")
versHelpText := cli.FormatHelp(`Display the Newt version number`)
versHelpEx := " newt version"
diff --git a/util/util.go b/util/util.go
index 4318b82..b703f25 100644
--- a/util/util.go
+++ b/util/util.go
@@ -43,7 +43,7 @@ import (
var Verbosity int
var PrintShellCmds bool
var ExecuteShell bool
-var EscapeShellCmds bool = runtime.GOOS == "windows"
+var EscapeShellCmds bool
var logFile *os.File
func ParseEqualsPair(v string) (string, string, error) {