ccan: update to latest ccan/opt

This adds:
1. ability to search for an option by name.
2. allowance to set our own bits when registering options.
3. show callbacks which can say "don't show", and variable length.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-06-01 13:46:21 +09:30
parent 9b98f9789e
commit f45c17450b
21 changed files with 449 additions and 265 deletions

View File

@@ -594,12 +594,13 @@ static char *opt_set_level(const char *arg, enum log_level *level)
return NULL;
}
static void opt_show_level(char buf[OPT_SHOW_LEN], const enum log_level *level)
static bool opt_show_level(char *buf, size_t len, const enum log_level *level)
{
if (*level == LOG_LEVEL_MAX + 1)
strncpy(buf, "none", OPT_SHOW_LEN-1);
strncpy(buf, "none", len);
else
strncpy(buf, log_level_name(*level), OPT_SHOW_LEN-1);
strncpy(buf, log_level_name(*level), len);
return true;
}
/* The standard opt_log_stderr_exit exits with status 1 */