From e972e4f93ec511fa1ae731d4835e7c54d940a339 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 15 Mar 2025 18:24:53 +0000 Subject: [PATCH] add --list-daemon-ids global config opt --- mmgen/help/__init__.py | 9 +++++++++ mmgen/opts.py | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mmgen/help/__init__.py b/mmgen/help/__init__.py index 2e403ce1..723558f2 100755 --- a/mmgen/help/__init__.py +++ b/mmgen/help/__init__.py @@ -33,6 +33,15 @@ def version(cfg): """, indent=' ').rstrip()) sys.exit(0) +def list_daemon_ids(cfg): + from ..daemon import CoinDaemon + from ..util import msg, fmt_list + msg(' {} {}'.format('Coin', 'Daemon IDs')) + msg(' {} {}'.format('----', '----------')) + for k, v in CoinDaemon.coins.items(): + msg(' {} {}'.format(k, fmt_list(v.daemon_ids, fmt='barest'))) + sys.exit(0) + def show_hash_presets(cfg): fs = ' {:<6} {:<3} {:<2} {}' from ..util import msg diff --git a/mmgen/opts.py b/mmgen/opts.py index 7353025e..30bf17a7 100755 --- a/mmgen/opts.py +++ b/mmgen/opts.py @@ -293,7 +293,7 @@ class Opts: class UserOpts(Opts): help_pkg = 'mmgen.help' - info_funcs = ('version', 'show_hash_presets') + info_funcs = ('version', 'show_hash_presets', 'list_daemon_ids') global_opts_data = { # coin code : cmd code : opt : opt param : text @@ -313,6 +313,7 @@ class UserOpts(Opts): rr --daemon-data-dir=path Specify coin daemon data directory location Rr --daemon-id=ID Specify the coin daemon ID rr --ignore-daemon-version Ignore coin daemon version check + Rr --list-daemon-ids List all available daemon IDs rr --http-timeout=t Set HTTP timeout in seconds for JSON-RPC connections -- --no-license Suppress the GPL license prompt Rr --rpc-host=HOST Communicate with coin daemon running on host HOST