=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/cmd-previous-window.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/usr.bin/tmux/Attic/cmd-previous-window.c 2009/11/13 19:53:29 1.6 +++ src/usr.bin/tmux/Attic/cmd-previous-window.c 2011/01/04 00:42:47 1.7 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-previous-window.c,v 1.6 2009/11/13 19:53:29 nicm Exp $ */ +/* $OpenBSD: cmd-previous-window.c,v 1.7 2011/01/04 00:42:47 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -24,44 +24,39 @@ * Move to previous window. */ -void cmd_previous_window_init(struct cmd *, int); +void cmd_previous_window_key_binding(struct cmd *, int); int cmd_previous_window_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_previous_window_entry = { "previous-window", "prev", + "at:", 0, 0, "[-a] " CMD_TARGET_SESSION_USAGE, - 0, "a", - cmd_previous_window_init, - cmd_target_parse, - cmd_previous_window_exec, - cmd_target_free, - cmd_target_print + 0, + cmd_previous_window_key_binding, + NULL, + cmd_previous_window_exec }; void -cmd_previous_window_init(struct cmd *self, int key) +cmd_previous_window_key_binding(struct cmd *self, int key) { - struct cmd_target_data *data; - - cmd_target_init(self, key); - data = self->data; - + self->args = args_create(0); if (key == ('p' | KEYC_ESCAPE)) - cmd_set_flag(&data->chflags, 'a'); + args_set(self->args, 'a', NULL); } int cmd_previous_window_exec(struct cmd *self, struct cmd_ctx *ctx) { - struct cmd_target_data *data = self->data; - struct session *s; - int activity; + struct args *args = self->args; + struct session *s; + int activity; - if ((s = cmd_find_session(ctx, data->target)) == NULL) + if ((s = cmd_find_session(ctx, args_get(args, 't'))) == NULL) return (-1); activity = 0; - if (cmd_check_flag(data->chflags, 'a')) + if (args_has(self->args, 'a')) activity = 1; if (session_previous(s, activity) == 0)