Add cli_optional_bid()

This commit is contained in:
Andrew Bettison 2015-03-28 04:39:53 +10:30
parent 59b1c08e52
commit 5c933cc5b3
2 changed files with 6 additions and 0 deletions

5
cli.c
View File

@ -384,6 +384,11 @@ int cli_bid(const char *arg)
return str_to_rhizome_bid_t(NULL, arg) != -1;
}
int cli_optional_bid(const char *arg)
{
return !arg[0] || str_to_rhizome_bid_t(NULL, arg) != -1;
}
int cli_fileid(const char *arg)
{
return str_to_rhizome_filehash_t(NULL, arg) != -1;

1
cli.h
View File

@ -103,6 +103,7 @@ int cli_absolute_path(const char *arg);
int cli_optional_sid(const char *arg);
int cli_optional_bundle_secret_key(const char *arg);
int cli_bid(const char *arg);
int cli_optional_bid(const char *arg);
int cli_fileid(const char *arg);
int cli_optional_bundle_crypt_key(const char *arg);
int cli_interval_ms(const char *arg);