Skip to content

Commit

Permalink
fixed multiple occurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
cchexcode committed Mar 7, 2023
1 parent 493d604 commit 1c47a3e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ impl ClapArgumentLoader {
.arg(clap::Arg::new("value")
.short('v')
.long("value")
.action(ArgAction::Append)
.help("Overrides a certain value definition with a string.")))
}

Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,9 @@ mod tests {
fn template_helper() {
assert!("bananarama" == exec(&format!("cargo run -- render -c {} -t helper --trust", CONFIG_PATH)).unwrap())
}

#[test]
fn template_vals_multiple() {
assert!("alpha\nbravo" == exec(&format!("cargo run -- render -c {} --trust -t vals:multiple -v a.alpha=alpha -v b.bravo=bravo", CONFIG_PATH)).unwrap())
}
}
10 changes: 10 additions & 0 deletions test/.complate/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ templates:
values:
a.alpha:
shell: 'printf "alpha"'
"vals:multiple":
content:
inline: |-
{{ a.alpha }}
{{ b.bravo }}
values:
a.alpha:
shell: "exit 1"
b.bravo:
shell: "exit 1"
override:
content:
inline: |-
Expand Down

0 comments on commit 1c47a3e

Please sign in to comment.