Move solana-validator-info into cli (#5768)
* Move solana-validator-info into cli * Remove solana-validator-info and update docs * Update test to use app()
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
use clap::{crate_description, crate_name, crate_version, Arg, ArgGroup, ArgMatches, SubCommand};
|
||||
use console::style;
|
||||
use solana_cli::config::{self, Config};
|
||||
use solana_cli::display::println_name_value;
|
||||
use solana_cli::wallet::{app, parse_command, process_command, WalletConfig, WalletError};
|
||||
use solana_cli::{
|
||||
config::{self, Config},
|
||||
display::println_name_value,
|
||||
input_validators::is_url,
|
||||
wallet::{app, parse_command, process_command, WalletConfig, WalletError},
|
||||
};
|
||||
use solana_sdk::signature::{gen_keypair_file, read_keypair, KeypairUtil};
|
||||
use std::error;
|
||||
|
||||
@@ -104,20 +107,6 @@ pub fn parse_args(matches: &ArgMatches<'_>) -> Result<WalletConfig, Box<dyn erro
|
||||
})
|
||||
}
|
||||
|
||||
// Return an error if a url cannot be parsed.
|
||||
fn is_url(string: String) -> Result<(), String> {
|
||||
match url::Url::parse(&string) {
|
||||
Ok(url) => {
|
||||
if url.has_host() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err("no host provided".to_string())
|
||||
}
|
||||
}
|
||||
Err(err) => Err(format!("{:?}", err)),
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||
solana_logger::setup();
|
||||
let matches = app(crate_name!(), crate_description!(), crate_version!())
|
||||
|
Reference in New Issue
Block a user