nostril

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

commit 1904c78efa80b1e47515c1d5f51a9a99ed0d17f2
parent 02ab7a19d13d281b5fe4fb6b87694f006e32399e
Author: William Casarin <jb55@jb55.com>
Date:   Wed, 16 Nov 2022 21:11:33 -0800

add -t hashtag helper

Diffstat:
Mnostril.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/nostril.c b/nostril.c @@ -85,6 +85,7 @@ void usage() printf(" --tag <key> <value> add a tag\n"); printf(" -e <event_id> shorthand for --tag e <event_id>\n"); printf(" -p <pubkey> shorthand for --tag p <pubkey>\n"); + printf(" -t <hashtag> shorthand for --tag t <hashtag>\n"); exit(1); } @@ -474,6 +475,13 @@ static int parse_args(int argc, const char *argv[], struct args *args, struct no fprintf(stderr, "couldn't add p tag"); return 0; } + } else if (!strcmp(arg, "-t")) { + has_added_tags = 1; + arg = *argv++; argc--; + if (!nostr_add_tag(ev, "t", arg)) { + fprintf(stderr, "couldn't add t tag"); + return 0; + } } else if (!strcmp(arg, "--tag")) { has_added_tags = 1; if (args->tags) {