From 5f108d9df6bada119def52518152a487f8695702 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 13 Jul 2009 23:11:35 +0000 Subject: Having fixed flags for single-character getopt options is a bit hard to maintain and is only going to get worse as more are used. So instead, add a new uint64_t member to cmd_entry which is a bitmask of upper and lowercase options accepted by the command. This means new single character options can be used without the need to add it explicitly to the list. --- cmd-previous-window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd-previous-window.c') diff --git a/cmd-previous-window.c b/cmd-previous-window.c index 6163cec1..2c5088b2 100644 --- a/cmd-previous-window.c +++ b/cmd-previous-window.c @@ -30,7 +30,7 @@ int cmd_previous_window_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_previous_window_entry = { "previous-window", "prev", "[-a] " CMD_TARGET_SESSION_USAGE, - CMD_AFLAG, + 0, CMD_CHFLAG('a'), cmd_previous_window_init, cmd_target_parse, cmd_previous_window_exec, @@ -49,7 +49,7 @@ cmd_previous_window_init(struct cmd *self, int key) data = self->data; if (key == KEYC_ADDESC('p')) - data->flags |= CMD_AFLAG; + data->chflags |= CMD_CHFLAG('a'); } int @@ -63,7 +63,7 @@ cmd_previous_window_exec(struct cmd *self, struct cmd_ctx *ctx) return (-1); activity = 0; - if (data->flags & CMD_AFLAG) + if (data->chflags & CMD_CHFLAG('a')) activity = 1; if (session_previous(s, activity) == 0) -- cgit v1.2.3