Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
args = parser.parse_args()
if args.subparser_name is None:
parser.print_help()
return
if not args.verbose:
sys.excepthook = non_verbose_error_handler
warnings.formatwarning = non_verbose_warning_formatter
if args.subparser_name == "create-template":
# Pass the arguments to the create_template function
# If the schema file does not exist we catch it in this exception
try:
# Note: Ensures that empty arguments are not passed to the create_template function
create_template(**kwargs_from_parsed_args(args))
except (OSError, IOError) as e:
print(str(e))
return
elif args.subparser_name == "flatten":
flatten(**kwargs_from_parsed_args(args))
elif args.subparser_name == "unflatten":
unflatten(**kwargs_from_parsed_args(args))