- parser = argparse.ArgumentParser(description='Choose an avaiable port and run ssh.')
- parser.add_argument('-i', '--id', dest='id', help='the unique id of remote machine, such as rpdzkj-080027a6f8dc, where the rpdzkj is the user, and 080027a6f8dc is the mac addres', required=True)
- #parser.add_argument('connect', help='list all connected devices')
- #parser.add_argument('list', help='list all connected devices')
+ parser = argparse.ArgumentParser(description='Choose an avaiable port and run ssh.', add_help=False)
+ parser.add_argument('--help', action='help')
+ parser.add_argument('-h', '--host', help='the mqtt server', default=MQTT_SERVER)
+ parser.add_argument('-p', '--port', type=int, help='the mqtt port', default=MQTT_PORT)
+ subparsers = parser.add_subparsers(title='subcommands', dest='action', help='xxx')
+ parser_conn = subparsers.add_parser('connect', help='Connect to the specific device')
+ parser_conn.add_argument('device', help='the MAC address of remote device, in the form of 080027a6f8dc')
+ parser_lsit = subparsers.add_parser('list', help='list all connected devices')