|
5 | 5 | See the file 'doc/COPYING' for copying permission |
6 | 6 | """ |
7 | 7 |
|
8 | | -import argparse |
| 8 | +import optparse |
9 | 9 | import os |
10 | 10 | import sys |
11 | 11 | import threading |
@@ -210,12 +210,12 @@ def client(host, port): |
210 | 210 | Standalone REST-JSON API wrapper function |
211 | 211 | """ |
212 | 212 |
|
213 | | - parser = argparse.ArgumentParser() |
214 | | - parser.add_argument("-s", "--server", help="Act as a REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store_true", required=False) |
215 | | - parser.add_argument("-c", "--client", help="Act as a REST-JSON API client", default=RESTAPI_SERVER_PORT, action="store_true", required=False) |
216 | | - parser.add_argument("-H", "--host", help="Host of the REST-JSON API server", default="0.0.0.0", action="store", required=False) |
217 | | - parser.add_argument("-p", "--port", help="Port of the the REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store", required=False) |
218 | | - args = parser.parse_args() |
| 213 | + parser = optparse.OptionParser() |
| 214 | + parser.add_option("-s", "--server", help="Act as a REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store_true") |
| 215 | + parser.add_option("-c", "--client", help="Act as a REST-JSON API client", default=RESTAPI_SERVER_PORT, action="store_true") |
| 216 | + parser.add_option("-H", "--host", help="Host of the REST-JSON API server", default="0.0.0.0", action="store") |
| 217 | + parser.add_option("-p", "--port", help="Port of the the REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store") |
| 218 | + (args, _) = parser.parse_args() |
219 | 219 |
|
220 | 220 | if args.server is True: |
221 | 221 | restAPIrun(args.host, args.port) |
|
0 commit comments