Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (args.files and any((settings.SCHEMAS, args.use_schemaloc))):
schema_validate = True
if schema_validate and args.profile:
profile_validate = True
if args.profile and any((args.schematron, args.xslt)):
profile_convert = True
if all((args.stix_version, args.use_schemaloc)):
raise ArgumentError("Cannot set both --stix-version and "
"--use-schemalocs")
if any((args.xslt, args.schematron)) and not args.profile:
raise ArgumentError("Profile filename is required when profile "
"conversion options are set.")
if (args.files and not any((settings.SCHEMAS, args.use_schemaloc))):
raise ArgumentError("Must provide either --use-schemaloc or "
"settings.SCHEMAS when --input-file or input-dir "
"declared")
if (args.profile and not any((profile_validate, profile_convert))):
raise ArgumentError("Profile specified but no conversion options or "
"validation options specified")
if schema_validate and args.profile:
profile_validate = True
if args.profile and any((args.schematron, args.xslt)):
profile_convert = True
if all((args.stix_version, args.use_schemaloc)):
raise ArgumentError("Cannot set both --stix-version and "
"--use-schemalocs")
if any((args.xslt, args.schematron)) and not args.profile:
raise ArgumentError("Profile filename is required when profile "
"conversion options are set.")
if (args.files and not any((settings.SCHEMAS, args.use_schemaloc))):
raise ArgumentError("Must provide either --use-schemaloc or "
"settings.SCHEMAS when --input-file or input-dir "
"declared")
if (args.profile and not any((profile_validate, profile_convert))):
raise ArgumentError("Profile specified but no conversion options or "
"validation options specified")
def _validate_args(args):
schema_validate = False
profile_validate = False
profile_convert = False
if len(sys.argv) == 1:
raise ArgumentError("Invalid arguments", show_help=True)
if (args.files and any((settings.SCHEMAS, args.use_schemaloc))):
schema_validate = True
if schema_validate and args.profile:
profile_validate = True
if args.profile and any((args.schematron, args.xslt)):
profile_convert = True
if all((args.stix_version, args.use_schemaloc)):
raise ArgumentError("Cannot set both --stix-version and "
"--use-schemalocs")
if any((args.xslt, args.schematron)) and not args.profile:
raise ArgumentError("Profile filename is required when profile "
if all((args.stix_version, args.use_schemaloc)):
raise ArgumentError("Cannot set both --stix-version and "
"--use-schemalocs")
if any((args.xslt, args.schematron)) and not args.profile:
raise ArgumentError("Profile filename is required when profile "
"conversion options are set.")
if (args.files and not any((settings.SCHEMAS, args.use_schemaloc))):
raise ArgumentError("Must provide either --use-schemaloc or "
"settings.SCHEMAS when --input-file or input-dir "
"declared")
if (args.profile and not any((profile_validate, profile_convert))):
raise ArgumentError("Profile specified but no conversion options or "
"validation options specified")
profile_convert = False
if len(sys.argv) == 1:
raise ArgumentError("Invalid arguments", show_help=True)
if (args.files and any((settings.SCHEMAS, args.use_schemaloc))):
schema_validate = True
if schema_validate and args.profile:
profile_validate = True
if args.profile and any((args.schematron, args.xslt)):
profile_convert = True
if all((args.stix_version, args.use_schemaloc)):
raise ArgumentError("Cannot set both --stix-version and "
"--use-schemalocs")
if any((args.xslt, args.schematron)) and not args.profile:
raise ArgumentError("Profile filename is required when profile "
"conversion options are set.")
if (args.files and not any((settings.SCHEMAS, args.use_schemaloc))):
raise ArgumentError("Must provide either --use-schemaloc or "
"settings.SCHEMAS when --input-file or input-dir "
"declared")
if (args.profile and not any((profile_validate, profile_convert))):
raise ArgumentError("Profile specified but no conversion options or "
"validation options specified")