From dfa55c1322831d8f780598d323364455bba6f084 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Fri, 15 Jun 2018 12:04:12 +0100 Subject: [PATCH] commands/list: add "augmentations" and "all" Allow specifying "augmentations" and "all" as the plugin kind to lost. In the case of of the former, instruments and output processors get listed. In the case of the latter, every plugin kind gets listed. --- wa/commands/list.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wa/commands/list.py b/wa/commands/list.py index b9d07c3a..8a890d59 100644 --- a/wa/commands/list.py +++ b/wa/commands/list.py @@ -27,6 +27,7 @@ class ListCommand(Command): def initialize(self, context): kinds = get_kinds() + kinds.extend(['augmentations', 'all']) self.parser.add_argument('kind', metavar='KIND', help=('Specify the kind of plugin to list. Must be ' 'one of: {}'.format(', '.join(sorted(kinds)))), @@ -52,6 +53,21 @@ class ListCommand(Command): if args.kind == 'targets': list_targets() + elif args.kind == 'augmentations': + print('instruments:') + args.kind = 'instruments' + list_plugins(args, filters) + print('\noutput processors:') + args.kind = 'output_processors' + list_plugins(args, filters) + elif args.kind == 'all': + for kind in sorted(get_kinds()): + print('\n{}:'.format(kind)) + if kind == 'targets': + list_targets() + else: + args.kind = kind + list_plugins(args, filters) else: list_plugins(args, filters)