summaryrefslogtreecommitdiff
path: root/cmd/hexai-tmux-action
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-28 17:30:44 +0300
committerPaul Buetow <paul@buetow.org>2025-09-28 17:30:44 +0300
commit0761409497041c752086b9aded08cf9e32e30fd2 (patch)
treee62721bc119d4ae435d2609292faea06a68244a4 /cmd/hexai-tmux-action
parent0ac2d186e84f77d73d924e2c0ce975a17c3a8078 (diff)
Add --config flag support across CLI, LSP, and tmux tools
Diffstat (limited to 'cmd/hexai-tmux-action')
-rw-r--r--cmd/hexai-tmux-action/main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/hexai-tmux-action/main.go b/cmd/hexai-tmux-action/main.go
index 2d8793b..3b066cc 100644
--- a/cmd/hexai-tmux-action/main.go
+++ b/cmd/hexai-tmux-action/main.go
@@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"os"
+ "strings"
"codeberg.org/snonux/hexai/internal/hexaiaction"
)
@@ -13,6 +14,7 @@ func main() {
infile := flag.String("infile", "", "Read input from this file instead of stdin")
outfile := flag.String("outfile", "", "Write output to this file instead of stdout")
uiChild := flag.Bool("ui-child", false, "INTERNAL: run interactive UI and write to -outfile atomically")
+ configPath := flag.String("config", "", "path to config file")
tmuxTarget := flag.String("tmux-target", "", "tmux split target (advanced)")
tmuxSplit := flag.String("tmux-split", "v", "tmux split orientation: v or h")
tmuxPercent := flag.Int("tmux-percent", 33, "tmux split size percentage (1-100)")
@@ -22,7 +24,11 @@ func main() {
Infile: *infile, Outfile: *outfile,
UIChild: *uiChild, TmuxTarget: *tmuxTarget, TmuxSplit: *tmuxSplit, TmuxPercent: *tmuxPercent,
}
- if err := hexaiaction.RunCommand(context.Background(), opts, os.Stdin, os.Stdout, os.Stderr); err != nil {
+ ctx := context.Background()
+ if path := strings.TrimSpace(*configPath); path != "" {
+ ctx = hexaiaction.WithConfigPath(ctx, path)
+ }
+ if err := hexaiaction.RunCommand(ctx, opts, os.Stdin, os.Stdout, os.Stderr); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}