Some ugly code, but not as bad as I thought.
Elected not to go with indentation based line continuations. Too many
weird edge cases and feels like a gratuitious incompatibility with make.
Fixes#9
Looks like this:
```make
recipe argument default-argument='default value':
echo argument is {{argument}}
echo default-argument is {{default-argument}}
```
Thanks @deckarep for the feature request!
Fixes#49
Already implemented Display for Justfile, so no reason not to expose it
to the user.
Also only allow one of --list, --dump, or --show, since they don't make
a lot of sense together.
Input may contain tabs and other characters whose byte widths do not
correspond to their display widths. This causes error context
underlining to be off when lines contain those characters
Fixed by properly accounting for the display width of characters, as
well as replacing tabs with spaces when printing error messages.
This is a pretty gross commit, since it also includes a lot of
unrelated refactoring, especially of how error messages are printed.
Also adds a lint recipe that prints lines over 100 characters
To test, I added a `--color=[auto|always|never]` option that defaults to
auto in normal use, but can be forced to `always` for testing. In `auto`
mode it defers to `atty` to figure out if the current stream is a
terminal and uses color if so.
Color printing is controlled by the `alternate` formatting flag.
When printing an error message, using `{:#}` will print it with colors
and `{}` will print it normally.
I was using the width of the index of the line, not the displayed line
number, which is the index + 1, which could cause the error message to
be misaligned.
Fixed it, and added a test that checks for this.
I had previously not included the line for some error messages, but I
don't think that I had a good reason why, and they look pretty good,
so adding them back for consistency.
Surround variables with backticks, capitalize first letter of error
message, inflect properly depending on number of unknown overrides, and
improve wording.
Also added build dependency to `filter` recipe.