summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCastor Regex <[email protected]>2025-08-25 10:15:39 -0500
committerJeff Carr <[email protected]>2025-08-25 10:15:39 -0500
commit0b2ec9ce15cf17f12c6457396a9579d943115d67 (patch)
tree1f64f1f424496a930ee8fa2698fdecc19b36005e
parentc39a2f31e65f6931b6752e89c9566613e8993c34 (diff)
fix: correct build errors and clean up code
-rw-r--r--Makefile4
-rw-r--r--add.go10
-rw-r--r--argv.go24
-rw-r--r--doPlayback.go4
-rw-r--r--junk1
-rwxr-xr-xregexbin0 -> 18045448 bytes
-rw-r--r--terminal_width.go2
7 files changed, 23 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index 2f3349b..9e37493 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/add.go b/add.go
index 02b42a6..88d4ceb 100644
--- a/add.go
+++ b/add.go
@@ -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 {
diff --git a/argv.go b/argv.go
index b339ad3..fdcde1f 100644
--- a/argv.go
+++ b/argv.go
@@ -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
+}
diff --git a/junk b/junk
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/junk
@@ -0,0 +1 @@
+
diff --git a/regex b/regex
new file mode 100755
index 0000000..23d3f22
--- /dev/null
+++ b/regex
Binary files differ
diff --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
+}