just
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseJust
Discovery
- Print justfile
just --dump - Print variable values
just --evaluate - Print detailed command-line syntax help
just --help - Print recipes with descriptions
just --list - Print recipe source
just --show <RECIPE> - Print recipes without descriptiosn
just --summary
Execution
- Run default recipe
just - Run specific recipe
just <RECIPE> - Run recipe with arguments
just <RECIPE> <ARG1> <ARG2
Syntax
just
executable := 'main'Just
查询命令
- 打印justfile内容
just --dump - 打印变量值
just --evaluate - 打印详细的命令行语法帮助
just --help - 打印带描述的recipe
just --list - 打印指定recipe的源码
just --show <RECIPE> - 打印不带描述的recipe
just --summary
执行命令
- 运行默认recipe
just - 运行指定recipe
just <RECIPE> - 运行带参数的recipe
just <RECIPE> <ARG1> <ARG2
语法示例
just
executable := 'main'compile main.c
compile main.c
compile:
cc main.c -o {{ executable }}
compile:
cc main.c -o {{ executable }}
run main
run main
run: compile
./{{ executable }}
run: compile
./{{ executable }}
run test
run test
test name: compile
./bin/test {{ name }}
test name: compile
./bin/test {{ name }}
start webserver
start webserver
serve port='8080':
python -m http.server {{port}}
serve port='8080':
python -m http.server {{port}}
publish current tag
publish current tag
publish:
#!/usr/bin/env bash
set -euxo pipefail
tag=
./bin/check-tag $tag
git push origin $tag
git describe --tags --exact-match
Notes
-----
The comment proceeding a recipe is used as its doc-comment, and included in
`just --list`.
By default, each line of a recipe runs in a fresh shell. Recipes whose bodies
start with `#!` are written to a file and executed as a script.
Commonly used commands and scripts should be turned into `just` recipes.publish:
#!/usr/bin/env bash
set -euxo pipefail
tag=
./bin/check-tag $tag
git push origin $tag
git describe --tags --exact-match
注意事项
-----
recipe前的注释会作为其文档注释,包含在`just --list`的输出中。
默认情况下,recipe的每一行都会在新的shell中运行。以`#!`开头的recipe内容会被写入文件并作为脚本执行。
常用的命令和脚本应转换为`just`的recipe。