Skip to content

Commit 151bbe1

Browse files
committed
Fix build
1 parent 1a65143 commit 151bbe1

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

cmd/claude-code-ntfy/main.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ func main() {
2424
// Manually parse arguments to separate our flags from Claude's
2525
ourArgs := []string{}
2626
claudeArgs := []string{}
27-
27+
2828
i := 1 // Skip program name
2929
for i < len(os.Args) {
3030
arg := os.Args[i]
31-
31+
3232
// Check if it's one of our flags
3333
switch arg {
3434
case "--config", "-config":
@@ -55,11 +55,14 @@ func main() {
5555

5656
// Define our flags first
5757
flag.StringVar(&configPath, "config", "", "Path to config file")
58-
flag.BoolVar(&quiet, "quiet", false, "Disable all notifications")
58+
flag.BoolVar(&quiet, "quiet", false, "Disable all notifications")
5959
flag.BoolVar(&help, "help", false, "Show help message")
60-
60+
6161
// Parse only our flags
62-
flag.CommandLine.Parse(ourArgs)
62+
if err := flag.CommandLine.Parse(ourArgs); err != nil {
63+
fmt.Fprintf(os.Stderr, "Error parsing flags: %v\n", err)
64+
os.Exit(1)
65+
}
6366

6467
// Only show our help if --help was provided without other Claude args
6568
if help && len(claudeArgs) == 0 {
@@ -87,6 +90,12 @@ func main() {
8790

8891
// Use the manually parsed Claude args
8992
userArgs := claudeArgs
93+
94+
// Debug output
95+
if os.Getenv("CLAUDE_NOTIFY_DEBUG") == "1" {
96+
fmt.Fprintf(os.Stderr, "claude-code-ntfy: Parsed claude args: %v\n", claudeArgs)
97+
}
98+
9099
var command string
91100

92101
// Determine claude path

0 commit comments

Comments
 (0)