pros-cli
pros-cli copied to clipboard
✨Expansion on project.pros upload_options fields
Requested Feature
Currently in project.pros, there is a field called upload_options that allows users to specify default options for the upload command that will be applied by default, unless that option is provided in the command call.
This section is also used in conjunction pros-vsc and the project.pros view to allow the sidebar upload button to have options applied to it.
I would like to expand on this section of project.pros. Essentially, we will replace
"upload_options":
{
"icon": "alien"
}
with
"default_options": {
"upload": {
"icon": "alien",
"slot": 1,
"extra": "--verbose --no-analytics"
},
"build": {
"extra": "--verbose --no-analytics -- -j8"
},
}
The vscode project.pros view will have a default options view for all sidebar buttons. Users who wish to add default options for non sidebar commands can open project.pros with something other than the PROS view and edit the json.
While it is possible to just go into each CLI command and add code to get the correct options from project.pros and apply them to the command call without overriding any options specified in the call (similar to how the upload options work as of now, at second glance it is kinda messy sorry ☹️),
this is very inefficient if we have to do it for every command. We should find a way to do this at the beginning.
example flow:
pros upload --slot 5 is called -> click gets the command and kwargs -> we open project.pros and match the command to the correct default options, adding those options as needed -> click then calls the command function, passing this edited kwargs instead of the original
Is this Feature Related to a Problem?
https://www.vexforum.com/t/pros-make-using-multicore-builds/124910/
Benefits of Feature
Fixes my bad code and makes it expandable for the future
Extra note now that I’ve had a few days to think about this. We want all of these fields to exist in both cli.pros and project.pros. There will need to be a vscode ui for this, similar to project.pros upload_options. Priority for the options will be specified in command > specified in project.pros > specified in cli.pros > specified in cli source as default.