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: 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

View File

@ -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;
}