detectFileDump checks whether the command matches a file-dump pattern and returns an advisory note, or empty string if no match.
(command string)
| 368 | // pattern and returns an advisory note, or empty string if no |
| 369 | // match. |
| 370 | func detectFileDump(command string) string { |
| 371 | for _, pat := range fileDumpPatterns { |
| 372 | if pat.MatchString(command) { |
| 373 | return "Consider using read_file instead of " + |
| 374 | "dumping file contents with shell commands." |
| 375 | } |
| 376 | } |
| 377 | return "" |
| 378 | } |
| 379 | |
| 380 | const ( |
| 381 | // defaultProcessOutputTimeout is the default time the |