-
Type:
Story
-
Status: Done
-
Priority:
High
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.17.0
-
Component/s: None
-
Labels:None
-
Story Points:8
It would be nice if there were a function that would allow me to inspect the return code and output from a command execution, combining some of the usefulness of returnszero() and execresult().
Perhaps data_execresult() where instead of returning a string or a class, it would return a data container that included the return code and output.
Example data container returned
{ "returncode": "0", "output": "I've got a lovely bunch of coconuts." }
As indicated in CFE-3108, it would be nice to have the ability to differentiate ate between stderr and stdout.
Example more detailed data container returned when desire capture of stderr
{ "returncode": "0", "output": "ERROR: palm trees don't grow here." }
Example more detailed data container returned when desire capture of interleaved/both stderr and stdout
{ "returncode": "0", "output": "I've got a lovely bunch of coconuts. ERROR: palm trees don't grow here." }
- relates to
-
CFE-3108 Add optional argument to execresult() enabling selection of output to capture (stderr, stdout, both)
-
- Done
-