From 1f11fb6f9628de8dcf81e209981bd0a439dbda64 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Thu, 19 Jul 2007 19:50:08 +0000 Subject: [PATCH] Verbose support for pamusb-conf --- tools/pamusb-conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/pamusb-conf b/tools/pamusb-conf index f3499c4..60422d1 100755 --- a/tools/pamusb-conf +++ b/tools/pamusb-conf @@ -161,6 +161,8 @@ def addDevice(options): try: devices.append(Device(udi)) except Exception, ex: + if options['verbose']: + print ex pass if len(devices) == 0: @@ -219,14 +221,14 @@ def addDevice(options): writeConf(options, doc) def usage(): - print 'Usage: %s [--help] [--config=path] [--add-user=name | --add-device=name]' % os.path.basename(__file__) + print 'Usage: %s [--help] [--verbose] [--config=path] [--add-user=name | --add-device=name]' % os.path.basename(__file__) sys.exit(1) import getopt try: - opts, args = getopt.getopt(sys.argv[1:], "hd:nu:c:", - ["help", "add-device=", "add-user=", "config="]) + opts, args = getopt.getopt(sys.argv[1:], "hvd:nu:c:", + ["help", "verbose", "add-device=", "add-user=", "config="]) except getopt.GetoptError: usage() @@ -234,11 +236,13 @@ if len(args) != 0: usage() options = { 'deviceName' : None, 'userName' : None, - 'configFile' : '/etc/pamusb.conf' } + 'configFile' : '/etc/pamusb.conf', 'verbose' : False } for o, a in opts: if o in ("-h", "--help"): usage() + if o in ("-v", "--verbose"): + options['verbose'] = True if o in ("-d", "--add-device"): options['deviceName'] = a if o in ("-u", "--add-user"):