-
Notifications
You must be signed in to change notification settings - Fork 498
Feature Ideas
Potential just
features, many ill-considered or silly.
probably spelled like rust's:
x := if foo == "bar" { "baz" } else { "bob" }
to do this well we would need a bool type, which would imply a type system
A recipe literal syntax that would create anonymous recipes that could be assigned to variables and called in expressions. On possibility is |arg arg|
definitions and (name arg...)
calls
x := |foo|
echo {{foo}}
bar := (x "bar")
A concise one-line syntax would also possible:
x := |foo| echo {{foo}}
bar := (x "bar")
Since this would introduce a recipe type, this would imply a quite complex type system.
Variables whose values are paths, allowing for convenient path manipulation and a cross platform representation.
An online repository where users can submit just commands, which can then be given names in a registry. Lots of security and other considerations here, but it would allow people to share just recipes.
If people see a file called Justfile
they might just ignore it. If it were called Commands
or something like that, its purpose would probably be much more obvious to someone not familiar with the tool
# the `raw` annotation prevents interpolation
# so this recipe will print "{{foo}}"
@raw
default:
echo {{foo}}
# the `private` annotation makes a recipe private,
# and gives a hard error if referred to from the
# command line or from another module
@private
bar:
echo hello
type integer := '[1-9][0-9]+'
foo bar/integer baz/integer:
#!/usr/bin/env python3
print({{bar}} + {{baz}})
inline submodules:
foo::
bar:
echo baz
baz: foo::bar
$ just foo bar
baz
$ just baz
baz
Any non-alphanumeric unicode can be used in recipe or variable names:
世界:
echo 'こんにちは世界'
message := "warning: foo".red()`
foo:
echo {{message}}
Just currently reports one error per run, but the parser could be extended to report all errors encountered.
Just doesn't have a dedicated comment syntax, and introducing one would allow multi-line doc comments, which would be nice:
## for doc comments, allow multi-line doc comments
## only first line is displayed in --list
foo:
echo bar
backtick, double quote, single quote, and interpolation doubling:
"foo""bar" -> foo"bar
`echo ``echo foo``` -> echo `echo foo`
'foo''bar' -> foo'bar
{{{{ foo }} -> {{ foo }}
foo := r##"
asdf
asdf
asdf
"##
foo := '''
'bar'
'baz'
'yar'
'''
foo := ```
echo foo
echo bar
echo baz
```
bar:
echo {{foo}}
$ just bar
foo
bar
baz