-parser = OptionParser(usage="usage: %prog [options] MIIDs")
-parser.add_option("-b", "--bid",
- action="store",
- type="int",
- dest="bid",
- help="Serial Number of your EnverBridge")
-(options, args) = parser.parse_args()
+parser = argparse.ArgumentParser()
+parser.add_argument("-b",
+ "--bid",
+ action="store",
+ type=int,
+ dest="bid",
+ required=True,
+ help="Serial Number of your EnverBridge")
+parser.add_argument("miids", nargs="+", help="MIIDs of your MicroInverter")
+args = parser.parse_args()