2023-10-08 20:46:52 +03:30
|
|
|
mod parser;
|
2023-10-24 17:00:00 +03:30
|
|
|
use clap::{Parser, Subcommand};
|
|
|
|
|
use std::path::PathBuf;
|
2023-11-07 16:36:30 +03:30
|
|
|
pub mod config_models;
|
2023-11-08 19:51:21 +03:30
|
|
|
pub mod lib;
|
2023-10-24 17:00:00 +03:30
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
|
|
|
#[command(author, version, about, long_about = None)]
|
|
|
|
|
struct Cli {
|
|
|
|
|
uri: String,
|
|
|
|
|
#[arg(short, long, value_name = "socksport")]
|
|
|
|
|
socksport: Option<u16>,
|
|
|
|
|
}
|
2023-10-10 15:01:12 +03:30
|
|
|
|
2023-10-06 18:16:44 +03:30
|
|
|
fn main() {
|
2023-10-24 17:00:00 +03:30
|
|
|
let cli = Cli::parse();
|
|
|
|
|
match cli.socksport {
|
|
|
|
|
Some(port) => {
|
|
|
|
|
println!("the port: {}", port)
|
|
|
|
|
}
|
|
|
|
|
None => {
|
|
|
|
|
println!("the port is not here")
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
println!("the uri is: {}", cli.uri);
|
2023-11-07 16:36:30 +03:30
|
|
|
let json_config = parser::create_json_config(&cli.uri, cli.socksport);
|
2023-10-26 17:31:33 +03:30
|
|
|
println!("The json config is: {}" , json_config);
|
2023-10-06 18:16:44 +03:30
|
|
|
}
|