dpwright / srs

A highly extensible command-line spaced repetition system
BSD 2-Clause "Simplified" License
57 stars 3 forks source link

Crash when passing the wrong parameters to get-field #12

Closed dpwright closed 12 years ago

dpwright commented 12 years ago

If you follow the advice given in the example:

$ SCHEDULE=$(srs next-new); EXERCISE=$(srs get-field exercise $SCHEDULE); srs do-exercise $EXERCISE

when there are no cards due $SCHEDULE will be empty, so srs get field will only be passed the one parameter, which causes it to crash. It should be more robust in the case of unexpected input (so should all the commands, really....)