mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-08 01:13:16 +00:00
Add -h flag to print help
This commit is contained in:
parent
0775344744
commit
350aea908b
15
iodine.c
15
iodine.c
|
@ -117,10 +117,16 @@ extern char *__progname;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage() {
|
usage() {
|
||||||
printf("Usage: %s [-u user] nameserver topdomain\n", __progname);
|
printf("Usage: %s [-f] [-u user] nameserver topdomain\n", __progname);
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
help() {
|
||||||
|
printf("Usage: %s [-f] [-u user] nameserver topdomain\n", __progname);
|
||||||
printf(" -f is to keep running in foreground\n");
|
printf(" -f is to keep running in foreground\n");
|
||||||
printf(" -u name to drop privileges and run as user 'name'\n");
|
printf(" -u name to drop privileges and run as user 'name'\n");
|
||||||
exit(2);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -141,11 +147,14 @@ main(int argc, char **argv)
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((choice = getopt(argc, argv, "fu:")) != -1) {
|
while ((choice = getopt(argc, argv, "fhu:")) != -1) {
|
||||||
switch(choice) {
|
switch(choice) {
|
||||||
case 'f':
|
case 'f':
|
||||||
foreground = 1;
|
foreground = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'h':
|
||||||
|
help();
|
||||||
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
username = optarg;
|
username = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
15
iodined.c
15
iodined.c
|
@ -117,11 +117,17 @@ extern char *__progname;
|
||||||
static void
|
static void
|
||||||
usage() {
|
usage() {
|
||||||
printf("Usage: %s [-f] [-u user] topdomain\n", __progname);
|
printf("Usage: %s [-f] [-u user] topdomain\n", __progname);
|
||||||
printf("-f is to keep running in foreground\n");
|
|
||||||
printf("-u name to drop privileges and run as user 'name'\n");
|
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
help() {
|
||||||
|
printf("Usage: %s [-f] [-u user] topdomain\n", __progname);
|
||||||
|
printf(" -f to keep running in foreground\n");
|
||||||
|
printf(" -u name to drop privileges and run as user 'name'\n");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -140,11 +146,14 @@ main(int argc, char **argv)
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((choice = getopt(argc, argv, "fu:")) != -1) {
|
while ((choice = getopt(argc, argv, "fhu:")) != -1) {
|
||||||
switch(choice) {
|
switch(choice) {
|
||||||
case 'f':
|
case 'f':
|
||||||
foreground = 1;
|
foreground = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'h':
|
||||||
|
help();
|
||||||
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
username = optarg;
|
username = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue