Add --get-name flag

This commit is contained in:
Keivan-sf
2025-07-27 16:15:04 +03:30
parent bc5306ca87
commit f282a1ae4b
2 changed files with 34 additions and 19 deletions

View File

@@ -11,10 +11,16 @@ struct Cli {
socksport: Option<u16>,
#[arg(long, value_name = "httpport")]
httpport: Option<u16>,
#[arg(long, action = clap::ArgAction::SetTrue, value_name = "get-name")]
get_name: Option<bool>,
}
fn main() {
let cli = Cli::parse();
if cli.get_name == Some(true) {
print!("{}", parser::get_name(&cli.uri));
return;
}
let json_config = parser::create_json_config(&cli.uri, cli.socksport, cli.httpport);
println!("{}", json_config);
}