Skip to content

Commit

Permalink
Check for repeated flags in command line (fixes #392)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Feb 22, 2015
1 parent 1c93f05 commit 4510726
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions framework/ui/console/clparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ def _parse_help_opt(self, optsd):

def _check_options(self, optsd):
# Check for repeated flags
l = ["--hc", "--hw", "--hl", "--hh", "--hs", "--sc", "--sw", "--sl", "--sh", "--ss", "--script", "--script-args"]
if [i for i in l if i in optsd and len(optsd[i]) > 1]:
raise FuzzException(FuzzException.FATAL, "Bad usage: Only one filter could be specified at the same time.")
l = [i for i in optsd if i not in ["-z", "--zE", "-w", "-b", "-H"] and len(optsd[i]) > 1]
if l:
raise FuzzException(FuzzException.FATAL, "Bad usage: Only one %s option could be specified at the same time." % " ".join(l))

#-A and script not allowed at the same time
if "--script" in optsd.keys() and "-A" in optsd.keys():
Expand Down

0 comments on commit 4510726

Please sign in to comment.