Change --testnet flag to --network (#1751)

## Issue Addressed

- Resolves #1689

## Proposed Changes

TBC

## Additional Info

NA
This commit is contained in:
Paul Hauner
2020-11-23 23:54:03 +00:00
parent 7d644103c6
commit 21617aa87f
28 changed files with 110 additions and 128 deletions

View File

@@ -14,13 +14,13 @@ pub const DEFAULT_WALLET_DIR: &str = "wallets";
/// Base directory name for unnamed testnets passed through the --testnet-dir flag
pub const CUSTOM_TESTNET_DIR: &str = "custom";
/// Gets the testnet directory name
/// Gets the network directory name
///
/// Tries to get the name first from the "testnet" flag,
/// Tries to get the name first from the "network" flag,
/// if not present, then checks the "testnet-dir" flag and returns a custom name
/// If neither flags are present, returns the default hardcoded network name.
pub fn get_testnet_name(matches: &ArgMatches) -> String {
if let Some(testnet_name) = matches.value_of("testnet") {
if let Some(testnet_name) = matches.value_of("network") {
testnet_name.to_string()
} else if matches.value_of("testnet-dir").is_some() {
CUSTOM_TESTNET_DIR.to_string()