chainlib

Generic blockchain access library and tooling
Log | Files | Refs | README | LICENSE

commit dca1c2f8c0e41c15bfb46ad5b23fae9438fb8f8e
parent 32f023a67e390c7fdb858ff7d1c3ea5cbc756e35
Author: lash <dev@holbrook.no>
Date:   Fri,  4 Nov 2022 07:26:00 +0000

Add output selector option

Diffstat:
Mchainlib/cli/arg.py | 4++++
Mchainlib/cli/config.py | 4++++
Msetup.cfg | 2+-
3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/chainlib/cli/arg.py b/chainlib/cli/arg.py @@ -77,6 +77,7 @@ class ArgFlag(BaseArgFlag): self.add('path') self.add('backend') self.add('value') + self.add('tab') self.alias('sign', 'key_file', 'send') self.alias('std_base', 'verbose', 'config', 'raw', 'env', 'target') @@ -151,3 +152,6 @@ class Arg(BaseArg): self.add_long('state-path', 'path', help='Path to store state data under') self.add_long('runtime-path', 'path', help='Path to store volatile data under') self.add_long('backend', 'backend', help='Backend to use for data storage') + + self.add('o', 'tab', typ=str, action='append', help='Include output by key name') + self.set_long('o', 'output-key') diff --git a/chainlib/cli/config.py b/chainlib/cli/config.py @@ -59,6 +59,7 @@ def process_config(config, arg, args, flags, positional_name=None): if arg.match('raw', flags): config.add(getattr(args, 'r', None), '_RAW') + config.add(getattr(args, '0', None), '_NOLINE') if arg.match('provider', flags): args_override['RPC_PROVIDER'] = getattr(args, 'p') @@ -139,4 +140,7 @@ def process_config(config, arg, args, flags, positional_name=None): if len(pos_arg) > 0: config.add(pos_arg[0], '_POSARG', True) + if arg.match('tab', flags): + config.add(args.o, '_OUTARG', False) + return config diff --git a/setup.cfg b/setup.cfg @@ -3,7 +3,7 @@ name=chainlib license=WTFPL2 author_email=dev@holbrook.no description=Generic blockchain access library and tooling -version=0.3.3 +version=0.4.0 url=https://gitlab.com/chaintools/chainlib author=Louis Holbrook