nostril

A C cli tool for creating nostr events
git clone git://jb55.com/nostril
Log | Files | Refs | README

commit 8898a0fe91c54961f05050ed45df9602213b954a
parent 251031f5a5d098d02c5e74556942d3dd706b5ce4
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 21 Apr 2022 06:01:52 -0700

fix kind parser

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
MREADME.md | 2--
Mnostril.c | 3++-
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md @@ -3,8 +3,6 @@ A cli util for creating nostr events - TODO: support for adding tags from the cli - ## Dependenices `libsecp256k1` is the only dependency diff --git a/nostril.c b/nostril.c @@ -339,7 +339,7 @@ static void make_event_from_args(struct nostr_event *ev, struct args *args) { ev->created_at = args->flags & HAS_CREATED_AT? args->created_at : time(NULL); ev->content = args->content; - ev->kind = 1; + ev->kind = args->flags & HAS_KIND ? args->kind : 1; } static int parse_num(const char *arg, uint64_t *t) @@ -388,6 +388,7 @@ static int parse_args(int argc, const char *argv[], struct args *args, struct no args->flags |= HAS_CREATED_AT; } } else if (!strcmp(arg, "--kind")) { + arg = *argv++; argc--; if (!parse_num(arg, &n)) { fprintf(stderr, "kind should be a number, got '%s'\n", arg); return 0;