=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-show-options.c,v retrieving revision 1.19 retrieving revision 1.20 diff -c -r1.19 -r1.20 *** src/usr.bin/tmux/cmd-show-options.c 2013/03/24 09:54:10 1.19 --- src/usr.bin/tmux/cmd-show-options.c 2013/03/25 10:04:04 1.20 *************** *** 1,4 **** ! /* $OpenBSD: cmd-show-options.c,v 1.19 2013/03/24 09:54:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-show-options.c,v 1.20 2013/03/25 10:04:04 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 30,43 **** enum cmd_retval cmd_show_options_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_show_options_one(struct cmd *, struct cmd_q *, ! struct options *); enum cmd_retval cmd_show_options_all(struct cmd *, struct cmd_q *, const struct options_table_entry *, struct options *); const struct cmd_entry cmd_show_options_entry = { "show-options", "show", ! "gst:vw", 0, 1, ! "[-gsvw] [-t target-session|target-window] [option]", 0, NULL, NULL, --- 30,43 ---- enum cmd_retval cmd_show_options_exec(struct cmd *, struct cmd_q *); enum cmd_retval cmd_show_options_one(struct cmd *, struct cmd_q *, ! struct options *, int); enum cmd_retval cmd_show_options_all(struct cmd *, struct cmd_q *, const struct options_table_entry *, struct options *); const struct cmd_entry cmd_show_options_entry = { "show-options", "show", ! "gqst:vw", 0, 1, ! "[-gqsvw] [-t target-session|target-window] [option]", 0, NULL, NULL, *************** *** 62,67 **** --- 62,68 ---- struct winlink *wl; const struct options_table_entry *table; struct options *oo; + int quiet; if (args_has(self->args, 's')) { oo = &global_options; *************** *** 89,103 **** } } ! if (args->argc != 0) ! return (cmd_show_options_one(self, cmdq, oo)); ! else return (cmd_show_options_all(self, cmdq, table, oo)); } enum cmd_retval cmd_show_options_one(struct cmd *self, struct cmd_q *cmdq, ! struct options *oo) { struct args *args = self->args; const struct options_table_entry *table, *oe; --- 90,105 ---- } } ! quiet = args_has(self->args, 'q'); ! if (args->argc == 0) return (cmd_show_options_all(self, cmdq, table, oo)); + else + return (cmd_show_options_one(self, cmdq, oo, quiet)); } enum cmd_retval cmd_show_options_one(struct cmd *self, struct cmd_q *cmdq, ! struct options *oo, int quiet) { struct args *args = self->args; const struct options_table_entry *table, *oe; *************** *** 106,111 **** --- 108,115 ---- if (*args->argv[0] == '@') { if ((o = options_find1(oo, args->argv[0])) == NULL) { + if (quiet) + return (CMD_RETURN_NORMAL); cmdq_error(cmdq, "unknown option: %s", args->argv[0]); return (CMD_RETURN_ERROR); } *************** *** 122,127 **** --- 126,133 ---- return (CMD_RETURN_ERROR); } if (oe == NULL) { + if (quiet) + return (CMD_RETURN_NORMAL); cmdq_error(cmdq, "unknown option: %s", args->argv[0]); return (CMD_RETURN_ERROR); }