Commit 6e15e690 authored by vieira's avatar vieira Committed by Brian May

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.
parent 8fa45885
......@@ -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')
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment