# HG changeset patch # User Steve Losh # Date 1449662710 0 # Node ID 2e99c3f5e7eeee80ba99e00721620c6be8880728 # Parent 4602c8a6735aa58d60f2966bebd08300ba6a56ff Add --version diff -r 4602c8a6735a -r 2e99c3f5e7ee ffind --- a/ffind Wed Dec 09 11:57:46 2015 +0000 +++ b/ffind Wed Dec 09 12:05:10 2015 +0000 @@ -18,6 +18,7 @@ # Constants ------------------------------------------------------------------- +VERSION = ('1', '0', '0') CASE_SENSITIVE = 1 CASE_INSENSITIVE = 2 CASE_SMART = 3 @@ -500,6 +501,9 @@ p = OptionParser("usage: %prog [options] PATTERN") # Main options + p.add_option('--version', + action='store_true', default=False, + help='print the version and exit') p.add_option('-d', '--dir', default='.', help='root the search in DIR (default .)', metavar='DIR') @@ -785,6 +789,10 @@ (options, args) = build_option_parser().parse_args() + if options.version: + print('friendly-find version %s' % '.'.join(VERSION)) + sys.exit(0) + # PATTERN if len(args) > 1: die("only one search pattern can be given")