prepare: version respects withcoins.

This commit is contained in:
tecnovert 2024-11-28 21:38:50 +02:00
parent 128291a36a
commit 938c641736
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93

View file

@ -1514,11 +1514,16 @@ def modify_tor_config(
writeTorSettings(fp, coin, coin_settings, tor_control_password) writeTorSettings(fp, coin, coin_settings, tor_control_password)
def printVersion(): def printVersion(with_coins):
logger.info(f"Basicswap version: {__version__}") logger.info(f"Basicswap version: {__version__}")
if len(with_coins) < 1:
return
logger.info("Core versions:") logger.info("Core versions:")
with_coins_changed: bool = False if len(with_coins) == 1 and "particl" in with_coins else True
for coin, version in known_coins.items(): for coin, version in known_coins.items():
if with_coins_changed and coin not in with_coins:
continue
postfix = " (Disabled)" if coin in disabled_coins else "" postfix = " (Disabled)" if coin in disabled_coins else ""
logger.info("\t%s: %s%s%s", coin.capitalize(), version[0], version[1], postfix) logger.info("\t%s: %s%s%s", coin.capitalize(), version[0], version[1], postfix)
@ -1957,6 +1962,7 @@ def main():
htmlhost = "127.0.0.1" htmlhost = "127.0.0.1"
xmr_restore_height = DEFAULT_XMR_RESTORE_HEIGHT xmr_restore_height = DEFAULT_XMR_RESTORE_HEIGHT
wow_restore_height = DEFAULT_WOW_RESTORE_HEIGHT wow_restore_height = DEFAULT_WOW_RESTORE_HEIGHT
print_versions = False
prepare_bin_only = False prepare_bin_only = False
no_cores = False no_cores = False
enable_tor = False enable_tor = False
@ -1983,13 +1989,13 @@ def main():
if name[0] == "-": if name[0] == "-":
name = name[1:] name = name[1:]
if name == "v" or name == "version":
printVersion()
return 0
if name == "h" or name == "help": if name == "h" or name == "help":
printHelp() printHelp()
return 0 return 0
if name == "v" or name == "version":
print_versions = True
continue
if name in ("mainnet", "testnet", "regtest"): if name in ("mainnet", "testnet", "regtest"):
chain = name chain = name
continue continue
@ -2095,6 +2101,10 @@ def main():
exitWithError("Unknown argument {}".format(v)) exitWithError("Unknown argument {}".format(v))
if print_versions:
printVersion(with_coins)
return 0
if data_dir is None: if data_dir is None:
data_dir = os.path.join(os.path.expanduser(cfg.BASICSWAP_DATADIR)) data_dir = os.path.join(os.path.expanduser(cfg.BASICSWAP_DATADIR))
if bin_dir is None: if bin_dir is None: