Skip to content

Commit

Permalink
Use clap for yact binary
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonAPenn committed Aug 20, 2024
1 parent 7309319 commit e8a0d63
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ name = "yact"
version = "0.1.0"
edition = "2021"
license = "GPL-3.0-or-later"
description = "Yet another commit transformer: a tool for formatting staged files with minimal disturbance to developer workflow."

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[profile.release]
lto = true

[dependencies]
git2 = {version = "0.19", default-features = false}
clap = { version = "4.5.16", features = ["derive"], optional = true }
git2 = { version = "0.19", default-features = false }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

[features]
default = ["cli"]
cli = ["clap"]

[dev-dependencies]
uuid = { version = "1.10.0", features = ["v4"] }
14 changes: 14 additions & 0 deletions src/bin/yact.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
use std::path::PathBuf;

use clap::Parser;
use yact::{pre_commit, BuiltinTransformer, ShellCommandTransformer, TransformerOptions};

#[derive(Parser)]
#[command(version, about)]
pub struct Args {
/*
* TODO: add config file and configuration
* #[arg(short, long, value_name="CONFIG_FILE")]
* config: Option<PathBuf>,
*/
}

pub fn main() {
let _cli = Args::parse();
let config = [
(
"**/*.rs",
Expand Down

0 comments on commit e8a0d63

Please sign in to comment.