Support multiple subnet files (multiple -s options)

When passing multiple subnet files, e.g., by using -s/--subnets
multiple times or by using it together with subnets passed as positional
arguments append the content from all sources instead of only using the
subnets from the last source. This makes the behaviour of -s/--subnets
consistent with -x/--exclude.
This commit is contained in:
vieira 2016-03-30 23:16:29 +00:00 committed by Brian May
parent 8fa45885cc
commit 6e15e69029
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ def main():
elif opt.hostwatch:
return hostwatch.hw_main(opt.subnets)
else:
includes = opt.subnets_from_file or opt.subnets
includes = opt.subnets
excludes = opt.exclude
if not includes and not opt.auto_nets:
parser.error('at least one subnet, subnet file, or -N expected')

View File

@ -268,7 +268,8 @@ parser.add_argument(
parser.add_argument(
"-s", "--subnets",
metavar="PATH",
dest="subnets_from_file",
action=Concat,
dest="subnets",
type=parse_subnet_file,
help="""
file where the subnets are stored, instead of on the command line