mmgen-txcreate: help screen cleanups

This commit is contained in:
The MMGen Project 2025-12-01 16:54:36 +00:00
commit 6ef5f6c797
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 16 additions and 10 deletions

View file

@ -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]'

View file

@ -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:

View file

@ -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)