Skip to content

Commit

Permalink
Merge pull request #162 from hengyoush/157-caught-panic-when-input-ky…
Browse files Browse the repository at this point in the history
…anos-watch-ssh

157 caught panic when input kyanos watch ssh
  • Loading branch information
hengyoush authored Dec 11, 2024
2 parents cecce79 + 437adf9 commit be7abcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion agent/render/watch/watch_render.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
"[Request]\n\n" + c.TruncateString(r.Req.FormatToString(), m.options.MaxRecordContentDisplayBytes) + "\n" + line +
"\n[Response]\n\n" + c.TruncateString(r.Resp.FormatToString(), m.options.MaxRecordContentDisplayBytes))
} else {
panic("!")
m.chosen = false
break
}
}
return m, nil
Expand Down
6 changes: 5 additions & 1 deletion cmd/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

var maxRecords int
var supportedProtocols = []string{"http", "redis", "mysql"}
var watchCmd = &cobra.Command{
Use: "watch [http|redis|mysql] [flags]",
Example: `
Expand All @@ -23,8 +24,11 @@ sudo kyanos watch mysql --latency 100 --req-size 1024 --resp-size 2048
logger.Errorln(err)
} else {
if list {
fmt.Println([]string{"http", "redis", "mysql"})
fmt.Println(supportedProtocols)
} else {
if len(args) > 0 {
logger.Fatalln("current only support:", supportedProtocols)
}
options.LatencyFilter = initLatencyFilter(cmd)
options.SizeFilter = initSizeFilter(cmd)
startAgent()
Expand Down

0 comments on commit be7abcd

Please sign in to comment.