diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-03-17 21:33:34 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-03-17 21:33:34 +0000 |
commit | ef477e3eecf0dedea46af141c608c04e55476a07 (patch) | |
tree | 383153bd7a0608467ae8e71e7ea43d42f23d5404 | |
parent | 28e001be6786e721e80edba1893c1371269c7375 (diff) |
Add -q option to set-option to turn off info message, from marcel partap.
-rw-r--r-- | usr.bin/tmux/cmd-set-option.c | 19 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 17 |
2 files changed, 23 insertions, 13 deletions
diff --git a/usr.bin/tmux/cmd-set-option.c b/usr.bin/tmux/cmd-set-option.c index 72edb6626f4..fd5c013fb28 100644 --- a/usr.bin/tmux/cmd-set-option.c +++ b/usr.bin/tmux/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-option.c,v 1.53 2012/02/25 12:57:42 nicm Exp $ */ +/* $OpenBSD: cmd-set-option.c,v 1.54 2012/03/17 21:33:33 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -60,8 +60,8 @@ struct options_entry *cmd_set_option_choice(struct cmd *, struct cmd_ctx *, const struct cmd_entry cmd_set_option_entry = { "set-option", "set", - "agst:uw", 1, 2, - "[-agsuw] [-t target-session|target-window] option [value]", + "agqst:uw", 1, 2, + "[-agsquw] [-t target-session|target-window] option [value]", 0, NULL, NULL, @@ -70,8 +70,8 @@ const struct cmd_entry cmd_set_option_entry = { const struct cmd_entry cmd_set_window_option_entry = { "set-window-option", "setw", - "agt:u", 1, 2, - "[-agu] " CMD_TARGET_WINDOW_USAGE " option [value]", + "agqt:u", 1, 2, + "[-agqu] " CMD_TARGET_WINDOW_USAGE " option [value]", 0, NULL, NULL, @@ -175,7 +175,8 @@ cmd_set_option_unset(struct cmd *self, struct cmd_ctx *ctx, } options_remove(oo, oe->name); - ctx->info(ctx, "unset option: %s", oe->name); + if (!args_has(args, 'q')) + ctx->info(ctx, "unset option: %s", oe->name); return (0); } @@ -184,6 +185,7 @@ int cmd_set_option_set(struct cmd *self, struct cmd_ctx *ctx, const struct options_table_entry *oe, struct options *oo, const char *value) { + struct args *args = self->args; struct options_entry *o; const char *s; @@ -220,7 +222,8 @@ cmd_set_option_set(struct cmd *self, struct cmd_ctx *ctx, return (-1); s = options_table_print_entry(oe, o); - ctx->info(ctx, "set option: %s -> %s", oe->name, s); + if (!args_has(args, 'q')) + ctx->info(ctx, "set option: %s -> %s", oe->name, s); return (0); } @@ -229,7 +232,7 @@ struct options_entry * cmd_set_option_string(struct cmd *self, unused struct cmd_ctx *ctx, const struct options_table_entry *oe, struct options *oo, const char *value) { - struct args *args = self->args; + struct args *args = self->args; struct options_entry *o; char *oldval, *newval; diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 64b57f8fa3d..e83f069d6d7 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.280 2012/03/12 13:31:09 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.281 2012/03/17 21:33:33 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 12 2012 $ +.Dd $Mdocdate: March 17 2012 $ .Dt TMUX 1 .Os .Sh NAME @@ -1788,7 +1788,7 @@ command. Commands which set options are as follows: .Bl -tag -width Ds .It Xo Ic set-option -.Op Fl agsuw +.Op Fl agqsuw .Op Fl t Ar target-session | Ar target-window .Ar option Ar value .Xc @@ -1816,6 +1816,12 @@ flag unsets an option, so a session inherits the option from the global options. It is not possible to unset a global option. .Pp +The +.Fl q +flag suppresses the informational message (as if the +.Ic quiet +server option was set). +.Pp Available window options are listed under .Ic set-window-option . .Pp @@ -2381,7 +2387,7 @@ The default is .Ql \ -_@ . .El .It Xo Ic set-window-option -.Op Fl agu +.Op Fl agqu .Op Fl t Ar target-window .Ar option Ar value .Xc @@ -2389,7 +2395,8 @@ The default is Set a window option. The .Fl a , -.Fl g +.Fl g , +.Fl q and .Fl u flags work similarly to the |