OpenCDSS / cdss-app-tstool-main

Colorado's Decision Support Systems (CDSS) TSTool application main program
GNU General Public License v3.0
1 stars 1 forks source link

Update command process to handle require comment that exits processing #182

Open smalers opened 3 years ago

smalers commented 3 years ago

I recently added the #@require user comment, which is used to ensure that the correct user runs a test command file. The main check is whether a user is normal user or root (sudo) user. The default behavior is that the command file should stop running. Otherwise, on Linux files are created with wrong permissions, and other impacts. The problem is that there is not a clean way for the main program to detect this and update the command status indicators. Other logic does work when Exit command is run.

The command process listener needs a way to return additional information to the listening code, such as whether processing should exit. There may be other cases in the future where an error condition requires exiting processing.