summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authormsoulier <msoulier@63283fd4-ec1e-0410-9879-cb7f675518da>2006-12-15 03:04:40 +0000
committermsoulier <msoulier@63283fd4-ec1e-0410-9879-cb7f675518da>2006-12-15 03:04:40 +0000
commit5cfbae3dc795ce0029bc8d8b2e368202e3fbc3a1 (patch)
tree1d6aa6893ed86d1bc3cba147ce75e900f4d7bfad /bin
parentd5b7276fb940ce82f275aa8234164a4d8ce855cd (diff)
downloadtftpy-5cfbae3dc795ce0029bc8d8b2e368202e3fbc3a1.tar.gz
Added lots in the server to support a download, with timeouts.
Not yet tested with a client, but the damn thing runs. git-svn-id: https://tftpy.svn.sourceforge.net/svnroot/tftpy/trunk@44 63283fd4-ec1e-0410-9879-cb7f675518da
Diffstat (limited to 'bin')
-rw-r--r--bin/tftpy_client.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/tftpy_client.py b/bin/tftpy_client.py
index e5c17b7..7b5fbc5 100644
--- a/bin/tftpy_client.py
+++ b/bin/tftpy_client.py
@@ -41,8 +41,22 @@ def main():
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()
if not options.host or not options.filename:
+ sys.stderr.write("Both the --host and --filename options "
+ "are required.\n")
+ parser.print_help()
+ sys.exit(1)
+
+ if options.debug and options.quiet:
+ sys.stderr.write("The --debug and --quiet options are "
+ "mutually exclusive.\n")
parser.print_help()
sys.exit(1)
@@ -59,6 +73,8 @@ def main():
if options.debug:
tftpy.setLogLevel(logging.DEBUG)
+ elif options.quiet:
+ tftpy.setLogLevel(logging.WARNING)
else:
tftpy.setLogLevel(logging.INFO)