=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/cmd-choose-window.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/tmux/Attic/cmd-choose-window.c 2010/12/30 21:35:17 1.17 --- src/usr.bin/tmux/Attic/cmd-choose-window.c 2011/01/04 00:42:46 1.18 *************** *** 1,4 **** ! /* $OpenBSD: cmd-choose-window.c,v 1.17 2010/12/30 21:35:17 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-choose-window.c,v 1.18 2011/01/04 00:42:46 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 33,45 **** const struct cmd_entry cmd_choose_window_entry = { "choose-window", NULL, CMD_TARGET_WINDOW_USAGE " [template]", ! CMD_ARG01, "", ! cmd_target_init, ! cmd_target_parse, ! cmd_choose_window_exec, ! cmd_target_free, ! cmd_target_print }; struct cmd_choose_window_data { --- 33,44 ---- const struct cmd_entry cmd_choose_window_entry = { "choose-window", NULL, + "t:", 0, 1, CMD_TARGET_WINDOW_USAGE " [template]", ! 0, ! NULL, ! NULL, ! cmd_choose_window_exec }; struct cmd_choose_window_data { *************** *** 51,57 **** int cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx) { ! struct cmd_target_data *data = self->data; struct cmd_choose_window_data *cdata; struct session *s; struct winlink *wl, *wm; --- 50,56 ---- int cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx) { ! struct args *args = self->args; struct cmd_choose_window_data *cdata; struct session *s; struct winlink *wl, *wm; *************** *** 66,72 **** } s = ctx->curclient->session; ! if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL) return (-1); if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0) --- 65,71 ---- } s = ctx->curclient->session; ! if ((wl = cmd_find_window(ctx, args_get(args, 't'), NULL)) == NULL) return (-1); if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0) *************** *** 99,106 **** } cdata = xmalloc(sizeof *cdata); ! if (data->arg != NULL) ! cdata->template = xstrdup(data->arg); else cdata->template = xstrdup("select-window -t '%%'"); cdata->session = s; --- 98,105 ---- } cdata = xmalloc(sizeof *cdata); ! if (args->argc != 0) ! cdata->template = xstrdup(args->argv[0]); else cdata->template = xstrdup("select-window -t '%%'"); cdata->session = s;