File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
- __version__ = '1.1.1 '
1
+ __version__ = '1.2 '
2
2
Original file line number Diff line number Diff line change 2
2
from netaddr import IPNetwork , IPRange , IPGlob
3
3
from Interlace .lib .core .output import OutputHelper , Level
4
4
import os .path
5
+ import sys
5
6
from re import compile
6
7
7
8
@@ -81,8 +82,12 @@ def process_commands(arguments):
81
82
if arguments .target :
82
83
ranges .add (arguments .target )
83
84
else :
84
- for target in arguments .target_list :
85
- ranges .add (target .strip ())
85
+ targetFile = arguments .target_list
86
+ if not sys .stdin .isatty ():
87
+ targetFile = sys .stdin
88
+ for target in targetFile :
89
+ if target .strip ():
90
+ ranges .add (target .strip ())
86
91
87
92
# process exclusions first
88
93
if arguments .exclusions :
@@ -182,7 +187,12 @@ def parse(self, argv):
182
187
def setup_parser ():
183
188
parser = ArgumentParser ()
184
189
185
- targets = parser .add_mutually_exclusive_group (required = True )
190
+ #Is stdin attached?
191
+ requireTargetArg = True
192
+ if not sys .stdin .isatty ():
193
+ requireTargetArg = False
194
+
195
+ targets = parser .add_mutually_exclusive_group (required = requireTargetArg )
186
196
187
197
targets .add_argument (
188
198
'-t' , dest = 'target' , required = False ,
You can’t perform that action at this time.
0 commit comments