|
The proposed output, when run with multiple parameters, would be:
{
|
"option1" : {
|
"result" : { }
|
},
|
"option2" : {
|
"errMsg" : "..."
|
}
|
"ok" : 0
|
}
|
The behavior of command execution then, would need to be:
1. Make sure the user isn't trying to set the same parameter twice, and return an error if that is the case
2. Attempt to set the parameters in order, populating the result object as we go
3. On failure, add an entry with "errMsg" to the result object
4. Set "ok" depending on whether we had a failure
Note that when setting multiple parameters, this means that if we have an error, parameters that would have been set after the error won't appear in the result object, while parameters set before the error will have result subobjects.
|