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

Command Line Return Code should be 0 #11

Closed
ikreymer opened this issue Nov 25, 2020 · 0 comments
Closed

Command Line Return Code should be 0 #11

ikreymer opened this issue Nov 25, 2020 · 0 comments
Assignees

Comments

@ikreymer
Copy link
Member

We now have the 0 return code in:

if __name__ == "__main__":
    sys.exit(0 if main() else 1)

which works only if calling main.py directly.
For the installed wacz script to return 0, we really should have the main() function itself return 0 if success, non-zero if error.
Currently, it returns true if success/valid, false otherwise.
Or, can wrap it in another function that is used by the setup.py wacz script, that may be simpler, but also less consistent.
In the end, it probably makes sense to be able to have:

if main['validate', '-f', 'file.wacz'] == 0:
   print('success!')

since that's close to what it would be in a shell script also..

@edsu edsu transferred this issue from webrecorder/specs Nov 24, 2021
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