diff options
author | msoulier <msoulier@63283fd4-ec1e-0410-9879-cb7f675518da> | 2007-02-23 02:09:38 +0000 |
---|---|---|
committer | msoulier <msoulier@63283fd4-ec1e-0410-9879-cb7f675518da> | 2007-02-23 02:09:38 +0000 |
commit | 8f5595c6f972f351df3cd429211ca2ab1adfa041 (patch) | |
tree | 6aa76282fcd7eaf1099502fcf01cb6d60d23216f | |
parent | 5c52975f5fa07bd4d540d3b73042b40077ec3ca3 (diff) | |
download | tftpy-8f5595c6f972f351df3cd429211ca2ab1adfa041.tar.gz |
Simplifying use of optparse. Thanks to Steven Bethard for the suggestions.
git-svn-id: https://tftpy.svn.sourceforge.net/svnroot/tftpy/trunk@63 63283fd4-ec1e-0410-9879-cb7f675518da
-rw-r--r-- | bin/tftpy_client.py | 12 | ||||
-rwxr-xr-x | bin/tftpy_server.py | 7 |
2 files changed, 0 insertions, 19 deletions
diff --git a/bin/tftpy_client.py b/bin/tftpy_client.py index c3fa1a3..961fb78 100644 --- a/bin/tftpy_client.py +++ b/bin/tftpy_client.py @@ -9,41 +9,29 @@ def main(): parser = OptionParser(usage=usage) parser.add_option('-H', '--host', - action='store', - dest='host', help='remote host or ip address') parser.add_option('-p', '--port', - action='store', - dest='port', help='remote port to use (default: 69)', default=69) parser.add_option('-f', '--filename', - action='store', - dest='filename', help='filename to fetch') parser.add_option('-b', '--blocksize', - action='store', - dest='blocksize', help='udp packet size to use (default: 512)', default=512) parser.add_option('-o', '--output', - action='store', - dest='output', help='output file (default: same as requested filename)') parser.add_option('-d', '--debug', action='store_true', - dest='debug', default=False, help='upgrade logging from info to debug') parser.add_option('-q', '--quiet', action='store_true', - dest='quiet', default=False, help="downgrade logging from info to warning") options, args = parser.parse_args() diff --git a/bin/tftpy_server.py b/bin/tftpy_server.py index 1f014ad..d424deb 100755 --- a/bin/tftpy_server.py +++ b/bin/tftpy_server.py @@ -9,29 +9,22 @@ def main(): parser = OptionParser(usage=usage) parser.add_option('-i', '--ip', - action='store', type='string', - dest='ip', help='ip address to bind to (default: INADDR_ANY)', default="") parser.add_option('-p', '--port', - action='store', type='int', - dest='port', help='local port to use (default: 69)', default=69) parser.add_option('-r', '--root', - action='store', type='string', - dest='root', help='path to serve from (default: /tftpboot)', default="/tftpboot") parser.add_option('-d', '--debug', action='store_true', - dest='debug', default=False, help='upgrade logging from info to debug') options, args = parser.parse_args() |