Skip to content

Commit

Permalink
add glob option to command line
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Dec 23, 2013
1 parent 51aa5bd commit a9a07cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python2/pyinotify.py
Expand Up @@ -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 - "
Expand Down Expand Up @@ -2333,7 +2336,7 @@ def cb(s):

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)

Expand Down
5 changes: 4 additions & 1 deletion python3/pyinotify.py
Expand Up @@ -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 - "
Expand Down Expand Up @@ -2314,7 +2317,7 @@ def cb(s):

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)

Expand Down

0 comments on commit a9a07cd

Please sign in to comment.