Added a -h option to sicslog querying

Fixed the mongodb path in sicslogmain to point to the production server
This commit is contained in:
2016-04-14 14:57:55 +02:00
parent 1fb85ef6b5
commit 78f6b92960
4 changed files with 18 additions and 6 deletions

View File

@ -87,7 +87,7 @@ int sicslogQuery(int argc, char *argv[], ResultCallback_t func, void *userData)
parse options
*/
optind = 1;
while((c = getopt(argc,argv,"s:l:f:t:i:e:c:")) != -1) {
while((c = getopt(argc,argv,"s:l:f:t:i:e:c:h")) != -1) {
switch (c){
case 's':
sub = strdup(optarg);
@ -129,6 +129,13 @@ int sicslogQuery(int argc, char *argv[], ResultCallback_t func, void *userData)
case 'c':
severity = sevFromText(optarg);
break;
case 'h':
snprintf(
lastError,sizeof(lastError),
"Options: -s subsystem\n-l last(h,d)\n-f fromtime\n-t totime\n-i instrument\n-c severity\n%s",
"-e search-expression");
return 1;
break;
case '?':
if( optopt == 's' || optopt == 'l' || optopt == 'f' || optopt == 't'
|| optopt == 'i' || optopt == 'e' || optopt == 'c') {