forked from Imagelibrary/rtems
37
rtems-bsps
37
rtems-bsps
@@ -262,6 +262,34 @@ class ArchBsps:
|
|||||||
else:
|
else:
|
||||||
self._out('%-*s |%s' % (max_bsp, bsp, family))
|
self._out('%-*s |%s' % (max_bsp, bsp, family))
|
||||||
|
|
||||||
|
def pairs(self, arch_selector=None, family_selector=None, show_path=False):
|
||||||
|
"""Generate output as pairs"""
|
||||||
|
self._clear()
|
||||||
|
max_arch = self._max_arch_len()
|
||||||
|
max_bsp = self._max_bsp_len()
|
||||||
|
if arch_selector is None:
|
||||||
|
arch_matcher = []
|
||||||
|
else:
|
||||||
|
arch_matcher = [a.strip() for a in arch_selector.split(',')]
|
||||||
|
if family_selector is None:
|
||||||
|
family_matcher = []
|
||||||
|
else:
|
||||||
|
family_matcher = [f.strip() for f in family_selector.split(',')]
|
||||||
|
for arch in sorted(self.archs.keys()):
|
||||||
|
if arch_selector is None or arch in arch_matcher:
|
||||||
|
for family in sorted(self.archs[arch].keys()):
|
||||||
|
if family_selector is None or family in family_matcher:
|
||||||
|
for bsp in sorted(self.archs[arch][family].keys()):
|
||||||
|
if show_path:
|
||||||
|
p = os.path.join('bsps',
|
||||||
|
self.archs[arch][family][bsp])
|
||||||
|
pair = arch + '/' + bsp
|
||||||
|
pair = '%-*s %s' % (max_arch + max_bsp + 1, pair, p)
|
||||||
|
|
||||||
|
self._out(pair)
|
||||||
|
else:
|
||||||
|
self._out('%s/%s' % (arch, bsp))
|
||||||
|
|
||||||
|
|
||||||
def run(args):
|
def run(args):
|
||||||
"""Runs the command"""
|
"""Runs the command"""
|
||||||
@@ -294,6 +322,10 @@ def run(args):
|
|||||||
'--trace',
|
'--trace',
|
||||||
help='Verbose or trace for debugging',
|
help='Verbose or trace for debugging',
|
||||||
action='store_true')
|
action='store_true')
|
||||||
|
argsp.add_argument('-P',
|
||||||
|
'--pairs',
|
||||||
|
help='Output architectures and BSPs in CPU/BSP format',
|
||||||
|
action='store_true')
|
||||||
|
|
||||||
argopts = argsp.parse_args(args[1:])
|
argopts = argsp.parse_args(args[1:])
|
||||||
|
|
||||||
@@ -308,6 +340,11 @@ def run(args):
|
|||||||
family_selector=argopts.family,
|
family_selector=argopts.family,
|
||||||
show_path=argopts.paths,
|
show_path=argopts.paths,
|
||||||
show_title=argopts.title)
|
show_title=argopts.title)
|
||||||
|
else:
|
||||||
|
if argopts.pairs:
|
||||||
|
ab.pairs(arch_selector=argopts.arch,
|
||||||
|
family_selector=argopts.family,
|
||||||
|
show_path=argopts.paths)
|
||||||
else:
|
else:
|
||||||
ab.text(arch_selector=argopts.arch,
|
ab.text(arch_selector=argopts.arch,
|
||||||
family_selector=argopts.family,
|
family_selector=argopts.family,
|
||||||
|
|||||||
Reference in New Issue
Block a user