krieselreihe / litr

Litr (Language Independent Task Runner) lets you configure and then run any tasks you want for any language.
MIT License
8 stars 0 forks source link

Better error messages for Parser and Scanner #19

Closed MartinHelmut closed 3 years ago

MartinHelmut commented 3 years ago

Scanning and Parsing the command line arguments should return descriptive, helpful errors for a user. The current errors are vague and sometimes not explicit enough.

MartinHelmut commented 3 years ago

This needs also be applied to the script parser.

MartinHelmut commented 3 years ago

Following changes to errors are made:

This is then how it now looks like (without colouring):

Error: Parameter format is wrong!
  → /Users/martin/Projects/krieselreihe/litr/litr.toml
12 | [params.targete]
   | └─ You're missing the "description" field.
 ...
13 | shortcut = 12
   |          └─ A "shortcut" can only be a string.