Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/device/ros/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
hiddenPrompt = `(?P<hidden>\[\S+@\S+\]\s{1,2}(\/[\/\w\s-]+)?(<SAFE)?>\s+)?`
visiblePrompt = `\[(?P<login>\S+)@(?P<hostname>\S+)\]\s{1,2}(?P<cfg_path>\/[\/\w\s-]+)?(<(?P<safe_mode>SAFE))?> $`
promptExpression = `(?P<store>(\r\n|\n|\r|^))` + visiblePrompt
errorExpression = `(\r|^)(bad command name.*\(line \d+ column \d+\).*($|\r)|syntax error.*\(line \d+ column \d+\).*$|\[(?P<question>Safe mode released by another user)\]|expected end of command \(line \d+ column \d+\)|expected command name \(line \d+ column \d+\)|failure: duplicate address)`
errorExpression = `(\r|^)(bad command name.*\(line \d+ column \d+\).*($|\r)|syntax error.*\(line \d+ column \d+\).*$|\[(?P<question>Safe mode released by another user)\]|expected end of command \(line \d+ column \d+\)|expected command name \(line \d+ column \d+\)|failure: duplicate address|failure: item with this name already exists)`
questionExpression = `((?P<question>.+\?)\s*\[y/N\]: \r\n$|(?P<question>\x1b\[c)|\rnumbers: )`
pagerExpression = `-- \[Q quit\|D dump\|(right\|)?(up\|)?down\]$`
)
Expand Down
1 change: 1 addition & 0 deletions pkg/device/ros/device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestErrors(t *testing.T) {
[]byte("failure: duplicate address"),
[]byte("\rbad command name set (line 1 column 1)"),
[]byte("expected command name (line 1 column 8)"),
[]byte("failure: item with this name already exists"),
}
testutils.ExprTester(t, cases, errorExpression)
}
Expand Down
Loading