LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "bufio" | 8 "bufio" |
9 "bytes" | 9 "bytes" |
10 "container/heap" | 10 "container/heap" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 ext = dotExt[1:] | 197 ext = dotExt[1:] |
198 } | 198 } |
199 return | 199 return |
200 } | 200 } |
201 | 201 |
202 type stringsFlag []string | 202 type stringsFlag []string |
203 | 203 |
204 func (v *stringsFlag) Set(s string) error { | 204 func (v *stringsFlag) Set(s string) error { |
205 var err error | 205 var err error |
206 *v, err = splitQuotedFields(s) | 206 *v, err = splitQuotedFields(s) |
| 207 if *v == nil { |
| 208 *v = []string{} |
| 209 } |
207 return err | 210 return err |
208 } | 211 } |
209 | 212 |
210 func splitQuotedFields(s string) ([]string, error) { | 213 func splitQuotedFields(s string) ([]string, error) { |
211 // Split fields allowing '' or "" around elements. | 214 // Split fields allowing '' or "" around elements. |
212 // Quotes further inside the string do not count. | 215 // Quotes further inside the string do not count. |
213 var f []string | 216 var f []string |
214 for len(s) > 0 { | 217 for len(s) > 0 { |
215 for len(s) > 0 && isSpaceByte(s[0]) { | 218 for len(s) > 0 && isSpaceByte(s[0]) { |
216 s = s[1:] | 219 s = s[1:] |
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 func defaultSuffix() string { | 2514 func defaultSuffix() string { |
2512 switch runtime.GOOS { | 2515 switch runtime.GOOS { |
2513 case "windows": | 2516 case "windows": |
2514 return ".bat" | 2517 return ".bat" |
2515 case "plan9": | 2518 case "plan9": |
2516 return ".rc" | 2519 return ".rc" |
2517 default: | 2520 default: |
2518 return ".bash" | 2521 return ".bash" |
2519 } | 2522 } |
2520 } | 2523 } |
LEFT | RIGHT |