|
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 |
|
@@ -184,12 +184,12 @@ def client(host, port): |
184 | 184 | Standalone REST-JSON API wrapper function |
185 | 185 | """ |
186 | 186 |
|
187 | | - parser = argparse.ArgumentParser() |
188 | | - parser.add_argument("-s", "--server", help="Act as a REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store_true", required=False) |
189 | | - parser.add_argument("-c", "--client", help="Act as a REST-JSON API client", default=RESTAPI_SERVER_PORT, action="store_true", required=False) |
190 | | - parser.add_argument("-H", "--host", help="Host of the REST-JSON API server", default="0.0.0.0", action="store", required=False) |
191 | | - parser.add_argument("-p", "--port", help="Port of the the REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store", required=False) |
192 | | - args = parser.parse_args() |
| 187 | + parser = optparse.OptionParser() |
| 188 | + parser.add_option("-s", "--server", help="Act as a REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store_true") |
| 189 | + parser.add_option("-c", "--client", help="Act as a REST-JSON API client", default=RESTAPI_SERVER_PORT, action="store_true") |
| 190 | + parser.add_option("-H", "--host", help="Host of the REST-JSON API server", default="0.0.0.0", action="store") |
| 191 | + parser.add_option("-p", "--port", help="Port of the the REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store") |
| 192 | + (args, _) = parser.parse_args() |
193 | 193 |
|
194 | 194 | if args.server is True: |
195 | 195 | restAPIrun(args.host, args.port) |
|
0 commit comments