summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <grooverdan@users.sourceforge.net>2013-12-23 10:13:20 +0000
committerDaniel Black <grooverdan@users.sourceforge.net>2013-12-23 10:13:20 +0000
commita9a07cd3879ce165c2ac01fa242ad93f40a6ac6b (patch)
tree8dfe58503359ddc76737dcf43dcf0719cd54be25
parent51aa5bd8c22c5ff8c730f97178f000b55cb02f0f (diff)
downloadpyinotify-a9a07cd3879ce165c2ac01fa242ad93f40a6ac6b.tar.gz
add glob option to command line
-rwxr-xr-xpython2/pyinotify.py5
-rwxr-xr-xpython3/pyinotify.py5
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)