mirror of https://github.com/borgbackup/borg.git
fix borg key/debug/benchmark crashing without subcommand, fixes #2240
This commit is contained in:
parent
a842001385
commit
23f6a82f1b
|
@ -3334,10 +3334,11 @@ class Archiver:
|
||||||
args = self.preprocess_args(args)
|
args = self.preprocess_args(args)
|
||||||
parser = self.build_parser()
|
parser = self.build_parser()
|
||||||
args = parser.parse_args(args or ['-h'])
|
args = parser.parse_args(args or ['-h'])
|
||||||
if args.func == self.do_create:
|
# This works around http://bugs.python.org/issue9351
|
||||||
|
func = getattr(args, 'func', None) or getattr(args, 'fallback_func')
|
||||||
|
if func == self.do_create and not args.paths:
|
||||||
# need at least 1 path but args.paths may also be populated from patterns
|
# need at least 1 path but args.paths may also be populated from patterns
|
||||||
if not args.paths:
|
parser.error('Need at least one PATH argument.')
|
||||||
parser.error('Need at least one PATH argument.')
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
def prerun_checks(self, logger):
|
def prerun_checks(self, logger):
|
||||||
|
|
Loading…
Reference in New Issue