(command string)
| 127 | } |
| 128 | |
| 129 | func ParseBase(command string) (string, string) { |
| 130 | tokens := strings.Fields(strings.TrimSpace(command)) |
| 131 | if len(tokens) == 0 { |
| 132 | return "", "" |
| 133 | } |
| 134 | |
| 135 | base := tokens[0] |
| 136 | if idx := strings.LastIndex(base, "/"); idx >= 0 { |
| 137 | base = base[idx+1:] |
| 138 | } |
| 139 | |
| 140 | sub := "" |
| 141 | if len(tokens) > 1 && !strings.HasPrefix(tokens[1], "-") { |
| 142 | sub = tokens[1] |
| 143 | } |
| 144 | |
| 145 | return base, sub |
| 146 | } |
| 147 | func IsSearchOrReadBashCommand(commandLine string) bool { |
| 148 | segments := SplitPipeline(commandLine) |
| 149 | meaningfulSegments := 0 |
no outgoing calls
no test coverage detected