2023-10-08 20:46:52 +03:30
|
|
|
mod parser;
|
2023-11-09 12:38:26 +03:30
|
|
|
use clap::Parser;
|
2023-11-07 16:36:30 +03:30
|
|
|
pub mod config_models;
|
2023-11-09 12:38:26 +03:30
|
|
|
pub mod utils;
|
2023-10-24 17:00:00 +03:30
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
2025-07-10 22:59:34 +03:30
|
|
|
#[command(author ,version = "0.1.1", about = "V2ray URI parser", long_about = None)]
|
2023-10-24 17:00:00 +03:30
|
|
|
struct Cli {
|
|
|
|
|
uri: String,
|
2025-07-26 19:26:20 +03:30
|
|
|
#[arg(long, value_name = "socksport")]
|
2023-10-24 17:00:00 +03:30
|
|
|
socksport: Option<u16>,
|
2025-07-26 19:25:55 +03:30
|
|
|
#[arg(long, value_name = "httpport")]
|
|
|
|
|
httpport: Option<u16>,
|
2023-10-24 17:00:00 +03:30
|
|
|
}
|
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();
|
2025-07-26 19:25:55 +03:30
|
|
|
let json_config = parser::create_json_config(&cli.uri, cli.socksport, cli.httpport);
|
2023-11-09 12:41:09 +03:30
|
|
|
println!("{}", json_config);
|
2023-10-06 18:16:44 +03:30
|
|
|
}
|