Skip to content

Commit a0239c3

Browse files
authored
fix: enable set positional-arguments in justfile (openai#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](https://github.com/casey/just/blob/515e806b5121a4696113ef15b5f0b12e69854570/README.md#L1131): ``` set positional-arguments printlen *args: /tmp/test-just/printlen.py "$@" ```
1 parent bdfa95e commit a0239c3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

codex-rs/justfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
set positional-arguments
2+
13
# Display help
24
help:
35
just -l
46

57
# `codex`
68
codex *args:
7-
cargo run --bin codex -- {{args}}
9+
cargo run --bin codex -- "$@"
810

911
# `codex exec`
1012
exec *args:
11-
cargo run --bin codex -- exec {{args}}
13+
cargo run --bin codex -- exec "$@"
1214

1315
# `codex tui`
1416
tui *args:
15-
cargo run --bin codex -- tui {{args}}
17+
cargo run --bin codex -- tui "$@"
1618

1719
# format code
1820
fmt:

0 commit comments

Comments
 (0)