diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-03 11:26:34 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-10-03 11:26:34 +0000 |
commit | dadc56d754f2e86dec96bcf3bed54090538ce336 (patch) | |
tree | 77f6aab210106a251b3516bca4ba8ddc92973c86 /tmux.c | |
parent | a68b1e58db8b970f82cd17a74a18d30a0c77424e (diff) | |
download | rtmux-dadc56d754f2e86dec96bcf3bed54090538ce336.tar.gz rtmux-dadc56d754f2e86dec96bcf3bed54090538ce336.tar.bz2 rtmux-dadc56d754f2e86dec96bcf3bed54090538ce336.zip |
Key binding, unbinding.
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $Id: tmux.c,v 1.20 2007-10-03 09:17:00 nicm Exp $ */ +/* $Id: tmux.c,v 1.21 2007-10-03 11:26:34 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -50,15 +50,28 @@ const struct op op_table[] = { { "list-windows", "lsw", op_list_windows }, { "new-session", "new", op_new/*_session*/ }, { "rename-window", "renw", op_rename }, + { "bind-key", "bind", op_bind_key }, + { "unbind-key", "unbind", op_unbind_key }, }; #define NOP (sizeof op_table / sizeof op_table[0]) int -usage(const char *s) +usage(const char *fmt, ...) { - if (s == NULL) - s = "command [flags]"; - fprintf(stderr, "usage: %s [-v] [-S path] %s\n", __progname, s); + char *msg; + va_list ap; + + if (fmt == NULL) { + fprintf(stderr, + "usage: %s [-v] [-S path] command [flags]\n", __progname); + return (1); + } + + va_start(ap, fmt); + xvasprintf(&msg, fmt, ap); + va_end(ap); + fprintf(stderr, "usage: %s [-v] [-S path] %s\n", __progname, msg); + xfree(msg); return (1); } |