nostril

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

commit 54fd3e0fe3370306686c021373f76c0c84c8af97
parent f4d4835e1e1edd7e320ec840149316d322013440
Author: William Casarin <jb55@jb55.com>
Date:   Tue,  9 Aug 2022 08:05:57 -0700

make content optional, defaults to ""

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

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

diff --git a/README.md b/README.md @@ -5,10 +5,11 @@ A cli util for creating nostr events ## Usage - usage: nostril [OPTIONS] --content <content> + usage: nostril [OPTIONS] OPTIONS + --content the content of the note --dm <hex pubkey> make an encrypted dm to said pubkey. sets kind and tags. --envelope wrap in ["EVENT",...] for easy relaying --kind <number> set kind diff --git a/nostril.c b/nostril.c @@ -69,10 +69,11 @@ struct nostr_event { void usage() { - printf("usage: nostril [OPTIONS] --content <content>\n"); + printf("usage: nostril [OPTIONS]\n"); printf("\n"); printf(" OPTIONS\n"); printf("\n"); + printf(" --content <string> the content of the note\n"); printf(" --dm <hex pubkey> make an encrypted dm to said pubkey. sets kind and tags.\n"); printf(" --envelope wrap in [\"EVENT\",...] for easy relaying\n"); printf(" --kind <number> 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; }