feat(tvix/cli): context-aware raw printing

Raw printing will transform the result into a string
and print it.

In case of a contextful string, this will fail by default, as expected.

Change-Id: I5e564329e7b001adc57a77a9153b4425cb332bb7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10457
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Ryan Lahfa 2023-12-29 19:18:08 +01:00 committed by raitobezarius
parent f44ac2a594
commit de6c8b7546

View file

@ -213,7 +213,7 @@ fn run_file(mut path: PathBuf, args: &Args) {
fn println_result(result: &Value, raw: bool) {
if raw {
println!("{}", result.to_str().unwrap().as_str())
println!("{}", result.to_contextful_str().unwrap().as_str())
} else {
println!("=> {} :: {}", result, result.type_of())
}