summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJovansonlee Cesar <ivanceras@gmail.com>2023-08-10 23:39:32 +0800
committerGitHub <noreply@github.com>2023-08-10 23:39:32 +0800
commit608db0bbc4589952fce86cea1bf5844d9943102f (patch)
treeb4c995c706c76fd412d6a9de8fc2a49a359a673b
parentc07b40b7b8f7315e39659ce6c933962fea6b3365 (diff)
parent1d07479cfde6aa0eda90c28a3475a80dfc124ea1 (diff)
Merge pull request #101 from Neo-J-A/master
feat: Added stroke_color option to CLI
-rw-r--r--packages/svgbob_cli/src/main.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/svgbob_cli/src/main.rs b/packages/svgbob_cli/src/main.rs
index 15a0bb9..08e6031 100644
--- a/packages/svgbob_cli/src/main.rs
+++ b/packages/svgbob_cli/src/main.rs
@@ -43,10 +43,14 @@ fn main() {
.long("font-size")
.takes_value(true)
.help("text will be rendered with this font size (default: 14)"))
- .arg(Arg::with_name("stroke-width")
+ .arg(Arg::with_name("stroke-width")
.long("stroke-width")
.takes_value(true)
.help("stroke width for all lines (default: 2)"))
+ .arg(Arg::with_name("stroke-color")
+ .long("stroke-color")
+ .takes_value(true)
+ .help("stroke color for all lines (default: 'black')"))
.arg(Arg::with_name("scale")
.long("scale")
.takes_value(true)
@@ -123,6 +127,10 @@ fn main() {
settings.stroke_width = stroke_width;
}
+ if let Some(stroke_color) = parse_value_of(&args, "stroke-color") {
+ settings.stroke_color = stroke_color;
+ }
+
let scale: Option<f32> = parse_value_of(&args, "scale");
if let Some(s) = scale {
settings.scale *= s;