diff options
| author | Castor Regex <[email protected]> | 2025-08-25 10:15:39 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-25 10:15:39 -0500 |
| commit | 0b2ec9ce15cf17f12c6457396a9579d943115d67 (patch) | |
| tree | 1f64f1f424496a930ee8fa2698fdecc19b36005e | |
| parent | c39a2f31e65f6931b6752e89c9566613e8993c34 (diff) | |
fix: correct build errors and clean up code
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | add.go | 10 | ||||
| -rw-r--r-- | argv.go | 24 | ||||
| -rw-r--r-- | doPlayback.go | 4 | ||||
| -rw-r--r-- | junk | 1 | ||||
| -rwxr-xr-x | regex | bin | 0 -> 18045448 bytes | |||
| -rw-r--r-- | terminal_width.go | 2 |
7 files changed, 23 insertions, 22 deletions
@@ -11,8 +11,8 @@ verbose: goimports vet GO111MODULE=off go install -v -x \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" -build: goimports vet - GO111MODULE=off go build -v -x \ +build: goimports + GO111MODULE=off go build \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" install: goimports vet @@ -28,10 +28,10 @@ func addFile(filename string) (*chatpb.Chats, error) { logDir := filepath.Dir(filename) // Iterate through the structure to inline all external content. - for _, chat := range logData.GetChats() { - for _, entry := range chat.GetEntries() { + for _, chat := range logData.Chats { + for _, entry := range chat.Entries { // Inline main content from ContentFile - if contentFile := entry.GetContentFile(); contentFile != "" { + if contentFile := entry.ContentFile; contentFile != "" { contentPath := filepath.Join(logDir, contentFile) contentBytes, err := os.ReadFile(contentPath) if err != nil { @@ -42,9 +42,9 @@ func addFile(filename string) (*chatpb.Chats, error) { } // Inline snippet content from snippet files - if snippets := entry.GetSnippets(); snippets != nil { + if snippets := entry.Snippets; snippets != nil { for _, snippet := range snippets { - if snippetFile := snippet.GetFilename(); snippetFile != "" { + if snippetFile := snippet.Filename; snippetFile != "" { snippetPath := filepath.Join(logDir, snippetFile) contentBytes, err := os.ReadFile(snippetPath) if err != nil { @@ -10,19 +10,19 @@ package main var argv args type args struct { - Add string `arg:"--add" help:"add a new chat"` - Format *EmptyCmd `arg:"subcommand:format" help:"add a conversation"` - Playback *PlaybackCmd `arg:"subcommand:playback" help:"dump your prior conversations to the terminal'"` - Output string `arg:"--output" help:"should get a string from regex-cli"` - Input string `arg:"--input" help:"should get a string from regex-cli"` - ImportFile string `arg:"--import" help:"import a file from regex-cli"` - Stats []string `arg:"--stats" help:"add stats to a chat"` - NewChat []string `arg:"--new-chat" help:"create a new chat"` + Add string `arg:"--add" help:"add a new chat"` + Format *EmptyCmd `arg:"subcommand:format" help:"add a conversation"` + Playback *PlaybackCmd `arg:"subcommand:playback" help:"dump your prior conversations to the terminal'"` + Output string `arg:"--output" help:"should get a string from regex-cli"` + Input string `arg:"--input" help:"should get a string from regex-cli"` + ImportFile string `arg:"--import" help:"import a file from regex-cli"` + Stats []string `arg:"--stats" help:"add stats to a chat"` + NewChat []string `arg:"--new-chat" help:"create a new chat"` GetNextAutoTopic bool `arg:"--get-next-auto-topic" help:"get the next auto topic name"` - Force bool `arg:"--force" help:"try to strong arm things"` - Verbose bool `arg:"--verbose" help:"show more output"` - Bash bool `arg:"--bash" help:"generate bash completion"` - BashAuto []string `arg:"--auto-complete" help:"todo: move this to go-arg"` + Force bool `arg:"--force" help:"try to strong arm things"` + Verbose bool `arg:"--verbose" help:"show more output"` + Bash bool `arg:"--bash" help:"generate bash completion"` + BashAuto []string `arg:"--auto-complete" help:"todo: move this to go-arg"` } type EmptyCmd struct { diff --git a/doPlayback.go b/doPlayback.go index 0a3f44b..5e9ab0f 100644 --- a/doPlayback.go +++ b/doPlayback.go @@ -95,7 +95,7 @@ func listEntries(chat *chatpb.Chat) { contentPreview = strings.ReplaceAll(contentPreview, "\n", " ") authorAndTime := fmt.Sprintf("[%s] (%s)", author, formattedTime) - + availableWidth := width - maxAuthorAndTimeLen - 1 // -1 for a space if len(contentPreview) > availableWidth { contentPreview = contentPreview[:availableWidth-3] + "..." @@ -122,4 +122,4 @@ func listEntries(chat *chatpb.Chat) { } } fmt.Println("-------------------------------------------------") -}
\ No newline at end of file +} @@ -0,0 +1 @@ + Binary files differdiff --git a/terminal_width.go b/terminal_width.go index 3421330..fe623c6 100644 --- a/terminal_width.go +++ b/terminal_width.go @@ -13,4 +13,4 @@ func getTerminalWidth() int { return 80 } return width -}
\ No newline at end of file +} |
