mirror of https://github.com/borgbackup/borg.git
Merge pull request #3155 from ThomasWaldmann/maincommand-help-1.1
maincommand help 1.1
This commit is contained in:
commit
17ce2f728a
|
@ -30,3 +30,11 @@ Common options
|
||||||
All Borg commands share these options:
|
All Borg commands share these options:
|
||||||
|
|
||||||
.. include:: common-options.rst.inc
|
.. include:: common-options.rst.inc
|
||||||
|
|
||||||
|
Examples
|
||||||
|
~~~~~~~~
|
||||||
|
::
|
||||||
|
|
||||||
|
# Create an archive and log: borg version, files list, return code
|
||||||
|
$ borg create --show-version --list --show-rc /path/to/repo::my-files files
|
||||||
|
|
||||||
|
|
|
@ -2156,6 +2156,8 @@ class Archiver:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
return EXIT_SUCCESS
|
return EXIT_SUCCESS
|
||||||
|
|
||||||
|
do_maincommand_help = do_subcommand_help
|
||||||
|
|
||||||
def preprocess_args(self, args):
|
def preprocess_args(self, args):
|
||||||
deprecations = [
|
deprecations = [
|
||||||
# ('--old', '--new' or None, 'Warning: "--old" has been deprecated. Use "--new" instead.'),
|
# ('--old', '--new' or None, 'Warning: "--old" has been deprecated. Use "--new" instead.'),
|
||||||
|
@ -2423,6 +2425,7 @@ class Archiver:
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(prog=self.prog, description='Borg - Deduplicated Backups',
|
parser = argparse.ArgumentParser(prog=self.prog, description='Borg - Deduplicated Backups',
|
||||||
add_help=False)
|
add_help=False)
|
||||||
|
parser.set_defaults(func=functools.partial(self.do_maincommand_help, parser))
|
||||||
parser.common_options = self.CommonOptions(define_common_options,
|
parser.common_options = self.CommonOptions(define_common_options,
|
||||||
suffix_precedence=('_maincommand', '_midcommand', '_subcommand'))
|
suffix_precedence=('_maincommand', '_midcommand', '_subcommand'))
|
||||||
parser.add_argument('-V', '--version', action='version', version='%(prog)s ' + __version__,
|
parser.add_argument('-V', '--version', action='version', version='%(prog)s ' + __version__,
|
||||||
|
|
Loading…
Reference in New Issue