-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Open
Labels
enhancementa request to improve CLIa request to improve CLIneeds-investigationCLI team needs to investigateCLI team needs to investigate
Description
Describe the feature or problem you’d like to solve
There are times where it would be useful to be able to pass through arbitrary arguments to a --jq script without needing to result to hacks such as using shell variables/etc to unsafely inject content into the script.
⇒ jq -h
..snip..
--arg name value set $name to the string value;
--argjson name value set $name to the JSON value;
--slurpfile name file set $name to an array of JSON values read
from the file;
--rawfile name file set $name to string contents of file;
--args consume remaining arguments as positional
string values;
--jsonargs consume remaining arguments as positional
JSON values;
..snip..
This would allow us to do things like pass through a user choice from the CLI args to a script that supports multiple options (eg. this script could support both grouped and ungrouped without resorting to "please uncomment the block you want: #659 (comment))
Proposed solution
Allowing more flexibility to safely pass arguments into the --jq scripts without resorting to hacks such as unsafely injecting shell variables into the script (and then needing to manually escape everything else the shell might interpret within the script)
Additional context
See also:
Spoiledme and Qtax
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIneeds-investigationCLI team needs to investigateCLI team needs to investigate