1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

list command: adding --packaged-only option

With this option, only extensions packaged with WA itself will be
listed. Extensions discovered from other packages or from local paths
will not appear in the list.
This commit is contained in:
Sergei Trofimov 2015-09-22 08:41:53 +01:00
parent d7ef6ff8ba
commit 0608356465

View File

@ -31,6 +31,11 @@ class ListCommand(Command):
'one of: {}'.format(', '.join(extension_types))), 'one of: {}'.format(', '.join(extension_types))),
choices=extension_types) choices=extension_types)
self.parser.add_argument('-n', '--name', help='Filter results by the name specified') self.parser.add_argument('-n', '--name', help='Filter results by the name specified')
self.parser.add_argument('-o', '--packaged-only', action='store_true',
help='''
Only list extensions packaged with WA itself. Do not list extensions
installed locally or from other packages.
''')
self.parser.add_argument('-p', '--platform', help='Only list results that are supported by ' self.parser.add_argument('-p', '--platform', help='Only list results that are supported by '
'the specified platform') 'the specified platform')
@ -39,7 +44,11 @@ class ListCommand(Command):
if args.name: if args.name:
filters['name'] = args.name filters['name'] = args.name
ext_loader = ExtensionLoader(packages=settings.extension_packages, paths=settings.extension_paths) if args.packaged_only:
ext_loader = ExtensionLoader()
else:
ext_loader = ExtensionLoader(packages=settings.extension_packages,
paths=settings.extension_paths)
results = ext_loader.list_extensions(args.kind[:-1]) results = ext_loader.list_extensions(args.kind[:-1])
if filters or args.platform: if filters or args.platform:
filtered_results = [] filtered_results = []