From ddd633c6b45e92bd86e5a251602f206ec529bff0 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 15 Nov 2025 09:50:15 +0000 Subject: [PATCH] xmrwallet: minor arg parsing cleanup --- mmgen/main_xmrwallet.py | 9 +++++---- mmgen/xmrwallet/__init__.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mmgen/main_xmrwallet.py b/mmgen/main_xmrwallet.py index 015d5995..ca301b5e 100755 --- a/mmgen/main_xmrwallet.py +++ b/mmgen/main_xmrwallet.py @@ -117,7 +117,8 @@ if cmd_args and cfg.autosign and ( if len(cmd_args) < 2: cfg._usage() -op = cmd_args.pop(0) +usr_op = cmd_args.pop(0) +op = usr_op.replace('-', '_') infile = cmd_args.pop(0) wallets = spec = None @@ -135,14 +136,14 @@ match op: if len(cmd_args) != 1: cfg._usage() spec = cmd_args[0] - case 'export-outputs' | 'export-outputs-sign' | 'import-key-images': + case 'export_outputs' | 'export_outputs_sign' | 'import_key_images': if not cfg.autosign: - die(1, f'--autosign must be used with command {op!r}') + die(1, f'--autosign must be used with command {usr_op!r}') if len(cmd_args) > 1: cfg._usage() wallets = cmd_args.pop(0) if cmd_args else None case _: - die(1, f'{op!r}: unrecognized operation') + die(1, f'{usr_op!r}: unrecognized operation') m = xmrwallet.op(op, cfg, infile, wallets, spec=spec) diff --git a/mmgen/xmrwallet/__init__.py b/mmgen/xmrwallet/__init__.py index 216bd17f..0535e8c1 100755 --- a/mmgen/xmrwallet/__init__.py +++ b/mmgen/xmrwallet/__init__.py @@ -113,4 +113,4 @@ def op_cls(op_name): return cls def op(op, cfg, infile, wallets, *, spec=None): - return op_cls(op.replace('-', '_'))(cfg, uargs(infile, wallets, spec)) + return op_cls(op)(cfg, uargs(infile, wallets, spec))