diff options
Diffstat (limited to 'usr.bin/tmux/cmd-rename-window.c')
-rw-r--r-- | usr.bin/tmux/cmd-rename-window.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/usr.bin/tmux/cmd-rename-window.c b/usr.bin/tmux/cmd-rename-window.c index 1c75041ebca..e6344a7f070 100644 --- a/usr.bin/tmux/cmd-rename-window.c +++ b/usr.bin/tmux/cmd-rename-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-rename-window.c,v 1.5 2009/11/13 19:53:29 nicm Exp $ */ +/* $OpenBSD: cmd-rename-window.c,v 1.6 2011/01/04 00:42:47 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -30,27 +30,26 @@ int cmd_rename_window_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_rename_window_entry = { "rename-window", "renamew", + "t:", 1, 1, CMD_TARGET_WINDOW_USAGE " new-name", - CMD_ARG1, "", - cmd_target_init, - cmd_target_parse, - cmd_rename_window_exec, - cmd_target_free, - cmd_target_print + 0, + NULL, + NULL, + cmd_rename_window_exec }; int cmd_rename_window_exec(struct cmd *self, struct cmd_ctx *ctx) { - struct cmd_target_data *data = self->data; - struct session *s; - struct winlink *wl; + struct args *args = self->args; + struct session *s; + struct winlink *wl; - if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL) + if ((wl = cmd_find_window(ctx, args_get(args, 't'), &s)) == NULL) return (-1); xfree(wl->window->name); - wl->window->name = xstrdup(data->arg); + wl->window->name = xstrdup(args->argv[0]); options_set_number(&wl->window->options, "automatic-rename", 0); server_status_window(wl->window); |