Browse Source

Fix for port argument

master
Dirk Alders 1 day ago
parent
commit
347b253325
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      mqtt_sniffer.py

+ 1
- 1
mqtt_sniffer.py View File

75
 if __name__ == "__main__":
75
 if __name__ == "__main__":
76
     parser = argparse.ArgumentParser(description='This is a mqtt sniffer.')
76
     parser = argparse.ArgumentParser(description='This is a mqtt sniffer.')
77
     parser.add_argument('-f', dest='hostname', default='localhost', help='Hostname of the mqtt server')
77
     parser.add_argument('-f', dest='hostname', default='localhost', help='Hostname of the mqtt server')
78
-    parser.add_argument('-p', dest='port', default=1883, help='Port of the mqtt server')
78
+    parser.add_argument('-p', dest='port', default=1883, type=int, help='Port of the mqtt server')
79
     parser.add_argument('-n', dest='no_credentials', action='store_true', help='Avoid asking for credentials')
79
     parser.add_argument('-n', dest='no_credentials', action='store_true', help='Avoid asking for credentials')
80
     parser.add_argument('-u', dest='username', default=None, help='Set username for mqtt server')
80
     parser.add_argument('-u', dest='username', default=None, help='Set username for mqtt server')
81
     parser.add_argument('-t', dest='topicfilter', default="", help='Set topic filter')
81
     parser.add_argument('-t', dest='topicfilter', default="", help='Set topic filter')

Loading…
Cancel
Save