1
0

proj: Add optind to getopt

This commit is contained in:
2025-07-28 11:21:59 +02:00
parent 82d75417ef
commit 3891b11ef1
2 changed files with 6 additions and 2 deletions

View File

@@ -344,6 +344,10 @@ class Parser:
other_vals = ret[1].strip() if len(ret) > 1 else ''
ret_value, _ = Parser.parse_arg(ret[0][7:])
kwargs = {}
if other_vals.startswith('optind '):
ret = other_vals[7:].split(';', 1)
kwargs['optind'] = int(ret[0].strip())
other_vals = ret[1].strip() if len(ret) > 1 else ''
if other_vals.startswith('errno '):
ret = other_vals[6:].split(';', 1)
kwargs['errno'] = ret[0].strip()
@@ -404,7 +408,7 @@ class Parser:
def before_getopt(self, argc: int, argv: PointerTo[list[PointerTo[bytes]]], optstring: PointerTo[bytes]) -> str:
raise NotImplementedError()
def after_getopt(self, argc: int, argv: PointerTo[list[PointerTo[bytes]]], optstring: PointerTo[bytes],
ret_value: int) -> None:
ret_value: int, optind: int = None) -> None:
raise NotImplementedError()
def before_exit(self, status: int) -> str:
raise NotImplementedError()