Return a non-zero error code if anything is left out
This commit is contained in:
parent
ceac602325
commit
048dd09cc2
2 changed files with 6 additions and 1 deletions
|
|
@ -88,6 +88,7 @@ def main() -> None:
|
|||
|
||||
output_lines = []
|
||||
output_lines.extend(preamble_lines)
|
||||
left_out = False
|
||||
|
||||
for section in sections:
|
||||
if not section["hunks"]:
|
||||
|
|
@ -99,6 +100,8 @@ def main() -> None:
|
|||
hunk_text = "".join(hunk_lines)
|
||||
if should_include_hunk(hunk_text, search, replace):
|
||||
kept_hunks.append(hunk_lines)
|
||||
else:
|
||||
left_out = True
|
||||
|
||||
if not kept_hunks:
|
||||
continue
|
||||
|
|
@ -108,6 +111,8 @@ def main() -> None:
|
|||
output_lines.extend(hunk_lines)
|
||||
|
||||
sys.stdout.write("".join(output_lines))
|
||||
if left_out:
|
||||
raise SystemExit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue