Skip to content

Commit

Permalink
Merge pull request #225 from googlefonts/clap-bool-flags
Browse files Browse the repository at this point in the history
allow to set fontc --emit-ir=false
  • Loading branch information
anthrotype committed Mar 30, 2023
2 parents 306bc1f + 04dc570 commit f33741e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion fontbe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ write-fonts = "0.1.6"
kurbo = { version = "0.9.2", features = ["serde"] }

fea-rs = "0.3.1"
smol_str = "0.1.18"
smol_str = { version = "0.1.25", features = ["serde"] }

[dev-dependencies]
diff = "0.1.12"
Expand Down
2 changes: 1 addition & 1 deletion fontc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ serde = {version = "1.0", features = ["derive"] }
serde_yaml = "0.9.14"
bincode = "1.3.3"
filetime = "0.2.18"
clap = { version = "4.0.32", features = ["derive"] }
clap = { version = "4.2.1", features = ["derive"] }
log = "0.4"
env_logger = "0.10.0"
thiserror = "1.0.37"
Expand Down
17 changes: 6 additions & 11 deletions fontc/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::path::PathBuf;

use clap::Parser;
use clap::{ArgAction, Parser};
use fontir::orchestration::Flags;
use serde::{Deserialize, Serialize};

Expand All @@ -14,31 +14,26 @@ pub struct Args {
pub source: PathBuf,

/// Whether to write IR to disk. Must be true if you want incremental compilation.
#[arg(short, long)]
#[clap(default_value = "true")]
#[arg(short, long, default_value = "true", action = ArgAction::Set)]
pub emit_ir: bool,

/// Whether to write additional debug files to disk.
#[arg(long)]
#[clap(default_value = "false")]
#[arg(long, default_value = "false")]
pub emit_debug: bool,

/// Whether to Try Hard(tm) to match fontmake (Python) behavior in cases where there are other options.
///
/// See <https://github.com/googlefonts/fontmake-rs/pull/123> for an example of
/// where this matters.
#[arg(long)]
#[clap(default_value = "true")]
#[arg(long, default_value = "true")]
pub match_legacy: bool,

/// Working directory for the build process. If emit-ir is on, written here.
#[arg(short, long)]
#[clap(default_value = "build")]
#[arg(short, long, default_value = "build")]
pub build_dir: PathBuf,

/// Glyph names must match this regex to be processed
#[arg(short, long)]
#[clap(default_value = None)]
#[arg(short, long, default_value = None)]
pub glyph_name_filter: Option<String>,
}

Expand Down
2 changes: 1 addition & 1 deletion fontdrasil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ categories = ["text-processing", "parsing", "graphics"]
[features]

[dependencies]
smol_str = "0.1.14"
smol_str = { version = "0.1.25", features = ["serde"] }

serde = {version = "1.0", features = ["derive"] }

Expand Down

0 comments on commit f33741e

Please sign in to comment.