Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if arg in args:
args.remove(arg)
opts["dump"] = yaml_dump
opts["quiet"] = False
for arg in ["-q", "--quiet"]:
if arg in args:
args.remove(arg)
opts["quiet"] = True
for arg in ["-L", "--line-buffer"]:
if arg not in args:
continue
args.remove(arg)
opts["loader"] = LineLoader
if len(args) == 0:
stderr("Error: Bad number of arguments.\n")
die(USAGE, errlvl=1, prefix="")
if len(args) == 1 and args[0] in ("-h", "--help"):
stdout(HELP)
exit(0)
if len(args) == 1 and args[0] in ("-V", "--version"):
version_info = get_version_info()
print("version: %s\nPyYAML: %s\nlibyaml available: %s\nlibyaml used: %s\nPython: %s"
% version_info)
exit(0)
opts["action"] = args[0]
def __init__(self, stream):
stream = ForcedLineStream(stream)
super(LineLoader, self).__init__(stream)