Skip to content

Commit

Permalink
lil cleanup with default hmm.json stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjamuffin99 committed Jan 15, 2025
1 parent a558c07 commit 80f4bff
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Args {
cmd: Commands,

/// Sets a custom hmm.json file to use
#[arg(short, long, value_name = "JSON")]
#[arg(short, long, value_name = "JSON", default_value = "hmm.json")]
json: Option<PathBuf>,
}

Expand Down Expand Up @@ -54,11 +54,7 @@ enum Commands {
pub fn run() -> Result<()> {
let args = Args::parse();

let path = if let Some(hmm) = args.json {
hmm
} else {
PathBuf::from("hmm.json")
};
let path = args.json.unwrap();

let deps = hmm::json::read_json(&path)?;

Expand All @@ -76,3 +72,9 @@ pub fn run() -> Result<()> {
}
Ok(())
}

#[test]
fn verify_cli() {
use clap::CommandFactory;
Args::command().debug_assert();
}

0 comments on commit 80f4bff

Please sign in to comment.