Input validation, show # targets attacked when completed

This commit is contained in:
derv82
2017-05-15 23:32:53 -04:00
parent e6c02bd98b
commit c23e228d3c
2 changed files with 7 additions and 3 deletions

View File

@@ -169,11 +169,13 @@ class Scanner(object):
if '-' in choice:
# User selected a range
(lower,upper) = [int(x) - 1 for x in choice.split('-')]
for i in xrange(lower, upper):
for i in xrange(lower, min(len(self.targets), upper)):
chosen_targets.append(self.targets[i])
else:
elif choice.isdigit():
choice = int(choice) - 1
chosen_targets.append(self.targets[choice])
else:
pass
return chosen_targets