MCPcopy Create free account
hub / github.com/idank/explainshell / _expand_file_lists

Function _expand_file_lists

explainshell/util.py:93–110  ·  view source on GitHub ↗

Expand @file references to their contents. A path starting with '@' is treated as a file containing one path per line. Blank lines and lines starting with '#' are skipped.

(paths: list[str])

Source from the content-addressed store, hash-verified

91
92
93def _expand_file_lists(paths: list[str]) -> list[str]:
94 """Expand @file references to their contents.
95
96 A path starting with '@' is treated as a file containing one path per line.
97 Blank lines and lines starting with '#' are skipped.
98 """
99 result: list[str] = []
100 for path in paths:
101 if path.startswith("@"):
102 list_file = path[1:]
103 with open(list_file) as f:
104 for line in f:
105 line = line.strip()
106 if line and not line.startswith("#"):
107 result.append(line)
108 else:
109 result.append(path)
110 return result
111
112
113def collect_gz_files(paths: list[str]) -> list[str]:

Callers 1

collect_gz_filesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected