[openssl-commits] [tools] master update
Rich Salz
rsalz at openssl.org
Wed Oct 4 16:40:50 UTC 2017
The branch master has been updated
via 582229603e58fa824befa40c12df3e187f4e1553 (commit)
from b1c40977caef9d447da0f94a6496648c56fcd6a6 (commit)
- Log -----------------------------------------------------------------
commit 582229603e58fa824befa40c12df3e187f4e1553
Author: Rich Salz <rsalz at openssl.org>
Date: Wed Oct 4 12:40:42 2017 -0400
Add -f flag for full output
-----------------------------------------------------------------------
Summary of changes:
license/finduser | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/license/finduser b/license/finduser
index 13caad4..1b44299 100755
--- a/license/finduser
+++ b/license/finduser
@@ -3,6 +3,7 @@
Flags:
-1 Print just email
+ -f Also print the comment
Arguments is a list of SQL paterns (will get wrapped in wildcards, %),
by default display full information as CSV.
@@ -21,25 +22,30 @@ conn = mysql.connector.connect(**dbconfig)
cursor = conn.cursor()
single = 0
-opts, args = getopt.getopt(sys.argv[1:], "1")
+full = 0
+opts, args = getopt.getopt(sys.argv[1:], "1f")
for o,a in opts:
if o == '-1':
single = 1
+ elif o == '-f':
+ full = 1
else:
print __doc__
raise SystemExit
-q = ('SELECT users.uid,email,reply,name,count(log.uid) FROM users'
+q = ('SELECT users.uid,email,reply,name,count(log.uid),comment FROM users'
' LEFT JOIN log ON log.uid = users.uid'
' WHERE email like %s GROUP BY email' )
for email in args:
pat = '%' + email + '%'
cursor.execute(q, (pat,))
for row in cursor:
- uid,email,reply,name,count = row
+ uid,email,reply,name,count,comment = row
if reply == None:
reply = '-'
if single:
print email
else:
print '%d, %s, %s, %d, "%s"' % (uid, email, reply, count, name)
+ if full:
+ print '# ', comment
More information about the openssl-commits
mailing list