Stabilize JSON dump format (#1633)
This commit is contained in:
parent
f44abdf024
commit
f04de75609
@ -2313,8 +2313,7 @@ $ just --dump > formatted-justfile
|
|||||||
```
|
```
|
||||||
|
|
||||||
The `--dump` command can be used with `--dump-format json` to print a JSON
|
The `--dump` command can be used with `--dump-format json` to print a JSON
|
||||||
representation of a `justfile`. The JSON format is currently unstable, so the
|
representation of a `justfile`.
|
||||||
`--unstable` flag is required.
|
|
||||||
|
|
||||||
### Fallback to parent `justfile`s
|
### Fallback to parent `justfile`s
|
||||||
|
|
||||||
|
@ -329,7 +329,6 @@ impl Subcommand {
|
|||||||
fn dump(config: &Config, ast: Ast, justfile: Justfile) -> Result<(), Error<'static>> {
|
fn dump(config: &Config, ast: Ast, justfile: Justfile) -> Result<(), Error<'static>> {
|
||||||
match config.dump_format {
|
match config.dump_format {
|
||||||
DumpFormat::Json => {
|
DumpFormat::Json => {
|
||||||
config.require_unstable("The JSON dump format is currently unstable.")?;
|
|
||||||
serde_json::to_writer(io::stdout(), &justfile)
|
serde_json::to_writer(io::stdout(), &justfile)
|
||||||
.map_err(|serde_json_error| Error::DumpJson { serde_json_error })?;
|
.map_err(|serde_json_error| Error::DumpJson { serde_json_error })?;
|
||||||
println!();
|
println!();
|
||||||
|
@ -705,16 +705,6 @@ fn quiet() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn requires_unstable() {
|
|
||||||
Test::new()
|
|
||||||
.justfile("foo:")
|
|
||||||
.args(["--dump", "--dump-format", "json"])
|
|
||||||
.stderr("error: The JSON dump format is currently unstable. Invoke `just` with the `--unstable` flag to enable unstable features.\n")
|
|
||||||
.status(EXIT_FAILURE)
|
|
||||||
.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn settings() {
|
fn settings() {
|
||||||
test(
|
test(
|
||||||
|
Loading…
Reference in New Issue
Block a user