Merge pull request #9712 from ThomasWaldmann/addtl-help-topics-master

list additional help topics in main borg help, fixes #3432
This commit is contained in:
TW 2026-06-03 09:58:34 +02:00 committed by GitHub
commit a1dc0dd6fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 1 deletions

View file

@ -244,14 +244,27 @@ class Archiver(
self.define_common_options(add_argument)
def build_parser(self):
from ._common import define_common_options
from ._common import define_common_options, process_epilog
additional_help = process_epilog(
"""
Description of additional help topics:
Use ``borg help <topic>`` to get help on:
patterns selection patterns for including/excluding paths
match-archives selection patterns for matching archives
placeholders placeholders in repository URLs, archive names, etc.
compression options and specifications for data compression
"""
)
parser = ArgumentParser(
prog=self.prog,
description="Borg - Deduplicated Backups",
default_config_files=[os.path.join(get_config_dir(), "default.yaml")],
default_env=True,
env_prefix="BORG",
epilog=additional_help,
)
parser.add_argument("--config", action="config")
# paths and patterns must have an empty list as default everywhere

View file

@ -53,3 +53,12 @@ def test_help_formatting(command, parser):
def test_help_formatting_helptexts(topic):
helptext = Archiver.helptext[topic]
assert str(rst_to_terminal(helptext))
def test_main_help_epilog(archiver):
help_output = cmd(archiver, "-h")
assert "Description of additional help topics:" in help_output
assert "patterns" in help_output
assert "match-archives" in help_output
assert "placeholders" in help_output
assert "compression" in help_output