diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-27 18:47:03 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-27 19:04:41 +0000 |
| commit | facfee22f55631992113af5606cf8ade069684b3 (patch) | |
| tree | b7ca477d3a90724929f2af749b09bdd6306ae8a6 /lib/command.c | |
| parent | 5ce1d8b118ae85765d135aaf06bf04a554607d12 (diff) | |
*: remove VTY_GET_*
CLI validates input tokens, so there's no need to do it in handler
functions anymore.
spatch follows
----------------
@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>
@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>
@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>
@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>
@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/command.c b/lib/command.c index 5853710999..56fedf0914 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2345,8 +2345,7 @@ DEFUN (config_log_timestamp_precision, "Number of subsecond digits\n") { int idx_number = 3; - VTY_GET_INTEGER_RANGE("Timestamp Precision", - zlog_default->timestamp_precision, argv[idx_number]->arg, 0, 6); + zlog_default->timestamp_precision = strtoul(argv[idx_number]->arg, NULL, 10); return CMD_SUCCESS; } |
