[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] Argpifying ifconfig.
From: |
Alfred M. Szmidt |
Subject: |
Re: [bug-inetutils] Argpifying ifconfig. |
Date: |
Thu, 5 Apr 2007 18:51:18 +0200 (CEST) |
> As far as I understand, the traditional ifconfig invocation was
> being handled by this snippet of code after the while loop
> involving getopt
OK, here is the fixed patch, than. Notice `#define program_name
program_invocation_short_name' in ifconfig.h and removal of the
program_name global. The initialization of
program_invocation_short_name is done by argp automatically, so
there's no use assigning it explicitely.
Why not just use program_invocation_short_name instead of "redefining"
(in the sense that program_name already has a meaning in programs)?
--- options.c 21 Oct 2006 15:24:20 -0000 1.11
+++ options.c 4 Apr 2007 18:37:46 -0000
@@ -164,7 +204,8 @@ usage (int err)
{
if (err != EXIT_SUCCESS)
{
- fprintf (stderr, "Usage: %s [OPTION]...%s\n", program_name,
+ fprintf (stderr, "Usage: %s [OPTION]...%s\n",
+ program_name,
system_help ? " [SYSTEM OPTION]..." : "");
fprintf (stderr, "Try `%s --help' for more information.\n",
program_name);
This (and other such places) should use argp_error().
Also, it might be a good idea to skip the `system_help ? " [SYSTEM
OPTION]..." : ""'; it is a optional argument, so it doesn't hurt
mentioning even if there are no system options.
- [bug-inetutils] Argpifying ifconfig., Debarshi 'Rishi' Ray, 2007/04/02
- Re: [bug-inetutils] Argpifying ifconfig., Alfred M. Szmidt, 2007/04/02
- Re: [bug-inetutils] Argpifying ifconfig., Sergey Poznyakoff, 2007/04/03
- Re: [bug-inetutils] Argpifying ifconfig., Debarshi 'Rishi' Ray, 2007/04/04
- Re: [bug-inetutils] Argpifying ifconfig., Sergey Poznyakoff, 2007/04/04
- Re: [bug-inetutils] Argpifying ifconfig.,
Alfred M. Szmidt <=
- Re: [bug-inetutils] Argpifying ifconfig., Sergey Poznyakoff, 2007/04/05
- Re: [bug-inetutils] Argpifying ifconfig., Alfred M. Szmidt, 2007/04/05
- Re: [bug-inetutils] Argpifying ifconfig., Debarshi 'Rishi' Ray, 2007/04/05
- Re: [bug-inetutils] Argpifying ifconfig., Alfred M. Szmidt, 2007/04/05
- Re: [bug-inetutils] Argpifying ifconfig., Debarshi 'Rishi' Ray, 2007/04/05
- Re: [bug-inetutils] Argpifying ifconfig., Debarshi 'Rishi' Ray, 2007/04/05
- Re: [bug-inetutils] Argpifying ifconfig., Alfred M. Szmidt, 2007/04/07
- Re: [bug-inetutils] Argpifying ifconfig., Sergey Poznyakoff, 2007/04/08
- Re: [bug-inetutils] Argpifying ifconfig., Debarshi 'Rishi' Ray, 2007/04/08
- Re: [bug-inetutils] Argpifying ifconfig., Sergey Poznyakoff, 2007/04/10