From 6ef5f6c7973ee116e31a673add7e3d2048fdd2af Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 1 Dec 2025 16:54:36 +0000 Subject: [PATCH] mmgen-txcreate: help screen cleanups --- mmgen/help/help_notes.py | 9 +++++---- mmgen/help/txcreate_examples.py | 9 +++++++-- mmgen/main_txcreate.py | 8 ++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/mmgen/help/help_notes.py b/mmgen/help/help_notes.py index 5bfb0efa..cd4b5e38 100755 --- a/mmgen/help/help_notes.py +++ b/mmgen/help/help_notes.py @@ -19,10 +19,11 @@ class help_notes: self.cfg = cfg def txcreate_args(self): - return ( - '[ADDR,AMT ... | DATA_SPEC] ADDR' - if self.proto.base_proto == 'Bitcoin' else - 'ADDR,AMT') + match self.proto.base_proto: + case 'Bitcoin': + return '[ADDR,AMT ... | DATA_SPEC] ADDR [addr file ...]' + case _: + return 'ADDR,AMT [addr file ...]' def swaptxcreate_args(self): return 'COIN1 [AMT CHG_ADDR] COIN2 [ADDR]' diff --git a/mmgen/help/txcreate_examples.py b/mmgen/help/txcreate_examples.py index f1b074b8..ecd6b320 100755 --- a/mmgen/help/txcreate_examples.py +++ b/mmgen/help/txcreate_examples.py @@ -22,7 +22,9 @@ def help(proto, cfg): addr = t.privhex2addr('bead' * 16) sample_addr = addr.views[addr.view_pref] - return f""" + match proto.base_proto: + case 'Bitcoin': + return f""" EXAMPLES: Send 0.123 {proto.coin} to an external {proto.name} address, returning the change to a @@ -52,7 +54,10 @@ EXAMPLES: address of specified type: $ {gc.prog_name} {mmtype} -""" if proto.base_proto == 'Bitcoin' else f""" +""" + + case _: + return f""" EXAMPLES: Send 0.123 {proto.coin} to an external {proto.name} address: diff --git a/mmgen/main_txcreate.py b/mmgen/main_txcreate.py index 7c9c4bbc..b55064e5 100755 --- a/mmgen/main_txcreate.py +++ b/mmgen/main_txcreate.py @@ -37,14 +37,14 @@ opts_data = { 'tx': f'Create a transaction with outputs to specified coin or {gc.proj_name} addresses', 'swaptx': f'Create a DEX swap transaction from one {gc.proj_name} tracking wallet to another', }[target], - 'usage': '[opts] {u_args} [addr file ...]', + 'usage': '[opts] {u_args}', 'options': """ -- -h, --help Print this help message -- --, --longhelp Print help message for long (global) options -- -a, --autosign Create a transaction for offline autosigning (see + ‘mmgen-autosign’). The removable device is mounted and + unmounted automatically - r- -A, --fee-adjust= f Adjust transaction fee by factor ‘f’ (see below) + R- -A, --fee-adjust= f Adjust transaction fee by factor ‘f’ (see below) -- -B, --no-blank Don't blank screen before displaying {a_info} -- -c, --comment-file=f Source the transaction's comment from file 'f' b- -C, --fee-estimate-confs=c Desired number of confirmations for fee estimation @@ -53,7 +53,7 @@ opts_data = { e- -D, --contract-data=D Path to file containing hex-encoded contract data b- -E, --fee-estimate-mode=M Specify the network fee estimate mode. Choices: + {fe_all}. Default: {fe_dfl!r} - r- -f, --fee= f Transaction fee, as a decimal {cu} amount or as + R- -f, --fee= f Transaction fee, as a decimal {cu} amount or as + {fu} (an integer followed by {fl}). + See FEE SPECIFICATION below. If omitted, fee will be + calculated using network fee estimation. @@ -63,7 +63,7 @@ opts_data = { + (integer). When unset, a hardcoded default will be + used. Applicable only for swaps from token assets. -- -i, --info Display {a_info} and exit - -- -I, --inputs= i Specify transaction inputs (comma-separated list of + R- -I, --inputs= i Specify transaction inputs (comma-separated list of + MMGen IDs or coin addresses). Note that ALL unspent + outputs associated with each address will be included. bt -l, --locktime= t Lock time (block height or unix seconds) (default: 0)