Jean-Michel Picod
dbe0412311
Simplify quote handling
2023-10-18 10:38:33 +02:00
Jean-Michel Picod
3b7cec365a
Support double-quoted arguments in CLI
...
When a quoted command argument is seen, it will take all characters
until the next double-quote (no supported escape sequence here for
simplicity).
All white spaces (space, tab, etc.) are then removed from the argument.
This means that the following command should behave the same:
```
pm3> wiegand encode --fc 101 --cn 1337
pm3> wiegand encode --fc "1 0 1" --cn "1 3 3 7"
```
Or a more useful example, when copy/pasting hex formatted values:
```
pm3> hf iclass calcnewkey --old 1122334455667788 --new 2233445566778899
pm3> hf iclass calcnewkey --old "11 22 33 44 55 66 77 88" --new "22 33 44 55 66 77 88 99"
```
2023-10-18 10:27:12 +02:00
iceman1001
d02e8daba0
Changed CLI max string argument length limit from 512 to 4096. data asn1
now handles 2048 hex bytes input
2023-03-12 09:53:23 +01:00
iceman1001
0ba072118e
calloc
2022-07-25 08:01:38 +02:00
Philippe Teuwen
34c56c6227
cliparser: Fix codeql warnings
2022-02-27 14:31:07 +01:00
iceman1001
b3731c6003
cppcheck fixes
2022-01-06 18:18:48 +01:00
Philippe Teuwen
88308ea727
typos
2021-10-10 01:35:45 +02:00
Philippe Teuwen
8ce20320b2
Fix segfault on 'rem <verylongline>'
2021-09-04 02:57:16 +02:00
Philippe Teuwen
3c31ee793d
make style
2021-07-08 09:53:50 +02:00
Oleg Moiseenko
a20db915df
Merge branch 'master' into desf_update2
2021-07-06 12:17:31 +03:00
merlokk
20696fb44a
make style
2021-07-06 12:16:19 +03:00
merlokk
84eb4e4597
try to fix coverity
2021-07-05 15:35:53 +03:00
merlokk
afbd80b906
cliparser CLIGetOptionList
2021-07-05 11:59:07 +03:00
Philippe Teuwen
d9fb6991a0
Remove cliparser from make help
2021-05-22 22:54:31 +02:00
Philippe Teuwen
7fbe4063b2
fix for script run & cliparser
2021-04-20 10:24:52 +02:00
iceman1001
26aeae1f3e
allow for larger strings (hex) to be input
2021-04-04 14:57:35 +02:00
iceman1001
8573695134
data bin2hex - now uses cliparser\n added a binary string input parser
2021-03-23 11:06:09 +01:00
iceman1001
0067a9b7fa
for commands with many params
2021-03-07 18:55:48 +01:00
iceman1001
ea5625c304
chg: cliparse error message unified to pm3 style
2021-01-29 20:35:18 +01:00
iceman1001
fdcc4b741c
fix lf em 4x05 write - pwd/data. t55xx chk - now uses cliparser, and color to cliparser empty message
2021-01-27 22:52:08 +01:00
iceman1001
2987fdb187
added warning prefix
2021-01-23 19:08:45 +01:00
iceman1001
ad1f3eae57
added some supprt fct for cliparser, to take a hex byte param and fall back to a default value, or specify how many bytes the param must be
2021-01-11 23:29:49 +01:00
iceman1001
f8c956e4ce
less printf
2020-11-13 16:05:02 +01:00
Philippe Teuwen
777cb5a8ce
make style
2020-11-02 01:46:47 +01:00
iceman1001
1732242ca4
only convert if there actually was a hexstring
2020-10-21 13:25:29 +02:00
Philippe Teuwen
e4aec4d282
Add ISOC99 to cliparser for %zu
2020-10-21 09:59:29 +02:00
iceman1001
be8d2fbd25
add u64_from_hex, no need to use 0x, thanks @mwalker33!\n reverse blocks when cloning for em4305/4469
2020-10-21 08:42:33 +02:00
Philippe Teuwen
29f1147aad
make style
2020-10-20 01:00:23 +02:00
iceman1001
c2d5a7d745
cliparser, making sure both hex and string arrays fits into max size of 256 bytes
2020-10-17 16:16:07 +02:00
mwalker33
bb59250eca
Cliparser fix
...
Fix CLIGetStrwithRetrun
Allows casting and requires the buffer length to be passed in.
Existing uses of the function have been updated.
2020-10-17 00:27:14 +02:00
iceman1001
64f9bb5e01
style
2020-10-06 18:00:00 +02:00
Philippe Teuwen
0339667e9e
cliparser: ignore extra spaces between options
2020-10-04 20:33:56 +02:00
iceman1001
4f4593d9fa
remove debugstatement
2020-10-04 18:54:43 +02:00
iceman1001
166e626c98
add u64_y support in argtable-cliparser.
2020-10-04 17:41:04 +02:00
iceman1001
ad494a152c
cliparser returns signed ints, to get unsigned 32 we need to use the double.
2020-10-04 16:13:17 +02:00
Philippe Teuwen
aa3d29e6ac
CLIParamStrToBuf: add string null terminator
2020-10-04 15:11:36 +02:00
iceman1001
dc9e16a4e1
add some defines to get double
2020-10-04 10:57:21 +02:00
mwalker33
68f0945d48
Update argtable3.c
...
Remove = when only long option
2020-10-03 20:21:16 +10:00
iceman1001
670e2fb6b0
standard form output (concatenated)
2020-10-03 11:48:52 +02:00
mwalker33
e6398674b0
Cliparser cleanup
...
Update to remove "=" from help text
update md file, fix typos and better notses for the options.
2020-10-03 19:06:01 +10:00
Philippe Teuwen
c3c59e35cb
make style
2020-09-30 14:27:19 +02:00
mwalker33
e724204978
cliparser cleanup 2
...
cmdhf14a.c, cmdhfido.c, cmdhficlass.c, cmdhfmf.c
menu help updates.
cliparser.c : tweak for readability with long examples.
2020-09-30 16:39:08 +10:00
mwalker33
561c5f779e
cliparser cleaning
...
checked cmdhf.c and cmddata.c and tweaked cliparser.c
2020-09-30 07:55:51 +10:00
mwalker33
38358e2e2a
Update cliparser.c
...
Change white to default user color
2020-09-30 07:28:05 +10:00
mwalker33
45ca5c416d
Update cliparser.c
...
Adjusted to meet RRG format style and color.
2020-09-29 20:21:34 +10:00
Ave
9c5c00d620
Allow writes up to 256 bytes with mfdes writedata
...
And change help text to say 256 instead of 0xFFFF.
Closes #977
2020-09-27 19:40:13 +03:00
iceman1001
61be7c7c30
chg: cliparse should have atleast same file_max_path_len
2020-06-10 13:31:57 +02:00
Philippe Teuwen
cb614f3f11
cliparser: generalize ctx usage
2020-06-10 11:34:33 +02:00
Philippe Teuwen
569107579e
Fix cliparser buffer allocation
2020-06-10 11:33:15 +02:00
iceman1001
653f5b4e5d
chg: make define
2020-06-02 13:35:16 +02:00