From fe20ae9ca0ac12756d34db748f49f4af78bb92fd Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 13 Aug 2024 23:51:16 +0200 Subject: [PATCH] fix(rpc): cli error instead of daemon println probably safer to error here, than printing line - if command was executed over http it might be printed on the server, or break cli tools that expect specific stdout rather than this line --- core/commands/add.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/add.go b/core/commands/add.go index 8d90cc0e0641..79a06a1dac97 100644 --- a/core/commands/add.go +++ b/core/commands/add.go @@ -323,7 +323,7 @@ See 'dag export' and 'dag import' for more information. if mtime != 0 { opts = append(opts, options.Unixfs.Mtime(mtime, uint32(mtimeNsecs))) } else if mtimeNsecs != 0 { - fmt.Println("option", mtimeNsecsOptionName, "ignored as no valid", mtimeOptionName, "value provided") + fmt.Errorf("option %q requires %q to be provided as well", mtimeNsecsOptionName, mtimeOptionName) } if cidVerSet {