cli arg parser from lua #1160
Closed
cscherrNT
started this conversation in
Show and tell
Replies: 1 comment
-
I'm not looking for answers or anything, just putting this here in case someone needs something like this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Tl;Dr With the provided lua code, you can get a seperate arguments field and pass those arguments to the debugged application!
I was debugging a program that required large cli args, so I made a few functions and a lexer for arguments in lua, maybe someone can need it.
My config for the plugin directly:
require('custom.utils').tokenize_args
is a custom function:For example, parsing of
"--foo -asfj --data '{\"FOO\": \"BAR\"}' --file=/etc/passwd"
would give{ [1] = '--foo', [2] = '-asfj', [3] = '--data', [4] = '{"FOO": "BAR"}', [5] = '--file=/etc/passwd' }
See here for full example.
Beta Was this translation helpful? Give feedback.
All reactions