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

Meaningful confirmation and error messages #2

Open
2 tasks
dessert1 opened this issue Feb 10, 2018 · 2 comments
Open
2 tasks

Meaningful confirmation and error messages #2

dessert1 opened this issue Feb 10, 2018 · 2 comments

Comments

@dessert1
Copy link
Contributor

Here are some return messages one currently sees (I omitted the traceback output of hatc -a free):

$ hatc -a free "now + 1 min"
{'msg': 'Done'}
$ hatc -m 1 _ "now + 2 min"
{'msg': 'Done'}
$ hatc -r1
{'msg': 'Queued'}
$ hatc -l
Job queue is empty
$ hatc -r1
{'msg': 'Queued'}
$ hatc -m 1 _ "now + 2 min"
{'error': {'msg': '1'}}
  • -a, -m and -r should return a confirmative message, e.g.

    $ hatc -a free "now + 1 min" bash
    Added job 1: free in bash at 2018-02-10T19:32:45
    $ hatc -a "free -m" "now + 10 min"
    Added job 2: free -m without a shell at 2018-02-10T19:32:50
    $ hatc -m 1 free "now + 2 min" bash
    Modified job 1: free in bash at 2018-02-10T19:33:57
    $ hatc -r2
    Removed job 2: free -m without a shell at 2018-02-10T19:32:50
    
  • All three should inform whether a job was actually added/modified/deleted and which it was – if it fails, it should print the job queue, but of course only if it's not empty.

    $ hatc -a free
    Error: Missing time specification, consult hatc --help for usage information.
    $ hatc -a free garbage
    Error: Unrecognized time specification, consult hatc --help for usage information.
    $ hatc -a "" "now + 1 min"
    Error: Missing command specification, consult hatc --help for usage information.
    $ hatc -r2
    There's currently no job 2 in the job queue.
    [imagine output of hatc -l with a job 1 in it here]
    $ hatc -r1
    Removed job 1: free in bash at 2018-02-10T19:33:57
    $ hatc -r1
    Job queue is empty.
    
@dessert1
Copy link
Contributor Author

dessert1 commented Feb 10, 2018

Just discovered “No backward time travel support” and it made me laugh – keep this easter egg, but make it a proper error message as well please.

@heemayl
Copy link
Owner

heemayl commented Feb 11, 2018

@dessert1 😸 . In the queue.

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