kkv 1.2.1

A Peer-to-Peer Decentralized, Temporary and Anonymous Message System.
Documentation
/**************************************************************************
 *   src/compile_client.rs  --  This file is part of kkv.                 *
 *                                                                        *
 *   Copyright (C) 2025 Mateo Lafalce                                     *
 *                                                                        *
 *   kkv is free software: you can redistribute it and/or modify          *
 *   it under the terms of the GNU General Public License as published    *
 *   by the Free Software Foundation, either version 3 of the License,    *
 *   or (at your option) any later version.                               *
 *                                                                        *
 *   kkv is distributed in the hope that it will be useful,               *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty          *
 *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.              *
 *   See the GNU General Public License for more details.                 *
 *                                                                        *
 *   You should have received a copy of the GNU General Public License    *
 *   along with this program.  If not, see http://www.gnu.org/licenses/.  *
 *                                                                        *
 **************************************************************************/

use clap::Parser;
use colored::*;
use rpassword::read_password;
use std::io::Error;

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
    /// The maximum number of messages you want to store
    #[arg(short, long)]
    max_messages: Option<usize>,
    /// The cost of the Proof of Work that will be sent to the client
    #[arg(short, long)]
    cost_pow: Option<u32>,
    /// The expected time to solve the proof of work in seconds
    #[arg(short, long)]
    expected_time: Option<u64>,
}

#[tokio::main]
async fn main() -> Result<(), Error> {
    println!("Enter the server password");
    let password = read_password().unwrap();

    #[allow(clippy::unit_arg)]
    let _ = match kkv::client::client(password).await {
        Ok(_) => Ok(()),
        Err(e) => Err(println!("{}", e.to_string().red())),
    };
    Ok(())
}