summaryrefslogtreecommitdiffstats
path: root/cmd-set-option.c
diff options
context:
space:
mode:
authornicm <nicm>2015-07-27 08:45:45 +0000
committernicm <nicm>2015-07-27 08:45:45 +0000
commitd33adc4fd0f7657ede3178c9b1f33c2d5df3c524 (patch)
tree36a067af3779a9d93b466c1d0982ebc5f781c0f9 /cmd-set-option.c
parent92af3766ecc456bd8ade8fe5746d27f4557fdaa8 (diff)
Make -q suppress ambiguous option warnings too, from Cam Hutchison.
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r--cmd-set-option.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index 77c7d7c2..761cee93 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -110,8 +110,11 @@ cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
/* Find the option entry, try each table. */
table = oe = NULL;
if (options_table_find(optstr, &table, &oe) != 0) {
- cmdq_error(cmdq, "ambiguous option: %s", optstr);
- return (CMD_RETURN_ERROR);
+ if (!args_has(args, 'q')) {
+ cmdq_error(cmdq, "ambiguous option: %s", optstr);
+ return (CMD_RETURN_ERROR);
+ }
+ return (CMD_RETURN_NORMAL);
}
if (oe == NULL) {
if (!args_has(args, 'q')) {