mirror of
https://github.com/rancher/os.git
synced 2025-09-19 00:59:53 +00:00
Merge pull request #315 from imikushin/update-shlex
update shlex to fix command parsing by rancher-compose
This commit is contained in:
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
@@ -147,7 +147,7 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/flynn/go-shlex",
|
||||
"Rev": "70644ac2a65dbf1691ce00c209d185163a14edc6"
|
||||
"Rev": "3f9db97f856818214da2e1057f8ad84803971cff"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/fsouza/go-dockerclient",
|
||||
|
8
Godeps/_workspace/src/github.com/flynn/go-shlex/shlex.go
generated
vendored
8
Godeps/_workspace/src/github.com/flynn/go-shlex/shlex.go
generated
vendored
@@ -60,7 +60,7 @@ func (a *Token) Equal(b *Token) bool {
|
||||
}
|
||||
|
||||
const (
|
||||
RUNE_CHAR string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-,/@$*()+=><:;&^%~|!?[]"
|
||||
RUNE_CHAR string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-,/@$*()+=><:;&^%~|!?[]{}"
|
||||
RUNE_SPACE string = " \t\r\n"
|
||||
RUNE_ESCAPING_QUOTE string = "\""
|
||||
RUNE_NONESCAPING_QUOTE string = "'"
|
||||
@@ -347,7 +347,7 @@ SCAN:
|
||||
err = errors.New("EOF found when expecting closing quote.")
|
||||
break SCAN
|
||||
}
|
||||
case RUNETOKEN_CHAR, RUNETOKEN_SPACE, RUNETOKEN_NONESCAPING_QUOTE, RUNETOKEN_COMMENT:
|
||||
case RUNETOKEN_CHAR, RUNETOKEN_UNKNOWN, RUNETOKEN_SPACE, RUNETOKEN_NONESCAPING_QUOTE, RUNETOKEN_COMMENT:
|
||||
{
|
||||
value = append(value, nextRune)
|
||||
}
|
||||
@@ -373,7 +373,7 @@ SCAN:
|
||||
err = errors.New("EOF found when expecting closing quote.")
|
||||
break SCAN
|
||||
}
|
||||
case RUNETOKEN_CHAR, RUNETOKEN_SPACE, RUNETOKEN_ESCAPING_QUOTE, RUNETOKEN_ESCAPE, RUNETOKEN_COMMENT:
|
||||
case RUNETOKEN_CHAR, RUNETOKEN_UNKNOWN, RUNETOKEN_SPACE, RUNETOKEN_ESCAPING_QUOTE, RUNETOKEN_ESCAPE, RUNETOKEN_COMMENT:
|
||||
{
|
||||
value = append(value, nextRune)
|
||||
}
|
||||
@@ -394,7 +394,7 @@ SCAN:
|
||||
{
|
||||
break SCAN
|
||||
}
|
||||
case RUNETOKEN_CHAR, RUNETOKEN_ESCAPING_QUOTE, RUNETOKEN_ESCAPE, RUNETOKEN_COMMENT, RUNETOKEN_NONESCAPING_QUOTE:
|
||||
case RUNETOKEN_CHAR, RUNETOKEN_UNKNOWN, RUNETOKEN_ESCAPING_QUOTE, RUNETOKEN_ESCAPE, RUNETOKEN_COMMENT, RUNETOKEN_NONESCAPING_QUOTE:
|
||||
{
|
||||
value = append(value, nextRune)
|
||||
}
|
||||
|
8
Godeps/_workspace/src/github.com/flynn/go-shlex/shlex_test.go
generated
vendored
8
Godeps/_workspace/src/github.com/flynn/go-shlex/shlex_test.go
generated
vendored
@@ -110,8 +110,8 @@ func TestSplitSimple(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSplitEscapingQuotes(t *testing.T) {
|
||||
testInput := "one \"two three\" four"
|
||||
expectedOutput := []string{"one", "two three", "four"}
|
||||
testInput := "one \"два ${three}\" four"
|
||||
expectedOutput := []string{"one", "два ${three}", "four"}
|
||||
foundOutput, err := Split(testInput)
|
||||
if err != nil {
|
||||
t.Error("Split returned error:", err)
|
||||
@@ -145,8 +145,8 @@ func TestGlobbingExpressions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSplitNonEscapingQuotes(t *testing.T) {
|
||||
testInput := "one 'two three' four"
|
||||
expectedOutput := []string{"one", "two three", "four"}
|
||||
testInput := "one 'два ${three}' four"
|
||||
expectedOutput := []string{"one", "два ${three}", "four"}
|
||||
foundOutput, err := Split(testInput)
|
||||
if err != nil {
|
||||
t.Error("Split returned error:", err)
|
||||
|
Reference in New Issue
Block a user