[Pcsclite-cvs-commit] r6181 - /trunk/PCSC/src/spy/pcsc-spy
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Wed Jan 18 09:46:51 UTC 2012
Author: rousseau
Date: Wed Jan 18 09:46:51 2012
New Revision: 6181
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6181
Log:
Document [-h|--help] argument
Modified:
trunk/PCSC/src/spy/pcsc-spy
Modified: trunk/PCSC/src/spy/pcsc-spy
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/spy/pcsc-spy?rev=6181&op=diff
==============================================================================
--- trunk/PCSC/src/spy/pcsc-spy (original)
+++ trunk/PCSC/src/spy/pcsc-spy Wed Jan 18 09:46:51 2012
@@ -883,19 +883,25 @@
spy = PCSCdemultiplexer(logfile, color, diffable)
spy.loop()
+
def signal_handler(sig, frame):
print 'Ctrl-C, exiting.'
os.kill(os.getpid(), signal.SIGQUIT)
+
+def print_usage():
+ print "Usage: %s [-n|--nocolor] [-d|--diffable] [-h|--help]"
+
if __name__ == "__main__":
import sys
import getopt
logfile = None
try:
- opts, args = getopt.getopt(sys.argv[1:], "nd", ["nocolor", "diffable"])
+ opts, args = getopt.getopt(sys.argv[1:], "ndh", ["nocolor",
+ "diffable", "help"])
except getopt.GetoptError:
- print "Usage: %s [-n|--nocolor] [-d|--diffable]"
+ print_usage()
sys.exit(1)
color = True
@@ -905,6 +911,9 @@
color = False
if o == "-d" or o == "--diffable":
diffable = True
+ if o == "-h" or o == "--help":
+ print_usage()
+ sys.exit(1)
if len(args) > 0:
logfile = args[0]
More information about the Pcsclite-cvs-commit
mailing list