=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/cmd-choose-session.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/usr.bin/tmux/Attic/cmd-choose-session.c 2010/12/21 22:37:59 1.11 --- src/usr.bin/tmux/Attic/cmd-choose-session.c 2011/01/04 00:42:46 1.12 *************** *** 1,4 **** ! /* $OpenBSD: cmd-choose-session.c,v 1.11 2010/12/21 22:37:59 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-choose-session.c,v 1.12 2011/01/04 00:42:46 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 33,45 **** const struct cmd_entry cmd_choose_session_entry = { "choose-session", NULL, CMD_TARGET_WINDOW_USAGE " [template]", ! CMD_ARG01, "", ! cmd_target_init, ! cmd_target_parse, ! cmd_choose_session_exec, ! cmd_target_free, ! cmd_target_print }; struct cmd_choose_session_data { --- 33,44 ---- const struct cmd_entry cmd_choose_session_entry = { "choose-session", NULL, + "t:", 0, 1, CMD_TARGET_WINDOW_USAGE " [template]", ! 0, ! NULL, ! NULL, ! cmd_choose_session_exec }; struct cmd_choose_session_data { *************** *** 50,56 **** int cmd_choose_session_exec(struct cmd *self, struct cmd_ctx *ctx) { ! struct cmd_target_data *data = self->data; struct cmd_choose_session_data *cdata; struct winlink *wl; struct session *s; --- 49,55 ---- int cmd_choose_session_exec(struct cmd *self, struct cmd_ctx *ctx) { ! struct args *args = self->args; struct cmd_choose_session_data *cdata; struct winlink *wl; struct session *s; *************** *** 63,69 **** return (-1); } ! if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL) return (-1); if (window_pane_set_mode(wl->window->active, &window_choose_mode) != 0) --- 62,68 ---- return (-1); } ! 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) *************** *** 90,97 **** } cdata = xmalloc(sizeof *cdata); ! if (data->arg != NULL) ! cdata->template = xstrdup(data->arg); else cdata->template = xstrdup("switch-client -t '%%'"); cdata->client = ctx->curclient; --- 89,96 ---- } cdata = xmalloc(sizeof *cdata); ! if (args->argc != 0) ! cdata->template = xstrdup(args->argv[0]); else cdata->template = xstrdup("switch-client -t '%%'"); cdata->client = ctx->curclient;