Adds clap

Signed-off-by: Ash Svitan <selfsigned-ash@proton.me>
This commit is contained in:
2026-04-30 22:03:36 +02:00
parent 8c40b5a01d
commit 1ef4a21bf3
2 changed files with 156 additions and 3 deletions
+12 -1
View File
@@ -5,9 +5,14 @@ mod sh;
use std::env;
use std::io;
use std::io::{Error, ErrorKind, Write};
use clap::Parser;
const ENV_VAR_DEFAULT_VAULT: &str = "PASS_VAULT";
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {}
fn ask_consent(question: String, line1: String, line2: String) -> Result<bool, Error> {
println!("{}", question);
println!("\t{}", line1);
@@ -20,7 +25,7 @@ fn ask_consent(question: String, line1: String, line2: String) -> Result<bool, E
return Ok(input.to_lowercase() == "y\n");
}
fn main() -> Result<(), Error> {
fn sync() -> Result<(), Error> {
pass::check_pass()?;
rbw::check_rbw()?;
@@ -162,3 +167,9 @@ fn main() -> Result<(), Error> {
return Ok(());
}
fn main() -> Result<(), Error> {
Cli::parse();
sync()?;
return Ok(());
}