1ec33767ab
every system component now has its own self-contained build system, and a seed file describing the component and its build system and dependencies. a new tool, meadow, collects and uses these seed files to build the components into a full system. meadow also manages the target system root and a host prefix where toolchain tools are installed to. the build system has also been updated to use a new $ARCH-rosetta-gcc compiler, and the patches files necessary to build it have been added to toolchain/cross-compiler.
42 lines
920 B
Python
42 lines
920 B
Python
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 len(values) < nr_args:
|
|
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 len(values) < nr_args or not found_name:
|
|
return None
|
|
|
|
if len(values) == 1:
|
|
return values[0]
|
|
|
|
return values
|