Skip to content

Commit

Permalink
Enable -D, and document it in -h
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Apr 7, 2014
1 parent 31a4c40 commit 681c45a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/radmin.c
Expand Up @@ -106,6 +106,7 @@ static void NEVER_RETURNS usage(int status)
FILE *output = status ? stderr : stdout;
fprintf(output, "Usage: %s [ args ]\n", progname);
fprintf(output, " -d raddb_dir Configuration files are in \"raddbdir/*\".\n");
fprintf(stderr, " -D <dictdir> Set main dictionary directory (defaults to " DICTDIR ").\n");
fprintf(output, " -e command Execute 'command' and then exit.\n");
fprintf(output, " -E Echo commands as they are being executed.\n");
fprintf(output, " -f socket_file Open socket_file directly, without reading radius.conf\n");
Expand Down Expand Up @@ -391,7 +392,7 @@ int main(int argc, char **argv)
progname++;
}

while ((argval = getopt(argc, argv, "d:hi:e:Ef:n:o:qs:S")) != EOF) {
while ((argval = getopt(argc, argv, "d:D:hi:e:Ef:n:o:qs:S")) != EOF) {
switch(argval) {
case 'd':
if (file) {
Expand Down Expand Up @@ -558,6 +559,12 @@ int main(int argc, char **argv)
}
}

if (!file && !server) {
fprintf(stderr, "%s: Must use one of '-d' or '-f' or '-s'\n",
progname);
exit(1);
}

/*
* Check if stdin is a TTY only if input is from stdin
*/
Expand Down

0 comments on commit 681c45a

Please sign in to comment.