mmgen-tool: install fix, sort command names; version msg fix

This commit is contained in:
The MMGen Project 2022-01-25 12:20:23 +00:00
commit ed7cc7498a
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
5 changed files with 49 additions and 40 deletions

View file

@ -1 +1 @@
13.1.dev009
13.1.dev010

View file

@ -67,64 +67,66 @@ Type '{pn} help <command>' for help on a particular command
}
}
# NB: Command groups and commands are displayed on the help screen in the following order,
# so keep the command names sorted
mods = {
'help': (
'help',
'usage',
),
'util': (
'b32tohex',
'b58chktohex',
'b58tobytes',
'b58tohex',
'b6dtohex',
'bytespec',
'to_bytespec',
'randhex',
'hexreverse',
'hexlify',
'unhexlify',
'hexdump',
'unhexdump',
'bytestob58',
'hash160',
'hash256',
'hexdump',
'hexlify',
'hexreverse',
'hextob32',
'hextob58',
'hextob58chk',
'hextob6d',
'id6',
'str2id6',
'id8',
'randb58',
'bytestob58',
'b58tobytes',
'hextob58',
'b58tohex',
'hextob58chk',
'b58chktohex',
'hextob32',
'b32tohex',
'hextob6d',
'b6dtohex',
'randhex',
'str2id6',
'to_bytespec',
'unhexdump',
'unhexlify',
),
'coin': (
'randwif',
'randpair',
'wif2hex',
'hex2wif',
'wif2addr',
'wif2redeem_script',
'wif2segwit_pair',
'privhex2addr',
'privhex2pubhex',
'pubhex2addr',
'pubhex2redeem_script',
'redeem_script2addr',
'pubhash2addr',
'addr2pubhash',
'addr2scriptpubkey',
'hex2wif',
'privhex2addr',
'privhex2pubhex',
'pubhash2addr',
'pubhex2addr',
'pubhex2redeem_script',
'randpair',
'randwif',
'redeem_script2addr',
'scriptpubkey2addr',
'wif2addr',
'wif2hex',
'wif2redeem_script',
'wif2segwit_pair',
),
'mnemonic': (
'mn_rand128',
'mn_rand192',
'mn_rand256',
'hex2mn',
'mn2hex',
'mn2hex_interactive',
'mn_stats',
'mn_printlist',
'mn_rand128',
'mn_rand192',
'mn_rand256',
'mn_stats',
),
'file': (
'addrfile_chksum',
@ -133,30 +135,30 @@ mods = {
'txview',
),
'filecrypt': (
'encrypt',
'decrypt',
'encrypt',
),
'fileutil': (
'find_incog_data',
'rand2file',
),
'wallet': (
'gen_addr',
'gen_key',
'get_subseed',
'get_subseed_by_seed_id',
'list_subseeds',
'list_shares',
'gen_key',
'gen_addr',
'list_subseeds',
),
'rpc': (
'add_label',
'daemon_version',
'getbalance',
'listaddress',
'listaddresses',
'twview',
'add_label',
'remove_label',
'remove_address',
'remove_label',
'twview',
),
}

View file

@ -40,7 +40,7 @@ def usage():
Die(1,mmgen.share.Opts.make_usage_str(g.prog_name,'user',usage_data))
def version():
from .util import Die
from .util import Die,fmt
Die(0,fmt(f"""
{g.prog_name.upper()} version {g.version}
Part of the {g.proj_name} suite, an online/offline cryptocurrency wallet for the

View file

@ -42,6 +42,7 @@ install_requires =
packages =
mmgen
mmgen.share
mmgen.tool
mmgen.altcoins
mmgen.altcoins.eth
mmgen.altcoins.eth.pyethereum

View file

@ -48,6 +48,7 @@ class TestSuiteHelp(TestSuiteBase):
passthru_opts = ('daemon_data_dir','rpc_port','coin','testnet')
cmd_group = (
('usage', (1,'usage message',[])),
('version', (1,'version message',[])),
('helpscreens', (1,'help screens', [])),
('longhelpscreens', (1,'help screens (--longhelp)',[])),
('show_hash_presets', (1,'info screen (--show-hash-presets)',[])),
@ -61,6 +62,11 @@ class TestSuiteHelp(TestSuiteBase):
t.req_exit_val = 1
return t
def version(self):
t = self.spawn(f'mmgen-tool',['--version'])
t.expect('MMGEN-TOOL version')
return t
def helpscreens(self,arg='--help',scripts=(),expect='USAGE:.*OPTIONS:'):
scripts = scripts or tuple(s.replace('mmgen-','') for s in os.listdir('cmds'))