fix: enable set positional-arguments in justfile (#1169)
The way these definitions worked before, they did not handle quoted args
with spaces properly.
For example, if you had `/tmp/test-just/printlen.py` as:
```python
#!/usr/bin/env python3
import sys
print(len(sys.argv))
```
and your `justfile` was:
```
printlen *args:
/tmp/test-just/printlen.py {{args}}
```
Then:
```shell
$ just printlen foo bar
3
$ just printlen 'foo bar'
3
```
which is not what we want: `'foo bar'` should be treated as one
argument.
The fix is to use
[positional-arguments](515e806b51/README.md (L1131)):
```
set positional-arguments
printlen *args:
/tmp/test-just/printlen.py "$@"
```
This commit is contained in:
@@ -1,18 +1,20 @@
|
|||||||
|
set positional-arguments
|
||||||
|
|
||||||
# Display help
|
# Display help
|
||||||
help:
|
help:
|
||||||
just -l
|
just -l
|
||||||
|
|
||||||
# `codex`
|
# `codex`
|
||||||
codex *args:
|
codex *args:
|
||||||
cargo run --bin codex -- {{args}}
|
cargo run --bin codex -- "$@"
|
||||||
|
|
||||||
# `codex exec`
|
# `codex exec`
|
||||||
exec *args:
|
exec *args:
|
||||||
cargo run --bin codex -- exec {{args}}
|
cargo run --bin codex -- exec "$@"
|
||||||
|
|
||||||
# `codex tui`
|
# `codex tui`
|
||||||
tui *args:
|
tui *args:
|
||||||
cargo run --bin codex -- tui {{args}}
|
cargo run --bin codex -- tui "$@"
|
||||||
|
|
||||||
# format code
|
# format code
|
||||||
fmt:
|
fmt:
|
||||||
|
|||||||
Reference in New Issue
Block a user