make content optional, defaults to ""

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2022-08-09 08:05:57 -07:00
parent f4d4835e1e
commit 54fd3e0fe3
2 changed files with 6 additions and 6 deletions

View File

@ -5,10 +5,11 @@ A cli util for creating nostr events
## Usage ## Usage
usage: nostril [OPTIONS] --content <content> usage: nostril [OPTIONS]
OPTIONS OPTIONS
--content the content of the note
--dm <hex pubkey> make an encrypted dm to said pubkey. sets kind and tags. --dm <hex pubkey> make an encrypted dm to said pubkey. sets kind and tags.
--envelope wrap in ["EVENT",...] for easy relaying --envelope wrap in ["EVENT",...] for easy relaying
--kind <number> set kind --kind <number> set kind

View File

@ -69,10 +69,11 @@ struct nostr_event {
void usage() void usage()
{ {
printf("usage: nostril [OPTIONS] --content <content>\n"); printf("usage: nostril [OPTIONS]\n");
printf("\n"); printf("\n");
printf(" OPTIONS\n"); printf(" OPTIONS\n");
printf("\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(" --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(" --envelope wrap in [\"EVENT\",...] for easy relaying\n");
printf(" --kind <number> set kind\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) { if (!args->content)
fprintf(stderr, "expected --content\n"); args->content = "";
return 0;
}
return 1; return 1;
} }