Conversation
| m.refreshContent() | ||
| case "tabclose": | ||
| if m.tabIndex == 0 { | ||
| // TODO print something |
There was a problem hiding this comment.
I don't think bubbletea has toast support but would be nice to print "can't close the main tab" or something like that
dev/sg/tail/model.go
Outdated
| }, nil | ||
| case "grep": | ||
| if len(parts[1:]) < 1 { | ||
| return nil, errors.Newf("drop requires at least one arguments") |
There was a problem hiding this comment.
| return nil, errors.Newf("drop requires at least one arguments") | |
| return nil, errors.Newf("grep requires at least one argument") |
| return "" | ||
| } | ||
|
|
||
| func max(a, b int) int { |
There was a problem hiding this comment.
golang has builtin max now :D
There was a problem hiding this comment.
Yeah but it's f64, so I'd rather do this than dealing with the conversion ^^
dev/sg/tail/model.go
Outdated
| func (m model) Init() tea.Cmd { | ||
| return tea.Batch( | ||
| showUsage(), | ||
| listenUnixSocket(m.l, m.ch), |
There was a problem hiding this comment.
This panics when it can't connect. Should it not rather post activityMsg with the error that it could not connect?
There was a problem hiding this comment.
We're on the listener side, so if we can't even create the unix socket for others to connect onto it, we'd better quit right away. I'll check if at least I can make it not panicking though.
There was a problem hiding this comment.
Ah, need to make it possible to bubble errors from a tea.Cmd, I'll do that on another iteration, I don't want to spend more time on this today.
burmudar
left a comment
There was a problem hiding this comment.
Nothing really blocking 🙌🏼
This PR brings back https://github.com/sourcegraph/sgtail back in
sg, plus a few adjustments to make it easier to use. I'll archive that repo once this PR lands.@camdencheek mentioned you here as you've been the most recent beta tester, it's more an FYI than a request for a review, though it's welcome if you want to spend a bit of time reading this.
Closes DINF-155
Test plan
Locally tested + new unit test + CI
Changelog
sg tailcommand that provides a better UI to tail and filter log messages fromsg start --tail.