mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-04 02:40:32 +08:00
Improvements to the CLI output as well as converging towards `termion` as a backend. The crates we were using for prompting and spinners were based on a terminal backend called `console`, which is not really used anywhere else. There were also limitations in terms of the output of these crates. Therefore, we switched to the `inquire` crate for prompting, using the `termion` backend, which is very standard. Additionally, we simplify the terminal output to use symbols: ! for Warning ✓ for Success ✗ for Error ... Instead of a mix of words and symbols. We also include a modified version of the `yansi` crate which plays well with our table formatting functions by automatically truncating and padding output in a unicode-aware way.
radicle-cli-test
Test your CLI with the help of markdown descriptions.
Example
Test flows are described in markdown like this example:
# Echoing works
When I call echo, it answers:
```
$ echo "ohai"
ohai
```
Say this is placed in kind-echo.md, this is what the corresponding test case
would look lke:
use std::path::Path;
use radicle_cli_test::TestFormula;
#[test]
fn kind_echo() {
TestFormula::new()
.file(Path::new("./kind-echo.md"))
.unwrap()
.run()
.unwrap();
}