Answer stability round 1: 1 🔴, 5 🟡 (0 misread); the 🔴, the rule text and the PATH half of the exemption were answered in the principles round 1 commit; exempt no docker under sudo or doas, test unknown memory and the shim without a share, keep helped beside unlimited, drop a dead fallback

This commit is contained in:
2026-10-24 11:37:08 +02:00
parent e551a2b5a9
commit c87e9f19d6
5 changed files with 23 additions and 12 deletions
+6 -6
View File
@@ -71,6 +71,12 @@ def unlimited(arguments: list[str]) -> bool:
return subcommand in STARTS_CONTAINER and not limited and not helped(arguments)
def helped(arguments: list[str]) -> bool:
"""Whether docker only prints its help: a --help before the subcommand or as the first word after it, not one the container's own command takes."""
after = subcommand_at(arguments)[-1] + 1
return "--help" in arguments[:after + 1]
def capped(arguments: list[str], share: str) -> list[str]:
"""docker's arguments, with each limit a container they make lacks added right after the subcommand.
@@ -109,9 +115,3 @@ def option_at(arguments: list[str], options: tuple[str, ...], fits: typing.Calla
if word == option and fits(following):
return Option(at, 2, following)
return None
def helped(arguments: list[str]) -> bool:
"""Whether docker only prints its help: a --help before the subcommand or as the first word after it, not one the container's own command takes."""
after = subcommand_at(arguments)[-1] + 1
return "--help" in arguments[:after + 1]