+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "hu:l:i", ["help",
+ "user=",
+ "limit=",
+ "insecure"])
+ except getopt.GetoptError, err:
+ # print help information and exit:
+ print str(err) # will print something like "option -a not recognized"
+ usage()
+ sys.exit(2)
+
+ for o, a in opts:
+ if o == "-v":
+ verbose = True
+ elif o in ("-u", "--user"):
+ username = a
+ elif o in ("-l", "--limit"):
+ entryLimit = int(a)
+ elif o in ("-i", "--insecure"):
+ print( "Warning: Including secure entries in XML output" )
+ includeSecure = True
+ elif o in ("-h", "--help"):
+ usage()
+ sys.exit()
+ else:
+ assert False, "unhandled option"