parent
edbd94d654
commit
7cfc37f647
@ -148,11 +148,11 @@ string-with-slash = "\\"
|
||||
```sh
|
||||
$ just --evaluate
|
||||
"tring-with-carriage-return = "
|
||||
string-with-double-quote = """
|
||||
string-with-newline = "
|
||||
string-with-double-quote = """
|
||||
string-with-newline = "
|
||||
"
|
||||
string-with-slash = "\"
|
||||
string-with-tab = " "
|
||||
string-with-slash = "\"
|
||||
string-with-tab = " "
|
||||
```
|
||||
|
||||
Single-quoted strings do not support any escape sequences:
|
||||
|
@ -624,18 +624,18 @@ fn evaluate() {
|
||||
&["--evaluate"],
|
||||
r#"
|
||||
foo = "a\t"
|
||||
baz = "c"
|
||||
hello = "c"
|
||||
bar = "b\t"
|
||||
abc = foo + bar + baz
|
||||
ab = foo + bar + hello
|
||||
|
||||
wut:
|
||||
touch /this/is/not/a/file
|
||||
"#,
|
||||
0,
|
||||
r#"abc = "a b c"
|
||||
bar = "b "
|
||||
baz = "c"
|
||||
foo = "a "
|
||||
r#"ab = "a b c"
|
||||
bar = "b "
|
||||
foo = "a "
|
||||
hello = "c"
|
||||
"#,
|
||||
"",
|
||||
);
|
||||
|
@ -19,7 +19,7 @@ extern crate edit_distance;
|
||||
|
||||
use std::io::prelude::*;
|
||||
|
||||
use std::{fs, fmt, process, io};
|
||||
use std::{fs, fmt, process, io, cmp};
|
||||
use std::ops::Range;
|
||||
use std::fmt::Display;
|
||||
use regex::Regex;
|
||||
@ -1093,8 +1093,13 @@ impl<'a, 'b> Justfile<'a> where 'a: 'b {
|
||||
|
||||
let scope = evaluate_assignments(&self.assignments, &options.overrides, options.quiet)?;
|
||||
if options.evaluate {
|
||||
let mut width = 0;
|
||||
for name in scope.keys() {
|
||||
width = cmp::max(name.len(), width);
|
||||
}
|
||||
|
||||
for (name, value) in scope {
|
||||
println!("{} = \"{}\"", name, value);
|
||||
println!("{0:1$} = \"{2}\"", name, width, value);
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user