mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 15:07:53 +00:00
feat: get config metadata
This will replace --get-name add provide both name and protocol in a single json object
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -28,9 +28,9 @@ fn main() {
|
||||
.value_parser(value_parser!(u16)),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("get_name")
|
||||
.long("get-name")
|
||||
.help("Only print the config name")
|
||||
Arg::new("get_metadata")
|
||||
.long("get-metadata")
|
||||
.help("Only print config meta data")
|
||||
.action(clap::ArgAction::SetTrue),
|
||||
)
|
||||
.get_matches();
|
||||
@@ -38,10 +38,10 @@ fn main() {
|
||||
let uri = matches.get_one::<String>("uri").unwrap();
|
||||
let socksport = matches.get_one::<u16>("socksport").copied();
|
||||
let httpport = matches.get_one::<u16>("httpport").copied();
|
||||
let get_name = matches.get_flag("get_name");
|
||||
let get_metadata = matches.get_flag("get_metadata");
|
||||
|
||||
if get_name {
|
||||
print!("{}", parser::get_name(uri));
|
||||
if get_metadata {
|
||||
print!("{}", parser::get_metadata(uri));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user