Moves platform specific functionality into its own module.
Thanks to @Meralis40 for starting this!
This also gets just building on windows \^_^/
Although a lot of tests still fail (✖╭╮✖)
The `PlatformInterface` trait contains functions which abstract
over platform specific functionality, with implementations for
different platforms behind #[cfg(*)] attributes.
- `make_shebang_command()` constructs a command which will execute
the given script as if by a shebang. On linux this executes the
file, on windows it runs the interpreter directly.
- `set_execute_permission()` sets the execute permission on a
file. This is a nop on windows, since all files are executable.
- `signal_from_exit_status()` extracts the signal a process was
halted by from its exit status, if it was halted by a signal.
Recipes may now have a final variadic parameter:
```make
foo bar+:
@echo {{bar}}
```
Variadic parameters accept one or more arguments, and expand to a string containing those arguments separated by spaces:
```sh
$ just foo a b c d e
a b c d e
```
I elected to accept one or more arguments instead of zero or more arguments since unexpectedly empty arguments can sometimes be dangerous.
```make
clean dir:
rm -rf {{dir}}/bin
```
If `dir` is empty in the above recipe, you'll delete `/bin`, which is probably not what was intended.
The grammar now permits blank lines in recipes.
Note that inside of recipes, the token `NEWLINE` is used instead of the
non-terminal `eol`. This is because an `eol` optionally includes a
comment, whereas inside recipes bodies comments get no special
treatment.
If a `#...` comment appears on the line immediately before a recipe, it
is considered to be a doc comment for that recipe.
Doc comments will be printed when recipes are `--list`ed or `--dump`ed.
Also adds some color to the `--list`ing.
Fixes#84
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