diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-07-19 00:39:37 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-07-19 00:39:37 +0000 |
commit | 17170f5d6ebd206bf0d598ccbda3884506cc00ea (patch) | |
tree | 5f7a492545fa931beeea341fec4a8336fa74d3f1 /cmd-unlink-window.c | |
parent | 19cb1fb592527e1800d6ae6f761b2a8ab944ef5d (diff) | |
download | rtmux-17170f5d6ebd206bf0d598ccbda3884506cc00ea.tar.gz rtmux-17170f5d6ebd206bf0d598ccbda3884506cc00ea.tar.bz2 rtmux-17170f5d6ebd206bf0d598ccbda3884506cc00ea.zip |
Add a -k flag to unlink-window which makes it behave the same as the old
kill-window - if a window is linked into only one session it unlinked and
destroyed.
Diffstat (limited to 'cmd-unlink-window.c')
-rw-r--r-- | cmd-unlink-window.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd-unlink-window.c b/cmd-unlink-window.c index 6f146866..953ddc89 100644 --- a/cmd-unlink-window.c +++ b/cmd-unlink-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-unlink-window.c,v 1.14 2009-07-14 06:43:33 nicm Exp $ */ +/* $Id: cmd-unlink-window.c,v 1.15 2009-07-19 00:39:37 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -28,8 +28,8 @@ int cmd_unlink_window_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_unlink_window_entry = { "unlink-window", "unlinkw", - CMD_TARGET_WINDOW_USAGE, - 0, 0, + "[-k] " CMD_TARGET_WINDOW_USAGE, + 0, CMD_CHFLAG('k'), cmd_target_init, cmd_target_parse, cmd_unlink_window_exec, @@ -52,7 +52,7 @@ cmd_unlink_window_exec(struct cmd *self, struct cmd_ctx *ctx) if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL) return (-1); - if (wl->window->references == 1) { + if (!(data->chflags & CMD_CHFLAG('k')) && wl->window->references == 1) { ctx->error(ctx, "window is only linked to one session"); return (-1); } |