Add customizable writers, configs, chain spec in network
This commit is contained in:
@@ -6,6 +6,7 @@ import sys
|
||||
import importlib
|
||||
|
||||
# external imports
|
||||
import chainlib.cli
|
||||
import cic.cmd.init as cmd_init
|
||||
import cic.cmd.show as cmd_show
|
||||
import cic.cmd.export as cmd_export
|
||||
@@ -15,11 +16,10 @@ logg = logging.getLogger()
|
||||
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
data_dir = os.path.join(script_dir, '..', 'data')
|
||||
base_config_dir = os.path.join(data_dir, 'config')
|
||||
schema_dir = os.path.join(script_dir, '..', 'schema')
|
||||
|
||||
argparser = argparse.ArgumentParser(description='CIC cli tool for generating and publishing tokens')
|
||||
argparser.add_argument('-v', help='be verbose', action='store_true')
|
||||
argparser.add_argument('-vv', help='be more verbose', action='store_true')
|
||||
argparser = chainlib.cli.ArgumentParser(env=os.environ, description='CIC cli tool for generating and publishing tokens')
|
||||
|
||||
sub = argparser.add_subparsers()
|
||||
sub.dest = 'command'
|
||||
@@ -31,11 +31,7 @@ sub_export = sub.add_parser('export', help='export cic data directory state to a
|
||||
cmd_export.process_args(sub_export)
|
||||
|
||||
args = argparser.parse_args(sys.argv[1:])
|
||||
|
||||
if args.v == True:
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
elif args.vv == True:
|
||||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
config = chainlib.cli.Config.from_args(args, base_config_dir=base_config_dir)
|
||||
|
||||
if args.command == None:
|
||||
logg.critical('Subcommand missing')
|
||||
@@ -45,7 +41,6 @@ modname = 'cic.cmd.{}'.format(args.command)
|
||||
logg.debug('using module {}'.format(modname))
|
||||
cmd_mod = importlib.import_module(modname)
|
||||
|
||||
config = None
|
||||
|
||||
def main():
|
||||
#try:
|
||||
|
||||
Reference in New Issue
Block a user