summaryrefslogtreecommitdiff
path: root/src/helper/command.h
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-18 12:41:20 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-18 15:51:07 -0800
commit4d8d1d32d0f0e0b8866a06cb1d3f304563fa6796 (patch)
tree753fd02c4efe2ced061dd0706f8b4cfb15064ed9 /src/helper/command.h
parent7e4adfe1c53aa18d4feba1e58ceb5c5aaa470775 (diff)
downloadopenocd+libswd-4d8d1d32d0f0e0b8866a06cb1d3f304563fa6796.tar.gz
openocd+libswd-4d8d1d32d0f0e0b8866a06cb1d3f304563fa6796.tar.bz2
openocd+libswd-4d8d1d32d0f0e0b8866a06cb1d3f304563fa6796.tar.xz
openocd+libswd-4d8d1d32d0f0e0b8866a06cb1d3f304563fa6796.zip
change all bool parsers to accept any value
This patch changes the behavior of all boolean parsing callers to accept any one of "true/enable/on/yes/1" or "false/disable/off/no/0". Since one particular pair will be most appropriate in any given situation, the specific macros should continue to be used in order to display the most informative error messages possible.
Diffstat (limited to 'src/helper/command.h')
-rw-r--r--src/helper/command.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/helper/command.h b/src/helper/command.h
index 06403eff..a2e97970 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -272,7 +272,7 @@ DECLARE_PARSE_WRAPPER(_s8, int8_t);
#define COMMAND_PARSE_BOOL(in, out, on, off) \
do { \
bool value; \
- int retval = command_parse_bool(in, &value, on, off); \
+ int retval = command_parse_bool_arg(in, &value); \
if (ERROR_OK != retval) { \
command_print(CMD_CTX, stringify(out) \
" option value ('%s') is not valid", in); \
@@ -283,8 +283,7 @@ DECLARE_PARSE_WRAPPER(_s8, int8_t);
out = value; \
} while (0)
-int command_parse_bool(const char *in, bool *out,
- const char *on, const char *off);
+int command_parse_bool_arg(const char *in, bool *out);
COMMAND_HELPER(handle_command_parse_bool, bool *out, const char *label);
/// parses an on/off command argument