mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-24 07:01:59 +00:00
Merge pull request #3318 from milkey-mouse/borgfs-formatting-test
Check borgfs rst formatting in tests
This commit is contained in:
commit
b3c11dee6c
1 changed files with 5 additions and 2 deletions
|
@ -3688,14 +3688,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
|
||||
|
||||
|
@ -3703,7 +3706,7 @@ def discover_level(prefix, parser, Archiver):
|
|||
discover_level(command + " ", parser, Archiver)
|
||||
parsers[command] = parser
|
||||
|
||||
discover_level("", parser, Archiver)
|
||||
discover_level("", parser, Archiver, {'borgfs': borgfs_parser})
|
||||
return parsers
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue