Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2025-11-18 10:01:07 +00:00
5 changed files with 21 additions and 8 deletions

11
cmd.c
View File

@@ -220,6 +220,7 @@ struct cmd {
char *file;
u_int line;
int parse_flags;
TAILQ_ENTRY(cmd) qentry;
};
@@ -412,6 +413,13 @@ cmd_get_source(struct cmd *cmd, const char **file, u_int *line)
*line = cmd->line;
}
/* Get parse flags for command. */
int
cmd_get_parse_flags(struct cmd *cmd)
{
return (cmd->parse_flags);
}
/* Look for an alias for a command. */
char *
cmd_get_alias(const char *name)
@@ -496,7 +504,7 @@ ambiguous:
/* Parse a single command from an argument vector. */
struct cmd *
cmd_parse(struct args_value *values, u_int count, const char *file, u_int line,
char **cause)
int parse_flags, char **cause)
{
const struct cmd_entry *entry;
struct cmd *cmd;
@@ -525,6 +533,7 @@ cmd_parse(struct args_value *values, u_int count, const char *file, u_int line,
cmd = xcalloc(1, sizeof *cmd);
cmd->entry = entry;
cmd->args = args;
cmd->parse_flags = parse_flags;
if (file != NULL)
cmd->file = xstrdup(file);