Browse files

Check if the given bugnumber is an integer

  • Loading branch information...
tom111 committed Feb 17, 2012
1 parent 49dd0b0 commit 840142e3ab72140e77cdb6ef7b9cec09f689f2a6
Showing with 10 additions and 0 deletions.
  1. +10 −0 scripts/tatt
@@ -48,6 +48,10 @@ parser.add_option("-j", "--jobname",
parser.add_option("-b", "--bug",
help="do the full program for a given stable request bug",
+ # type="int",
+ # We could test this here, but in most cases the bugnumber
+ # is actually used as a string, so we validate further down
+ # and leave it as a string
parser.add_option("-s", "--success",
help="Comment that the program was successfully tested",
@@ -83,6 +87,12 @@ parser.add_option("-o", "--overview" "--browse",
# Normalize the template dir:
+# Test if the bugnumber represents an int
+ int(options.bugnum)
+except ValueError:
+ print ("The bugnumber you gave with -b should be an integer.")
+ exit(1);
## Checking for root, tatt should be run as a user, I guess.

0 comments on commit 840142e

Please sign in to comment.