From a9a07cd3879ce165c2ac01fa242ad93f40a6ac6b Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 23 Dec 2013 10:13:20 +0000 Subject: add glob option to command line --- python2/pyinotify.py | 5 ++++- python3/pyinotify.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python2/pyinotify.py b/python2/pyinotify.py index 7d6b05f..a14793c 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -2258,6 +2258,9 @@ def command_line(): parser.add_option("-a", "--auto_add", action="store_true", dest="auto_add", help="Automatically add watches on new directories") + parser.add_option("-g", "--glob", action="store_true", + dest="glob", + help="Treat paths as globs") parser.add_option("-e", "--events-list", metavar="EVENT[,...]", dest="events_list", help=("A comma-separated list of events to watch for - " @@ -2333,7 +2336,7 @@ def command_line(): log.debug('Start monitoring %s, (press c^c to halt pyinotify)' % path) - wm.add_watch(path, mask, rec=options.recursive, auto_add=options.auto_add) + wm.add_watch(path, mask, rec=options.recursive, auto_add=options.auto_add, do_glob=options.glob) # Loop forever (until sigint signal get caught) notifier.loop(callback=cb_fun) diff --git a/python3/pyinotify.py b/python3/pyinotify.py index f72fec1..de88c65 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -2239,6 +2239,9 @@ def command_line(): parser.add_option("-a", "--auto_add", action="store_true", dest="auto_add", help="Automatically add watches on new directories") + parser.add_option("-g", "--glob", action="store_true", + dest="glob", + help="Treat paths as globs") parser.add_option("-e", "--events-list", metavar="EVENT[,...]", dest="events_list", help=("A comma-separated list of events to watch for - " @@ -2314,7 +2317,7 @@ def command_line(): log.debug('Start monitoring %s, (press c^c to halt pyinotify)' % path) - wm.add_watch(path, mask, rec=options.recursive, auto_add=options.auto_add) + wm.add_watch(path, mask, rec=options.recursive, auto_add=options.auto_add, do_glob=options.glob) # Loop forever (until sigint signal get caught) notifier.loop(callback=cb_fun) -- cgit v1.2.1