Support command sequences separated by " ; ". Also clean up command printing.

This commit is contained in:
Nicholas Marriott
2009-01-18 14:40:48 +00:00
parent c4d5989a4e
commit a15f8fc4a6
23 changed files with 350 additions and 143 deletions

11
cmd.c
View File

@ -1,4 +1,4 @@
/* $Id: cmd.c,v 1.80 2009-01-18 12:09:42 nicm Exp $ */
/* $Id: cmd.c,v 1.81 2009-01-18 14:40:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -234,6 +234,15 @@ cmd_free(struct cmd *cmd)
xfree(cmd);
}
size_t
cmd_print(struct cmd *cmd, char *buf, size_t len)
{
if (cmd->entry->print == NULL) {
return (xsnprintf(buf, len, "%s", cmd->entry->name));
}
return (cmd->entry->print(cmd, buf, len));
}
void
cmd_send_string(struct buffer *b, const char *s)
{