Propagate appropriate exit codes to CLI
iamfaisalkhan opened this issue · comments
Faisal Khan commented
Following the convention in some other popular vuln scanning tools, we are going to use the following cli exit codes.
Exit Code | Purpose |
---|---|
0 | Scan completed successfully, no vulnerabilities found |
1 | Scan completed successfully, vulnerabilities found |
2 | Failure, modelscan threw an error while scanning |
3 | No supported files were passed to the tool |
4 | Usage error, CLI was passed invalid or incomplete options |
Acceptance Criteria
- Upon successful completion of the scan check exit with code 0 for no vulns and 1 when vulns were found.
- Upon successful completion of the scan check if no files were scanned and report the error code 3.
- Add exception hook to catch any uncaught exception or runtime error and set the exit code to 2
- Set the exit code to 4 on usage error
- Document exit code in the README.md