gnunet-developers
[Top][All Lists]
Advanced

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

Re: [GNUnet-developers] GNUNET_PROGRAM* option evaluation does not work


From: Schanzenbach, Martin
Subject: Re: [GNUnet-developers] GNUNET_PROGRAM* option evaluation does not work as expected
Date: Wed, 13 Mar 2019 21:03:52 +0100

I don't like changing somebody else's lines just for intendation because it 
messes with git blame.
So I think it is better to hold people to the coding style.

BR

> On 13. Mar 2019, at 20:01, address@hidden wrote:
> 
> Schanzenbach, Martin transcribed 4.9K bytes:
>> In the end, please also check https://docs.gnunet.org/#Coding-style and 
>> adjust your editor to it.
>> Currently, the file has mixed spaces and tabs which is quite unreadable (for 
>> me).
>> Now, I know this is a problem in other files as well (looking at you 
>> gnunet-ecc.c), but better not copy the bad style ;)
>> 
>> BR
> 
> I think it should be rather easy to write an awk script to handle
> corrections there depending on the kind of files etc. In general,
> nothing I will do now.
> 
>>> On 13. Mar 2019, at 19:11, Schanzenbach, Martin <address@hidden> wrote:
>>> 
>>> Signed PGP part
>>> Hi!
>>> 
>>>> On 13. Mar 2019, at 18:25, Hartmut Goebel <address@hidden> wrote:
>>>> 
>>>> Hi Martin,
>>>> 
>>>> Am 03.03.19 um 11:33 schrieb Schanzenbach, Martin:
>>>>> The first thing you should do it use GNUNET_PROGRAM*.
>>>> I followed this advice, adding options --verbose, -s/--silent and 
>>>> -d/--device. Here is the resulting help output, which look s good::
>>>> 
>>>> src/util/gnunet-qr --help
>>>> gnunet-qr
>>>> Scan a QR code using a video device and import the uri read
>>>> Arguments mandatory for long options are also mandatory for short options.
>>>>     --verbose              be verbose
>>>> -c, --config=FILENAME      use configuration file FILENAME
>>>> -d, --device=DEVICE        use video-device DEVICE (default: /dev/video0
>>>> -h, --help                 print this help
>>>> -L, --log=LOGLEVEL         configure logging to use LOGLEVEL
>>>> -l, --logfile=FILENAME     configure logging to write logs to FILENAME
>>>> -s, --silent               do not show preview windows
>>>> -v, --version              print the version number
>>>> Report bugs to address@hidden
>>>> GNUnet home page: http://www.gnu.org/s/gnunet/
>>>> General help using GNU software: http://www.gnu.org/gethelp/
>>>> 
>>>> 
>>>> But the resulting program does not work as expected:
>>>> 
>>>>    • gnunet-qr -c src/my/test_my.conf
>>>> -> invalid option -- c
>>> 
>>> You forgot to call:
>>> GNUNET_STRINGS_get_utf8_args (argc, argv,
>>>                                   &argc, &argv)
>>> without it the parsing will not actually happen ;).
>>> 
>>> FYI some flags are reserved and handled by GNUnet.
>>> This includes "verbose", "config" etc. You can see what is reserved when 
>>> you add no arguments and call --help.
>>> See gnunet-ecc.c how it's done.
>>> 
>>>> Curiously gnunet-ecc accepts this option.
>>>>    • gnunet-qr --config ./src/my/test_my.conf
>>>> fails with "`stat' failed on file `/opt/gnunet/share/gnunet/config.d' 
>>>> [...]error: Datei oder Verzeichnis nicht gefunden"
>>>> Why does the program try to access this directory when I passed an 
>>>> config-file?
>>>> 
>>>> "/opt/gnunet" is the prefix I configured, thus the directory name makes 
>>>> sense.  gnunet-ecc has the same issue.
>>>> 
>>> 
>>> GNUnet always tries to load the system/user config file first. The config 
>>> file you pass is used to override the default settings from that.
>>> So if you did not actually install gnunet or don't have GNUNET_PREFIX 
>>> setup, this might be the issue.
>>> 
>>> BR
>>> 
>>>> I just pushed the code to branch gnunet-qt-c-2 (force-pushing to the prior 
>>>> branch was denied)
>>>> 
>>>> --
>>>> Regards
>>>> Hartmut Goebel
>>>> 
>>>> | Hartmut Goebel          |
>>>> address@hidden
>>>>              |
>>>> |
>>>> www.crazy-compilers.com
>>>> | compilers which you thought are impossible |
>>>> 
>>> 
>>> 
>>> 
>> 
> 
> 
> 
>> _______________________________________________
>> GNUnet-developers mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/gnunet-developers

Attachment: signature.asc
Description: Message signed with OpenPGP


reply via email to

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