MCPcopy Create free account
hub / github.com/geekcomputers/Python / process_files

Function process_files

Cat/cat.py:65–84  ·  view source on GitHub ↗

Process all given filenames.

(files, args)

Source from the content-addressed store, hash-verified

63
64
65def process_files(files, args):
66 """Process all given filenames."""
67 had_error = False
68
69 state = {
70 "line_number": 1,
71 "previous_was_blank": False,
72 }
73
74 for filename in files:
75 try:
76 if filename == "-":
77 process_stream(sys.stdin, args, state)
78 else:
79 process_file(filename, args, state)
80 except OSError as err:
81 print(f"cat: {filename}: {err}", file=sys.stderr)
82 had_error = True
83
84 return had_error
85
86
87def parse_arguments():

Callers 1

mainFunction · 0.85

Calls 2

process_streamFunction · 0.85
process_fileFunction · 0.85

Tested by

no test coverage detected