Skip to content

Commit

Permalink
Fix help and command line arguments
Browse files Browse the repository at this point in the history
Fixes to the command line arguments and help messages in
ossec-remoted. This is related to the issues in ossec#207.
  • Loading branch information
awiddersheim committed Aug 25, 2014
1 parent fd79dd1 commit e75d7af
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/remoted/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,25 @@
#include "shared.h"
#include "remoted.h"

/* print help statement */
void help_local()
{
print_header();
print_out(" %s: -[Vhdtf] [-u user] [-g group] [-c config] [-D dir]", ARGV0);
print_out(" -V Version and license message");
print_out(" -h This help message");
print_out(" -d Execute in debug mode. This parameter");
print_out(" can be specified multiple times");
print_out(" to increase the debug level.");
print_out(" -t Test configuration");
print_out(" -f Run in foreground");
print_out(" -u <user> Run as 'user'");
print_out(" -g <group> Run as 'group'");
print_out(" -c <config> Read the 'config' file");
print_out(" -D <dir> Chroot to 'dir'");
print_out(" ");
exit(1);
}

int main(int argc, char **argv)
{
Expand All @@ -39,7 +58,7 @@ int main(int argc, char **argv)
print_version();
break;
case 'h':
help(ARGV0);
help_local();
break;
case 'd':
nowDebug();
Expand Down Expand Up @@ -71,6 +90,9 @@ int main(int argc, char **argv)
ErrorExit("%s: -D needs an argument",ARGV0);
dir = optarg;
break;
default:
help_local();
break;
}
}

Expand Down

0 comments on commit e75d7af

Please sign in to comment.