From 54fd3e0fe3370306686c021373f76c0c84c8af97 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Tue, 9 Aug 2022 08:05:57 -0700 Subject: [PATCH] make content optional, defaults to "" Signed-off-by: William Casarin --- README.md | 3 ++- nostril.c | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8b82eea..22d706b 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,11 @@ A cli util for creating nostr events ## Usage - usage: nostril [OPTIONS] --content + usage: nostril [OPTIONS] OPTIONS + --content the content of the note --dm make an encrypted dm to said pubkey. sets kind and tags. --envelope wrap in ["EVENT",...] for easy relaying --kind set kind diff --git a/nostril.c b/nostril.c index 4c34d92..40ef4a1 100644 --- a/nostril.c +++ b/nostril.c @@ -69,10 +69,11 @@ struct nostr_event { void usage() { - printf("usage: nostril [OPTIONS] --content \n"); + printf("usage: nostril [OPTIONS]\n"); printf("\n"); printf(" OPTIONS\n"); printf("\n"); + printf(" --content the content of the note\n"); printf(" --dm make an encrypted dm to said pubkey. sets kind and tags.\n"); printf(" --envelope wrap in [\"EVENT\",...] for easy relaying\n"); printf(" --kind set kind\n"); @@ -476,10 +477,8 @@ static int parse_args(int argc, const char *argv[], struct args *args, struct no } } - if (!args->content) { - fprintf(stderr, "expected --content\n"); - return 0; - } + if (!args->content) + args->content = ""; return 1; }