Feature Request: Support dsc functions in executable args
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 523
- Forks
- 75
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 24
Description
Summary of the new feature / enhancement
It would be extremely convenient to support functions in the argument list for DSC resources.
Currently the only three ways to pass custom parameters to a process are:
- environment variables
- stdin
- An input argument of
{ "jsonInputArg": "-json"}or similar.
I would like to propose a 4th option. Strings generated by dsc functions.
This would massively decrease the need for custom programs whose only purpose is to deal with JSON.
Proposed technical implementation details (optional)
- Support
parser.parse_and_executefor each string within an "args" array. - Add a
jsonInputArg()function to obtain the object representing jsonInputArg.
For example, a custom resource to set a system wide git config variable would look like:
"schema": {
"embedded": {
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
],
"title": "git_config",
"type": "object"
}
}
"set": {
"executable": "git",
"args": [
"config",
"set",
"--system",
"[tryget(jsonInputArg(),'key')]",
"[tryget(jsonInputArg(),'value')]"
]
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the executable argument handling and the parser.parse_and_execute path mentioned in the issue. Trace how each string in an args array is processed, then implement and verify function evaluation there, including jsonInputArg() returning the jsonInputArg object so the example arguments produce the expected values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100