Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecoverable exit status vs duplication found exit status #37

Closed
nickroth opened this issue Feb 29, 2016 · 1 comment
Closed

Unrecoverable exit status vs duplication found exit status #37

nickroth opened this issue Feb 29, 2016 · 1 comment

Comments

@nickroth
Copy link

Currently, it is possible for a configuration error or file system (e.g. file not found) errors to have the same exit code as if the tool found offending matches. Is it possible for the tool to return a negative result to indicate an unrecoverable error and a positive result to indicate that the tool ran without error but found problems? This should make it easier for users integrating the tool to distinguish problems with an environment or script vs search results from the tool.

@danielstjules
Copy link
Owner

Can you point to examples where negative status codes are found? It's unclear to me how common that approach is, and whether or not it's considered bad style.

Perhaps I shouldn't overload the exit code to report the number of matches here https://github.com/danielstjules/jsinspect/blob/master/bin/jsinspect#L113

Instead, a better practice might be:
0 - success (no matches)
1 - any general error
3 - failing to load paths
4 - failing to run jsinspect
5 - failing due to matches being found

2 is skipped since it appears to be reserved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants