[Question][CMDLINE_PARSER_PACKAGE]

View: New views
5 Messages — Rating Filter:   Alert me  

[Question][CMDLINE_PARSER_PACKAGE]

by Salvatore Santagati :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I see from my cmdline.h (generated with GNU gengetopt 2.22.1)

#ifndef CMDLINE_PARSER_PACKAGE
/** @brief the program name */
#define CMDLINE_PARSER_PACKAGE PACKAGE
#endif

Why don't use PACKAGE_NAME ? in according with config.h PACKAGE_NAME
define to the full name of this package.

if you use this on configure.ac AC_INIT(PACKAGE_NAME, VERSION,
BUG_REPORT, PACKAGE) is possible have two names
one short name (PACKAGE) and one long name (PACKAGE_NAME).


I think is good idea added support for full name (PACKAGE_NAME)
because don't exist much program with one word, example gengetopt full
name is Gnu gengetopt.

Cheers
Salvatore


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [Question][CMDLINE_PARSER_PACKAGE]

by Lorenzo Bettini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Salvatore Santagati wrote:
> Hi,
>

Ciao Salvatore :-)

> I see from my cmdline.h (generated with GNU gengetopt 2.22.1)
>
> #ifndef CMDLINE_PARSER_PACKAGE
> /** @brief the program name */
> #define CMDLINE_PARSER_PACKAGE PACKAGE
> #endif
>
> Why don't use PACKAGE_NAME ? in according with config.h PACKAGE_NAME
> define to the full name of this package.
>
> if you use this on configure.ac AC_INIT(PACKAGE_NAME, VERSION,
> BUG_REPORT, PACKAGE) is possible have two names
> one short name (PACKAGE) and one long name (PACKAGE_NAME).
>
>
> I think is good idea added support for full name (PACKAGE_NAME)
> because don't exist much program with one word, example gengetopt full
> name is Gnu gengetopt.

well, that PACKAGE variable is used from within the command line parser
to print errors, and thus it should be set to the actual command, and
not to the package name.  However, I think you're right about
PACKAGE_NAME being useful, for instance when printing the output of
--help and --version, am I right?

Then probably PACKAGE_NAME should be used to and probably default to
PACKAGE if not specified, am I right?

cheers
        Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

[Question][CMDLINE_PARSER_PACKAGE]

by Salvatore Santagati :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I see from my cmdline.h (generated with GNU gengetopt 2.22.1)

#ifndef CMDLINE_PARSER_PACKAGE
/** @brief the program name */
#define CMDLINE_PARSER_PACKAGE PACKAGE
#endif

Why don't use PACKAGE_NAME ? in according with config.h PACKAGE_NAME
define to the full name of this package.

if you use this on configure.ac AC_INIT(PACKAGE_NAME, VERSION,
BUG_REPORT, PACKAGE) is possible have two names
one short name (PACKAGE) and one long name (PACKAGE_NAME).


I think is good idea added support for full name (PACKAGE_NAME)
because don't exist much program with one word, example gengetopt full
name is Gnu gengetopt.

Cheers
Salvatore


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [Question][CMDLINE_PARSER_PACKAGE]

by Salvatore Santagati :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ciao Lorenzo

> well, that PACKAGE variable is used from within the command line parser to
> print errors, and thus it should be set to the actual command, and not to
> the package name.  However, I think you're right about PACKAGE_NAME being
> useful, for instance when printing the output of --help and --version, am I
> right?

Yes, you are right.

> Then probably PACKAGE_NAME should be used to and probably default to PACKAGE
> if not specified, am I right?

Yes,
http://www.gnu.org/software/hello/manual/autoconf/Initializing-configure.html


Cheers
Salvatore

PS : sorry for double post


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [Question][CMDLINE_PARSER_PACKAGE]

by Lorenzo Bettini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Salvatore Santagati wrote:

> Ciao Lorenzo
>
>> well, that PACKAGE variable is used from within the command line parser to
>> print errors, and thus it should be set to the actual command, and not to
>> the package name.  However, I think you're right about PACKAGE_NAME being
>> useful, for instance when printing the output of --help and --version, am I
>> right?
>
> Yes, you are right.
>
>> Then probably PACKAGE_NAME should be used to and probably default to PACKAGE
>> if not specified, am I right?
>
> Yes,
> http://www.gnu.org/software/hello/manual/autoconf/Initializing-configure.html
>
>
> Cheers
> Salvatore
>
> PS : sorry for double post

Hi

you can find the candidate release, with this feature here:

http://rap.dsi.unifi.it/~bettini/gengetopt-2.22.2.tar.gz

any feedback is more than welcome :-)

now the generated header looks like this

#ifndef CMDLINE_PARSER_PACKAGE
/** @brief the program name (used for printing errors) */
#define CMDLINE_PARSER_PACKAGE PACKAGE
#endif

#ifndef CMDLINE_PARSER_PACKAGE_NAME
/** @brief the complete program name (used for help and version) */
#ifdef PACKAGE_NAME
#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME
#else
#define CMDLINE_PARSER_PACKAGE_NAME PACKAGE
#endif
#endif

and CMDLINE_PARSER_PACKAGE_NAME is used (if not empty) to print --help
and --version, while CMDLINE_PARSER_PACKAGE is used for printing errors.

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt