boolean/auto-boolean commands, make "o" ambiguous
authorPedro Alves <palves@redhat.com>
Wed, 12 Jun 2019 23:06:52 +0000 (00:06 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 12 Jun 2019 23:17:58 +0000 (00:17 +0100)
commitdee7b4c83a636471ee321fb4fe1c3be0a16a9ea7
tree7cca7c8f9d80b735aab6746745c9b13b68faba55
parentdca0f6c0a4bafff9039d8bdb2a7efec9f70ce82f
boolean/auto-boolean commands, make "o" ambiguous

We currently accept "o" with boolean/auto-boolean commands, taking it
to mean "on".  But "o" is ambiguous, between "on" and "off".  I can't
imagine why assuming the user wanted to type "on" is a good idea, it
might have been a typo.

This commit makes gdb error out.  We now get:

 (gdb) maint test-settings set boolean o
 "on" or "off" expected.

 (gdb) maint test-settings set auto-boolean o
 "on", "off" or "auto" expected.

gdb/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

* cli/cli-setshow.c (parse_auto_binary_operation)
(parse_cli_boolean_value): Don't allow "o".

gdb/testsuite/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

* gdb.base/settings.exp (test-boolean, test-auto-boolean): Check
that "o" is ambiguous.
gdb/ChangeLog
gdb/cli/cli-setshow.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/settings.exp