Codebase list golang-github-anmitsu-go-shlex / b14559d
Update upstream source from tag 'upstream/0.0_git20200514.38f4b40' Update to upstream version '0.0~git20200514.38f4b40' with Debian dir be6364c60212a0975e895af7ea9c2cedeeecb31f Shengjing Zhu 6 years ago
4 changed file(s) with 10 addition(s) and 46 deletion(s). Raw diff Collapse all Expand all
00 shlex.test
1
2 .pc
3030 }
3131 }
3232 ```
33 output
34
35 cp
36 -Rdp
37 file name
38 file name2
39 dir name
3340
3441 ## Documentation
3542
44 "log"
55
66 "github.com/anmitsu/go-shlex"
7 flynn_shlex "github.com/flynn/go-shlex"
87 )
98
109 func ExampleSplit() {
5453 // dir\
5554 // name
5655 }
57
58 func ExampleSplit_compareFlynn() {
59 cmd := `English and 日本語`
60
61 // Split for github.com/flynn/go-shlex imported as flynn_shlex
62 words_flynn, err1 := flynn_shlex.Split(cmd)
63
64 // Split for github.com/anmitsu/go-shlex
65 words_anmitsu, err2 := shlex.Split(cmd, true)
66
67 fmt.Println("Source string:")
68 fmt.Println(cmd)
69 fmt.Println()
70
71 fmt.Println("Result of github.com/flynn/go-shlex:")
72 for _, word := range words_flynn {
73 fmt.Println(word)
74 }
75 fmt.Println(err1.Error())
76
77 fmt.Println()
78 fmt.Println("Result of github.com/anmitsu/go-shlex:")
79 for _, word := range words_anmitsu {
80 fmt.Println(word)
81 }
82 if err2 != nil {
83 fmt.Println(err2.Error())
84 }
85
86 // Output:
87 // Source string:
88 // English and 日本語
89 //
90 // Result of github.com/flynn/go-shlex:
91 // English
92 // and
93 // Unknown rune: 26085
94 //
95 // Result of github.com/anmitsu/go-shlex:
96 // English
97 // and
98 // 日本語
99 }
0 module github.com/anmitsu/go-shlex
1
2 go 1.13