bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] [PATCH 2/7] argp'fied argument parsing & tiny fixes


From: Arash Yadegarnia
Subject: Re: [bug-inetutils] [PATCH 2/7] argp'fied argument parsing & tiny fixes
Date: Sat, 30 Aug 2008 00:06:37 +0430

On Sat, 2008-08-23 at 05:03 -0400, Alfred M. Szmidt wrote: 
> +static struct argp_option argp_options[] = {
>    +#define GRP 0
>    +  {"debug", 'D', "LEVEL", OPTION_ARG_OPTIONAL, "Set debugging level", 
> GRP+1},
>    +  {"authmode", 'a', "AUTHMODE", 0, "Specify what mode to use for "
>    +    "authentication", GRP+1},
>    +  {"exec-login", 'E', "STRING", 0, "Set program to be executed instead "
>    +    "of /bin/login", GRP+1},
>    +  {"no-hostinfo", 'h', NULL, 0, "Do not print host information before 
> login "
>    +    "has been completed", GRP+1},
>    +  {"linemode", 'l', "MODE", OPTION_ARG_OPTIONAL, "Set line mode", GRP+1},
>    +  {"no-keepalive", 'n', NULL, 0, "Disable TCP keep-alives", GRP+1},
>    +  {"reverse-lookup", 'U', NULL, 0, "Refuse  connections from addresses 
> that "
>    +    "cannot be mapped back into a symbolic name", GRP+1},
>    +#ifdef AUTHENTICATION
>    +  {"disable-auth-type", 'X', "AUTHTYPE", 0, "Disable the use of given "
>    +    "authentication option", GRP+1},
>    +#endif
> 
> This is a bad idea, the option should exist even if maybe it is not
> supported.  If it is not supported, then we should get a error message
> saying so.
> 
Fixed.

My first thought was printing a warning and continuing to run, but I
believe it doesn't make any sense to say that we won't do what you want,
but doing it our way!. Now it prints an error message in argp's way and
aborts.



        * telnetd/telnetd.c: Include <argp.h>.  Remove include for
<getopt.h>.
        (ARGP_PROGRAM_DATA): Call macro.
        (argp, args_doc, doc, argp_options): New variables.
        (parse_opt): New function.
        (telnetd_version, telnetd_license, telnetd_help): Functions
removed.
        (short_options, long_options): Variables removed.
        (parse_debug_level): Fixed message formatting.
        (main): Use argp to parse program
options.                          



Updated patch is attached.

Attachment: telnetd.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]