(command string, exitCode int, stdout, stderr string)
| 19 | } |
| 20 | |
| 21 | func (n *Notes) AddCommand(command string, exitCode int, stdout, stderr string) { |
| 22 | msg := fmt.Sprintf("$ %s", strings.TrimSpace(command)) |
| 23 | if exitCode != 0 { |
| 24 | msg += fmt.Sprintf("\nexit %d", exitCode) |
| 25 | } |
| 26 | if strings.TrimSpace(stdout) != "" { |
| 27 | msg += fmt.Sprintf("\n%s", stdout) |
| 28 | } |
| 29 | if strings.TrimSpace(stderr) != "" { |
| 30 | msg += fmt.Sprintf("\nstderr: %s", stderr) |
| 31 | } |
| 32 | |
| 33 | n.Add("%s", msg) |
| 34 | } |
| 35 | |
| 36 | func (n *Notes) Clear() { |
| 37 | n.mu.Lock() |
no test coverage detected