1dbc765390
Add a subcommand that prints out a space-separated list of the names of top-level variables in the justfile. The syntax is: $ just --variables a b c This can be used for any purpose, but is mostly intended for completion scripts, so that they can get the names of variables without using `--evaluate`. Additionally: - Add `bin/generate-completions` script to regenerate checked-in completions - Update dependencies - Regenerate checked-in completions |
||
---|---|---|
.. | ||
completions.rs | ||
edit.rs | ||
init.rs | ||
integration.rs | ||
interrupts.rs | ||
invocation_directory.rs | ||
readme.rs | ||
search.rs | ||
shell.rs | ||
working_directory.rs |
use std::{fs, process::Command}; use executable_path::executable_path; use test_utilities::{assert_success, tempdir}; #[test] fn readme() { let mut justfiles = vec![]; let mut current = None; for line in fs::read_to_string("README.adoc").unwrap().lines() { if let Some(mut justfile) = current { if line == "```" { justfiles.push(justfile); current = None; } else { justfile += line; justfile += "\n"; current = Some(justfile); } } else if line == "```make" { current = Some(String::new()); } } for justfile in justfiles { let tmp = tempdir(); let path = tmp.path().join("justfile"); fs::write(&path, &justfile).unwrap(); let output = Command::new(executable_path("just")) .current_dir(tmp.path()) .arg("--dump") .output() .unwrap(); assert_success(&output); } }