meta: add sources from prototype meadow build system

This commit is contained in:
2026-07-19 17:54:05 +01:00
parent 5781a30ea0
commit 185de46621
18 changed files with 2171 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
class Args:
def __init__(self, argv):
self.__argv = argv
def get_positional(self, index):
if len(self.__argv) > index:
return self.__argv[index]
return None
def get_named(self, name, index, nr_args):
found_name = False
values = []
for s in self.__argv:
if found_name:
if nr_args > 0:
nr_args -= 1
values.append(s)
continue
else:
break
if s == '--{}'.format(name):
if index > 0:
index -= 1
continue
found_name = True
continue
if nr_args == 0:
return found_name
if nr_args > 0 or not found_name:
return None
if len(values) == 1:
return values[0]
return values