A small tool for storing passwords locally with git sync
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
use clap::{Parser, Subcommand};
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
|
|
#[command(name = "mps", version = "0.0.1", about = "MyPasswordStorage: Tool for storing your passwords locally with synchronization with git.")]
|
|
|
|
struct Cli {
|
|
|
|
#[command(subcommand)]
|
|
|
|
command: Option<Commands>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Subcommand)]
|
|
|
|
enum Commands {
|
|
|
|
|
|
|
|
/// Initialisation of storage and config, use this in first time of usage of mps
|
|
|
|
Init,
|
|
|
|
|
|
|
|
/// Adds new item with unique id to the db
|
|
|
|
Add {
|
|
|
|
#[arg(value_name="item_id")]
|
|
|
|
input: String
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let cli = Cli::parse();
|
|
|
|
match &cli.command {
|
|
|
|
Some(Commands::Init) => {
|
|
|
|
println!("Initializing storage and config.");
|
|
|
|
}
|
|
|
|
Some(Commands::Add{input}) => {
|
|
|
|
println!("about to add new item");
|
|
|
|
}
|
|
|
|
None => {
|
|
|
|
println!("Will be here init or list if storage inited");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|