From 6fc0ddcf1560db0573071335a648d807b338fe57 Mon Sep 17 00:00:00 2001 From: Iceman Date: Sun, 4 Oct 2020 22:19:08 +0200 Subject: [PATCH] Update cliparser.md --- doc/cliparser.md | 62 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/doc/cliparser.md b/doc/cliparser.md index 0114525bc..cba87777a 100644 --- a/doc/cliparser.md +++ b/doc/cliparser.md @@ -103,38 +103,48 @@ e.g. lf indala clone -r a0000000a0002021 -> this uses ..... }; _All options has a parameter index, since `-h --help` is added automatic, it will be assigned index 0. -Hence all options you add will start at index 1 and upwards._ +Hence all options you add will start at index 1 and upwards. It added in the define "arg_param_begin_ -**Notes:** -**bool option. true if supplied** -bool : arg_lit0 ("\", "\", \<"description"\>) +### Notes: +#### bool option. true if supplied +`bool : arg_lit0 ("", "", <"description">)` -**integer that is optional** - optional integer : arg_int0 ("\", "\", "\", \<"description"\>) +#### integer that is optional +`optional integer : arg_int0 ("", "", "", <"description">)` -**integer that is required** - required integer : arg_int1 ("\", "\", "\", \<"description"\>) +#### integer that is required +`required integer : arg_int1 ("", "", "", <"description">)` -**double that is optional** - optional double : arg_dbl0 ("\", "\", "\", \<"description"\>) +#### double that is optional +`optional double : arg_dbl0 ("", "", "", <"description">)` -**double that is required** - required double : arg_dbl1 ("\", "\", "\", \<"description"\>) +#### double that is required +`required double : arg_dbl1 ("", "", "", <"description">)` -**String option that is optional and only one instance can be provided** - optional string : arg_str0("\", "\", "\", \<"description"\>) +#### String option that is optional and only one instance can be provided +`optional string : arg_str0 ("", "", "", <"description">)` -**String option that is required and only one instance can be provided** - required string : arg_str1("\", "\", "\", \<"description"\>) +#### String option that is required and only one instance can be provided +`required string : arg_str1 ("", "", "", <"description">)` -**String option that is optional and can have up to 250 instances provided** - optional string : arg_strx0 ("\", "\", "\", \<"description"\>) +#### String option that is optional and can have up to 250 instances provided +`optional string : arg_strx0 ("", "", "", <"description">)` + +#### String option that is required/at least one instance and can have up to 250 instances +`required string : arg_strx1 ("", "", "", <"description">)` + +Unsigned values, like u32 and u64 can be accomplished with + +#### unsigned integer optional +`optional unsigned : arg_u64_0 ("", "", "", <"description">)` + +#### unsigned integer required +`required unsigned : arg_u64_1 ("", "", "", <"description">)` -**String option that is required/at least one instance and can have up to 250 instances** - required string : arg_strx1 ("\", "\", "\", \<"description"\>) **if an option does not have a short or long option, use NULL in its place** + ### show the menu `CLIExecWithReturn(\, \, \, \);` @@ -162,6 +172,18 @@ arg_get_int_def(\, \, \); cardnumber = arg_get_int_def(ctx, 2, -1); + +**uint32** +arg_get_u32_def(\, \, \); + + cardnumber = arg_get_u32_def(ctx, 2, 0); + +**uint64** +arg_get_u64_def(\, \, \); + + cardnumber = arg_get_u64_def(ctx, 2, 0); + + **hex option** CLIGetHexWithReturn(\, \, \, \); ?? as an array of uint_8 ??