diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2004-05-23 16:29:27 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2004-05-23 16:29:27 +0000 |
commit | 85dafff40303a63c70b0325c67b4bb8120cc2e4d (patch) | |
tree | b610cc2996aa86ec539a7968db45baad99e9abf9 /sysutils/fileschanged/files/patch-opts.c | |
parent | - Unmark BROKEN, it's fetchable again (diff) |
Add fileschanged, a client to the FAM (File Alteration Monitor) server.
Here's how the fileschanged FAM client works: you give it some filenames
on the command line and then it monitors those files for changes. When it
discovers that a file has changed (or has been altered), it displays
the filename on the standard-output.
PR: ports/66894
Submitted by: Konstantin Reznichenko <kot@premierbank.dp.ua>
Notes
Notes:
svn path=/head/; revision=109792
Diffstat (limited to 'sysutils/fileschanged/files/patch-opts.c')
-rw-r--r-- | sysutils/fileschanged/files/patch-opts.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sysutils/fileschanged/files/patch-opts.c b/sysutils/fileschanged/files/patch-opts.c new file mode 100644 index 000000000000..f2ee24633b09 --- /dev/null +++ b/sysutils/fileschanged/files/patch-opts.c @@ -0,0 +1,28 @@ +--- src/opts.c.orig Mon Feb 23 01:17:30 2004 ++++ src/opts.c Sun May 23 17:52:10 2004 +@@ -19,6 +19,7 @@ + const char filelist_option_explanation[]="Monitor the list of filenames inside FILE"; + const char filechangetimeout_option_explanation[]="Delay showing changed files for N seconds (Def=2)"; + const char showaction_option_explanation[]="Also display action when displaying altered files"; ++const char execcmd_option_explanation[]="Execute COMMAND when file altered (COMMAND action filename)"; + + struct arguments_t arguments; + static struct argp_option options[] = +@@ -34,6 +35,7 @@ + {"filelist", 'l',"FILENAME",0, filelist_option_explanation, 3}, + {"timeout", 't',"N",0, filechangetimeout_option_explanation, 4}, + {"prepend-action", 'p',0,0, showaction_option_explanation, 5}, ++ {"execcmd", 'x',"COMMAND",0, execcmd_option_explanation, 6}, + { 0 } + }; + +@@ -93,6 +95,9 @@ + arguments->fileschanged.filechangetimeout=atoi(arg); + if (arguments->fileschanged.filechangetimeout<=1) + arguments->fileschanged.filechangetimeout=-1; ++ break; ++ case 'x': ++ arguments->fileschanged.exec_command=strdup(arg); + break; + case ARGP_KEY_INIT: + free_arguments(); |