On 8/6/19 5:00 PM, Alessio Vanni wrote:
> Christian Grothoff <[email protected]> writes:
> 
>> Have a look at the attached os_installation.c from GNU Taler. It shows
>> you how to initialize libgnunetutil to customize the --help output (at
>> least some of it).  It also demonstrates how we could easily enable
>> further customizations in the future, if necessary.
>>
>> For the version number, you need to call
>>
>> GNUNET_GETOPT_option_version("1.0")
>>
>> in your option list, to get --version to show '1.0'.
> 
> After reading the attached code I think I understand how it works.  I
> also think it should be added to gnunet-ext too, because as it is it's
> not obvious (and leads to my proposed patch...)

Makes sense, again, patches improving gnunet-ext to make it more
understandable are particularly welcome ;-).

> On the matter of the version string, I don't see why I have to redefine
> it when it's a default option.  Maybe add the version string to the
> ProjectData structure and have the getopt helper use it instead of
> hardcoding `PACKAGE_VERSION " " VCS_REVISION'?  After all, the version
> is still an information about the project.

You're talking about using this for GNUNET_PROGRAM_run and/or
GNUNET_SERVICE_run? That sounds reasonable. With this, we could simply
put the default for PACKAGE_VERSION " " VCS_REVISION into the default
ProjectData and then allow applications to override this more easily
that way. That's completely in line with how ProjectData was expected to
be used. Do you want to propose a patch? ;-)

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
GNUnet-developers mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnunet-developers

Reply via email to