From 3fa1e2267e9af8866002a11bd9a135661c5fa7cd Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 15 Jul 2026 09:16:15 +0900 Subject: [PATCH] curl: fix completely broken command, it lost its key flags when they moved to the root command (which realCurl bypasses) and Run was eating the first flag as the program name. --- curl.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/curl.go b/curl.go index 7e4a662..70d764e 100644 --- a/curl.go +++ b/curl.go @@ -20,6 +20,9 @@ var curl = &cli.Command{ Usage: "calls curl but with a nip98 header", Description: "accepts all flags and arguments exactly as they would be passed to curl.", DisableSliceFlagSeparator: true, + // this command is always run standalone (see realCurl()), never under the root + // command, so it needs its own copy of the key flags + Flags: defaultKeyFlags, Action: func(ctx context.Context, c *cli.Command) error { kr, _, err := gatherKeyerFromArguments(ctx, c) if err != nil { @@ -129,5 +132,6 @@ func realCurl() error { } } - return curl.Run(context.Background(), keyFlags) + // Run treats the first element as the program name, so prepend one + return curl.Run(context.Background(), append([]string{"nak curl"}, keyFlags...)) }