mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Fix set_err
This commit is contained in:
@@ -114,14 +114,14 @@ alloc_for_cli(CLISpec *spec, size_t sz) {
|
|||||||
int sz = snprintf(NULL, 0, fmt, __VA_ARGS__); \
|
int sz = snprintf(NULL, 0, fmt, __VA_ARGS__); \
|
||||||
char *buf = alloc_for_cli(spec, sz + 4); \
|
char *buf = alloc_for_cli(spec, sz + 4); \
|
||||||
if (!buf) OOM; \
|
if (!buf) OOM; \
|
||||||
snprintf(buf, sz, fmt, __VA_ARGS__); spec->errmsg = buf; \
|
snprintf(buf, sz + 4, fmt, __VA_ARGS__); spec->errmsg = buf; \
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char*
|
static const char*
|
||||||
dest_for_alias(CLISpec *spec, const char *alias) {
|
dest_for_alias(CLISpec *spec, const char *alias) {
|
||||||
alias_hash_itr itr = vt_get(&spec->alias_map, alias);
|
alias_hash_itr itr = vt_get(&spec->alias_map, alias);
|
||||||
if (vt_is_end(itr)) {
|
if (vt_is_end(itr)) {
|
||||||
set_err("Unknown flag: %s use --help", alias);
|
set_err("Unknown flag: %s use --help.", alias);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return itr.data->val;
|
return itr.data->val;
|
||||||
|
|||||||
Reference in New Issue
Block a user