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

Detect out-of-order dates in the CLI version #12

Closed
borfast opened this issue Dec 9, 2016 · 6 comments
Closed

Detect out-of-order dates in the CLI version #12

borfast opened this issue Dec 9, 2016 · 6 comments

Comments

@borfast
Copy link
Owner

borfast commented Dec 9, 2016

In the CLI version, if the user passes two dates as arguments and the first date is after the second date, arrispwgen exits with an exception thrown by the library.

The CLI version should catch the exception and exit gracefully, telling the user what the problem was.

@thewhisperinyourears
Copy link

I think it should better dont exit at all but display error and ask user for retry

@borfast
Copy link
Owner Author

borfast commented Dec 13, 2016

It's also a possibility, yes. I'm not sure if it's worth the extra effort, though. The difference is simply that if the program exits, the user has have to type "arrispwgen" again (besides the two dates, of course).

@thewhisperinyourears
Copy link

thewhisperinyourears commented Dec 13, 2016 via email

@borfast
Copy link
Owner Author

borfast commented Dec 13, 2016

The terminal will only exit if you launch the program by double-clicking the script directly, which you normally will not do because it is installed in a "hard to reach" location and because you need to pass some arguments to it. Also, if the terminal exits when the program exits (making it implicit that you launched it via double-clicking), it means you didn't pass it any arguments, and thus the program will simply output the current day's password and exit, which means the terminal will also exit and you won't be able to see anything.

In summary: I may be missing something but I don't see a case where the program exiting after being used in a normal way would cause the terminal to exit.

Could you provide an example of such a situation?

@thewhisperinyourears
Copy link

thewhisperinyourears commented Dec 13, 2016 via email

@borfast
Copy link
Owner Author

borfast commented Jan 29, 2017

Fixed.

@borfast borfast closed this as completed Jan 29, 2017
@borfast borfast reopened this Jan 29, 2017
@borfast borfast closed this as completed Jan 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants