aboutsummaryrefslogtreecommitdiff
path: root/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 14:40:48 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-18 14:40:48 +0000
commita15f8fc4a66420615d237313c6a01fcf532c52a2 (patch)
tree751d858639e20ae413ec907f7cf3215c06e3820d /cmd.c
parentc4d5989a4ef03db0477446ee004ef431be268286 (diff)
downloadrtmux-a15f8fc4a66420615d237313c6a01fcf532c52a2.tar.gz
rtmux-a15f8fc4a66420615d237313c6a01fcf532c52a2.tar.bz2
rtmux-a15f8fc4a66420615d237313c6a01fcf532c52a2.zip
Support command sequences separated by " ; ". Also clean up command printing.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd.c b/cmd.c
index 8e7a0e52..ad9eccdf 100644
--- a/cmd.c
+++ b/cmd.c
@@ -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)
{