[lwatch-cvs] files/src settings.c,1.17,1.18
Brought to you by:
arturcz
|
From: <ar...@us...> - 2003-03-24 14:23:44
|
Update of /cvsroot/lwatch/files/src
In directory sc8-pr-cvs1:/tmp/cvs-serv2953/src
Modified Files:
settings.c
Log Message:
- legal stuff required by PCRE
Index: settings.c
===================================================================
RCS file: /cvsroot/lwatch/files/src/settings.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** settings.c 22 Mar 2003 17:56:54 -0000 1.17
--- settings.c 24 Mar 2003 14:23:41 -0000 1.18
***************
*** 50,54 ****
int omit_config=0;
! void show_usage() {
int i;
char *usage[]={
--- 50,54 ----
int omit_config=0;
! void show_licence() {
int i;
char *usage[]={
***************
*** 57,61 ****
--- 57,95 ----
"http://sourceforge.net/projects/lwatch",
"",
+ "This program is free software; you can redistribute it and/or modify",
+ "it under the terms of the GNU General Public License as published by",
+ "the Free Software Foundation; either version 2 of the License, or",
+ "(at your option) any later version.",
+ "",
+ "This program is distributed in the hope that it will be useful,",
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of",
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
+ "GNU General Public License for more details.",
+
+ "",
+ "You should have received a copy of the GNU General Public License",
+ "along with this program; if not, write to the Free Software",
+ "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA",
+ "",
+ "Regular expression support is provided by the PCRE library package,",
+ "which is open source software, written by Philip Hazel, and copyright",
+ "by the University of Cambridge, England.",
+ "PCRE library available at:",
+ "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/",
+ NULL
+ };
+ i=0;
+ while(usage[i]) {
+ printf("%s\n",usage[i++]);
+ }
+ exit(0);
+ }
+
+ void show_usage() {
+ int i;
+ char *usage[]={
"Options:",
+ " -v, --version",
+ "\tshow version and copyright notices",
" -C, --config filename",
"\tread config from filename instead of " DEF_CONF_FILE ",",
***************
*** 72,90 ****
" -h, --help",
"\tshow this info",
- "",
- "This program is free software; you can redistribute it and/or modify",
- "it under the terms of the GNU General Public License as published by",
- "the Free Software Foundation; either version 2 of the License, or",
- "(at your option) any later version.",
- "",
- "This program is distributed in the hope that it will be useful,",
- "but WITHOUT ANY WARRANTY; without even the implied warranty of",
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
- "GNU General Public License for more details.",
-
- "",
- "You should have received a copy of the GNU General Public License",
- "along with this program; if not, write to the Free Software",
- "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA",
NULL
};
--- 106,109 ----
***************
*** 98,101 ****
--- 117,121 ----
void parse_options(int argc, char **argv) {
static struct option opt[] = {
+ {"version",0,0,'v'},
{"config",1,0,'C'},
{"fifo",1,0,'f'},
***************
*** 116,120 ****
#endif
memset(&lw_conf,0,sizeof(lw_conf));
! while((c=getopt_long(argc,argv,"C:f:cosh",opt,&idx))!=EOF) {
switch(c) {
case 'C':
--- 136,140 ----
#endif
memset(&lw_conf,0,sizeof(lw_conf));
! while((c=getopt_long(argc,argv,"vC:f:cosh",opt,&idx))!=EOF) {
switch(c) {
case 'C':
***************
*** 156,159 ****
--- 176,182 ----
#endif
break;
+ case 'v':
+ show_licence();
+ break;
case 'h':
show_usage();
***************
*** 163,167 ****
break;
default:
! show_usage();
}
}
--- 186,191 ----
break;
default:
! printf("Type %s -h for help\n",argv[0]);
! exit(1);
}
}
|