Sort repeat_read's imports and keep its sed range's names apart
This commit is contained in:
@@ -5,9 +5,9 @@ Lines are in context when earlier reads' results show each of them, as the file
|
||||
import dataclasses
|
||||
import re
|
||||
|
||||
from claude_code.entries import parse_entry, part_text, parts
|
||||
from rule_hook.call import Call, text
|
||||
from rule_hook.rules import Breach
|
||||
from rule_hook.call import Call, text
|
||||
from claude_code.entries import parse_entry, part_text, parts
|
||||
from shell_command import resolved, simple_commands
|
||||
|
||||
# The lines a Read without a limit returns.
|
||||
@@ -57,8 +57,8 @@ def asked_lines(tool: object, given: object, cwd: str, home: str) -> Asked | Non
|
||||
if name == "head" and (counted := HEAD_COUNT.fullmatch(" ".join(options) or "-10")):
|
||||
return Asked(path, 1, int(counted.group(1)))
|
||||
if name == "sed" and len(options) == 2 and options[0] == "-n" and (ranged := SED_RANGE.fullmatch(options[1])):
|
||||
first, last = ranged.groups()
|
||||
return Asked(path, int(first), None if last == "$" else int(last or first))
|
||||
start, end = ranged.groups()
|
||||
return Asked(path, int(start), None if end == "$" else int(end or start))
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user