Skip to content

Commit 73a66d6

Browse files
author
Gervase Markham
committed
More arguments for flic.
1 parent cc4e944 commit 73a66d6

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

flic

+17-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
not everyone may want.
2424
"""
2525

26-
# Set debug logging level here
26+
_version_ = (1, 0, 0)
27+
2728
import logging
28-
logging.basicConfig(filename="flic.log", level=logging.DEBUG)
29+
logging.basicConfig(filename="flic.log")
2930
log = logging.getLogger("flic")
3031

3132
import sys
@@ -187,12 +188,24 @@ def main(argv):
187188
parser = argparse.ArgumentParser(description=\
188189
'Collate and process license information.')
189190
parser.add_argument('--template', metavar="<template>",
190-
help='Render the given template name')
191-
parser.add_argument('--input', metavar="<input file>", action="append",
191+
help='render the given template name')
192+
parser.add_argument('-i', '--input', metavar="<input file>", action="append",
192193
help='JSON output of "slic" program')
194+
parser.add_argument('-V', '--version', action="store_true",
195+
help='show version number and exit')
196+
parser.add_argument('-d', '--debug', action="store_true",
197+
help='output debugging info to flic.log')
193198

194199
args = parser.parse_args()
195200

201+
if args.version:
202+
ver = '.'.join([str(part) for part in _version_])
203+
print "flic %s" % ver
204+
return
205+
206+
if args.debug:
207+
log.setLevel(logging.DEBUG)
208+
196209
# Load occurrence data file
197210
bytag = SlicResults()
198211
for filename in args.input:

slic

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
Log data is written to slic.log in the current directory.
3131
"""
3232

33+
_version_ = (1, 0, 0)
34+
3335
import logging
3436
logging.basicConfig(filename="slic.log")
3537
log = logging.getLogger("slic")
@@ -54,8 +56,6 @@ import utils
5456
import codecs
5557
sys.stdout=codecs.getwriter('utf-8')(sys.stdout)
5658

57-
_version_ = (1, 0, 0)
58-
5959
backup_pattern = re.compile("~\d+$")
6060

6161
def _should_skip_file(root, basename):

0 commit comments

Comments
 (0)