From 0ec703ff40161e46c197a642bfa8916e2a51761d Mon Sep 17 00:00:00 2001 From: Milkey Mouse Date: Sun, 12 Nov 2017 18:36:06 -0800 Subject: [PATCH] Check borgfs man formatting in tests I only realized after the first PR was merged that the code used for finding which man pages to generate was duplicated in the testsuite (since setup.py can't import from the installed module and vice versa.) These are essentially the same changes as made to setup.py in #3290. --- src/borg/testsuite/archiver.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index f6ada2f8a..f404a4506 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -3655,14 +3655,17 @@ def get_all_parsers(): Return dict mapping command to parser. """ parser = Archiver(prog='borg').build_parser() + borgfs_parser = Archiver(prog='borgfs').build_parser() parsers = {} - def discover_level(prefix, parser, Archiver): + def discover_level(prefix, parser, Archiver, extra_choices=None): choices = {} for action in parser._actions: if action.choices is not None and 'SubParsersAction' in str(action.__class__): for cmd, parser in action.choices.items(): choices[prefix + cmd] = parser + if extra_choices is not None: + choices.update(extra_choices) if prefix and not choices: return @@ -3670,7 +3673,7 @@ def get_all_parsers(): discover_level(command + " ", parser, Archiver) parsers[command] = parser - discover_level("", parser, Archiver) + discover_level("", parser, Archiver, {'borgfs': borgfs_parser}) return parsers