cfg: support usage() on bad invocation for txcreate
This commit is contained in:
parent
0f7e51e499
commit
67e1688aa1
4 changed files with 6 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ def gen_arg_tuple(cfg, func, text):
|
|||
def help_notes(k, *args, **kwargs):
|
||||
import importlib
|
||||
return getattr(importlib.import_module(
|
||||
f'{cfg._opts.help_pkg}.help_notes').help_notes(proto, cfg), k)(*args, **kwargs)
|
||||
f'{cfg._help_pkg}.help_notes').help_notes(proto, cfg), k)(*args, **kwargs)
|
||||
|
||||
def help_mod(modname):
|
||||
import importlib
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@ opts_data = {
|
|||
|
||||
cfg = Config(opts_data=opts_data)
|
||||
|
||||
if not cfg.info and len(cfg._args) < {'tx': 1, 'swaptx': 2}[target]:
|
||||
cfg._usage()
|
||||
|
||||
async def main():
|
||||
|
||||
if cfg.autosign:
|
||||
|
|
|
|||
|
|
@ -279,6 +279,7 @@ class Opts:
|
|||
# Make these available to usage():
|
||||
cfg._usage_data = opts_data['text'].get('usage2') or opts_data['text']['usage']
|
||||
cfg._usage_code = opts_data.get('code', {}).get('usage')
|
||||
cfg._help_pkg = self.help_pkg
|
||||
|
||||
if os.getenv('MMGEN_DEBUG_OPTS'):
|
||||
opt_preproc_debug(po)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class CmdTestHelp(CmdTestBase):
|
|||
return self._usage('walletgen', ['foo'], True, False, 1)
|
||||
|
||||
def usage4(self):
|
||||
return self._usage('tool' if self.coin == 'xmr' else 'addrgen', [], True, True, 1)
|
||||
return self._usage('tool' if self.coin == 'xmr' else 'txcreate', [], True, True, 1)
|
||||
|
||||
def _usage(self, cmd_arg, args, no_passthru_opts, add_coin_opt, exit_val):
|
||||
if cmd := (None if self._gen_skiplist(cmd_arg) else cmd_arg):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue