summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorMichael Lohr <michael@lohr.dev>2023-04-12 19:03:12 +0200
committerGitHub <noreply@github.com>2023-04-12 19:03:12 +0200
commit8300f75f22cb4dd1b871a7e617397ff7d56ba001 (patch)
tree86897213316442d022dc32f1b94102b2083682d7 /cli
parente4fda4176ec477c3508549e165c12406f939e8f6 (diff)
Read font path from environment variables (#649)
Diffstat (limited to 'cli')
-rw-r--r--cli/Cargo.toml2
-rw-r--r--cli/src/args.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index 68e50bb3..85357922 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -32,7 +32,7 @@ once_cell = "1"
same-file = "1"
siphasher = "0.3"
walkdir = "2"
-clap = { version = "4.2.1", features = ["derive"] }
+clap = { version = "4.2.1", features = ["derive", "env"] }
open = "4.0.1"
[build-dependencies]
diff --git a/cli/src/args.rs b/cli/src/args.rs
index c88c9a21..42d52140 100644
--- a/cli/src/args.rs
+++ b/cli/src/args.rs
@@ -7,11 +7,11 @@ use clap::{ArgAction, Parser, Subcommand};
#[clap(name = "typst", version = crate::typst_version(), author)]
pub struct CliArguments {
/// Add additional directories to search for fonts
- #[clap(long = "font-path", value_name = "DIR", action = ArgAction::Append)]
+ #[clap(long = "font-path", env = "TYPST_FONT_PATHS", value_name = "DIR", action = ArgAction::Append)]
pub font_paths: Vec<PathBuf>,
/// Configure the root for absolute paths
- #[clap(long = "root", value_name = "DIR")]
+ #[clap(long = "root", env = "TYPST_ROOT", value_name = "DIR")]
pub root: Option<PathBuf>,
/// The typst command to run