Do not use ;;s in list-keys output as it is confusing and cannot be

parsed on input, from Patrick Motard in GitHub issue 4750.
This commit is contained in:
nicm
2026-01-06 10:17:29 +00:00
parent ccd4dd7ff2
commit 5f9dac8abc
3 changed files with 10 additions and 4 deletions

6
cmd.c
View File

@@ -677,12 +677,14 @@ cmd_list_copy(const struct cmd_list *cmdlist, int argc, char **argv)
/* Get a command list as a string. */
char *
cmd_list_print(const struct cmd_list *cmdlist, int escaped)
cmd_list_print(const struct cmd_list *cmdlist, int flags)
{
struct cmd *cmd, *next;
char *buf, *this;
size_t len;
const char *separator;
int escaped = flags & CMD_LIST_PRINT_ESCAPED;
int no_groups = flags & CMD_LIST_PRINT_NO_GROUPS;
const char *single_separator = escaped ? " \\; " : " ; ";
const char *double_separator = escaped ? " \\;\\; " : " ;; ";
@@ -699,7 +701,7 @@ cmd_list_print(const struct cmd_list *cmdlist, int escaped)
next = TAILQ_NEXT(cmd, qentry);
if (next != NULL) {
if (cmd->group != next->group)
if (!no_groups && cmd->group != next->group)
separator = double_separator;
else
separator = single_separator;