Signature
DValue cli_input(Request& context)
Returns a structured parameter tree for a CLI(Request& context) invocation.
cli_input() merges simple command inputs into one DValue:
query parameters from
context.getform parameters from
context.postJSON object fields from an
application/jsonor*+jsonrequest body
Later sources override earlier ones, so a JSON body can override a query or form key with the same name.
If the JSON body is a scalar or array instead of an object, the decoded value is stored under input["_"].
Convenience script usage:
Example
DValue input = cli_input(context);
print("parsed ", input.keys().size(), " CLI arguments\n");
Output
parsed 1 CLI arguments