| 166 | } |
| 167 | |
| 168 | func extractFindPaths(tokens []string) []string { |
| 169 | paths := []string{} |
| 170 | |
| 171 | for _, t := range tokens { |
| 172 | if t == "--" { |
| 173 | continue |
| 174 | } |
| 175 | |
| 176 | if strings.HasPrefix(t, "-") && t != "-print" && t != "-print0" { |
| 177 | if _, err := strconv.ParseFloat(t, 64); err == nil { |
| 178 | paths = append(paths, t) |
| 179 | continue |
| 180 | } |
| 181 | break |
| 182 | } |
| 183 | |
| 184 | if !strings.HasPrefix(t, "-") { |
| 185 | paths = append(paths, t) |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | return paths |
| 190 | } |
| 191 | |
| 192 | func extractGrepPaths(tokens []string) []string { |
| 193 | paths := []string{} |