Skip to content

Commit

Permalink
Introduce builder-pattern API (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
elshize authored Mar 15, 2022
1 parent fdeeb88 commit a5d4a02
Show file tree
Hide file tree
Showing 6 changed files with 463 additions and 99 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ciff"
version = "0.2.1" # remember to update html_root_url
version = "0.3.0" # remember to update html_root_url
authors = ["Michal Siedlaczek <[email protected]>", "Joel Mackenzie <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
11 changes: 9 additions & 2 deletions src/ciff2pisa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#![warn(clippy::all, clippy::pedantic)]
#![allow(clippy::module_name_repetitions, clippy::default_trait_access)]

use ciff::ciff_to_pisa;
use ciff::CiffToPisa;
use std::path::PathBuf;
use structopt::StructOpt;

Expand All @@ -32,7 +32,14 @@ struct Args {

fn main() {
let args = Args::from_args();
if let Err(error) = ciff_to_pisa(&args.ciff_file, &args.output, args.generate_lexicons) {
let mut converter = CiffToPisa::default();
converter
.input_path(args.ciff_file)
.output_paths(args.output);
if !args.generate_lexicons {
converter.skip_lexicons();
}
if let Err(error) = converter.convert() {
eprintln!("ERROR: {}", error);
std::process::exit(1);
}
Expand Down
Loading

0 comments on commit a5d4a02

Please sign in to comment.