diff --git a/crates/typst-cli/src/args.rs b/crates/typst-cli/src/args.rs index 14173a550..689785df1 100644 --- a/crates/typst-cli/src/args.rs +++ b/crates/typst-cli/src/args.rs @@ -171,8 +171,13 @@ pub struct SharedArgs { /// The document's creation date formatted as a UNIX timestamp. /// /// For more information, see . - #[clap(env = "SOURCE_DATE_EPOCH", value_parser = parse_source_date_epoch)] - pub source_date_epoch: Option>, + #[clap( + long = "creation-timestamp", + env = "SOURCE_DATE_EPOCH", + value_name = "UNIX_TIMESTAMP", + value_parser = parse_source_date_epoch, + )] + pub creation_timestamp: Option>, /// The format to emit diagnostics in #[clap( diff --git a/crates/typst-cli/src/compile.rs b/crates/typst-cli/src/compile.rs index e6f8b241f..6273615c1 100644 --- a/crates/typst-cli/src/compile.rs +++ b/crates/typst-cli/src/compile.rs @@ -167,7 +167,7 @@ fn export( /// Export to a PDF. fn export_pdf(document: &Document, command: &CompileCommand) -> StrResult<()> { let timestamp = convert_datetime( - command.common.source_date_epoch.unwrap_or_else(chrono::Utc::now), + command.common.creation_timestamp.unwrap_or_else(chrono::Utc::now), ); let buffer = typst_pdf::pdf(document, Smart::Auto, timestamp); command diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs index e0215130f..99da838cf 100644 --- a/crates/typst-cli/src/world.rs +++ b/crates/typst-cli/src/world.rs @@ -105,7 +105,7 @@ impl SystemWorld { let mut searcher = FontSearcher::new(); searcher.search(&command.font_paths); - let now = match command.source_date_epoch { + let now = match command.creation_timestamp { Some(time) => Now::Fixed(time), None => Now::System(OnceLock::new()), };