cucchiaiata/script/cucchiaiata-cli

32 lines
763 B
Python
Executable File

#!/usr/bin/env python3
"""Zephir-cmd-input script
"""
from sys import exit, argv
from json import dumps
from traceback import print_exc
from cucchiaiata import Parser, config, Configuration
from cucchiaiata.i18n import _
def main():
try:
if argv[1] in ['setting.session.server.configure',
'setting.session.servermodel.configure']:
Configuration().get()
else:
parser = Parser()
print(dumps(parser.get(),
indent=config.indent))
except Exception as err:
if config.debug:
print_exc()
print(_('Error: {}').format(err))
exit(1)
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
pass