Merge pull request #163 from mattn/fix/verify-validate-args-sentinel

verify, validate: fix the blank-stdin sentinel check
This commit is contained in:
mattn
2026-07-15 04:19:08 +00:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -51,7 +51,8 @@ nak event -k 1 -p not_a_pubkey | nak validate
}
for stdinEvent := range getJsonsOrBlank() {
if stdinEvent == "" {
if stdinEvent == "{}" && !isPiped() {
// blank sentinel from getJsonsOrBlank(), use the arguments instead
for _, arg := range c.Args().Slice() {
if err := handleEvent(arg); err != nil {
ctx = lineProcessingError(ctx, "%s", err)
+2 -1
View File
@@ -19,7 +19,8 @@ it outputs nothing if the verification is successful.`,
Action: func(ctx context.Context, c *cli.Command) error {
for stdinEvent := range getJsonsOrBlank() {
evt := nostr.Event{}
if stdinEvent == "" {
if stdinEvent == "{}" && !isPiped() {
// blank sentinel from getJsonsOrBlank(), use the argument instead
stdinEvent = c.Args().First()
if stdinEvent == "" {
continue