just/tests/completions.rs
Casey Rodarmor 85e8015702
Generate shell completion scripts with --completions (#572)
Make just print clap-generated shell completion scripts with `--completions`
command. Currently, Bash, Zsh, Fish, PowerShell, and Elvish are supported.

Additionally, the generated completion scripts are checked in to the
`completions` folder.
2020-01-15 01:20:38 -08:00

19 lines
351 B
Rust

use std::process::Command;
use executable_path::executable_path;
#[test]
fn output() {
let output = Command::new(executable_path("just"))
.arg("--completions")
.arg("bash")
.output()
.unwrap();
assert!(output.status.success());
let text = String::from_utf8_lossy(&output.stdout);
assert!(text.starts_with("_just() {"));
}