cucchiaiata/scripts/cucchiaiata-cli

30 lines
694 B
Python
Executable File

#!/usr/bin/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 len(argv) > 2 and argv[1] == 'v1.setting.session.configure':
Configuration().get()
else:
parser = Parser()
print(dumps(parser.get(),
indent=config.indent))
except KeyboardInterrupt:
pass
except Exception as err:
if config.debug:
print_exc()
print(_('Error: {}').format(err))
exit(1)
if __name__ == "__main__":
main()