Can't update preferences and can't get rid of Welcome dialog in Gnucash 2.4.7 (OS X 2.6.8)

John Ralls jralls at ceridwen.us
Mon Aug 8 22:49:54 EDT 2011


On Aug 8, 2011, at 3:45 PM, prl wrote:

> On 9/08/11 4:48, John Ralls wrote:
>> It seems that both "$*" and "$@" work, at least on Snow Leopard. I think, though, that "$@" is a bit safer, so I'll put that into the next release. Thanks.
>> 
>> Regards,
>> John Ralls
>> 
> 
> Hi, John. In this context, "$@" is IMO the correct subtitution (and not just "a bit safer").
> 
> "$*" expands as "$1 $2 $3 $4 ..."
> "$@" expands as "$1" "$2" "$3" "$4" ...
> 
> So, for example, if you ran:
> /Applications/.../Gnucash --extra --logto="/path/that has/spaces"
> 
> The --debug comes from $EXTRA_ARGS.
> 
> If you use "$@" then the final effect of the script would be:
>    exec /Applications/.../Gnucash-bin --debug "--extra" "--logto=/path/that has/spaces"
> which is correct.
> 
> However, if you use "$*", then the final effect is:
>    exec /Applications/.../Gnucash-bin --debug "--extra --logto=/path/that has/spaces"
> which is really not what you want.
> 
> I think that what you've tested may not adequately test the difference between "$*" and "$@". They have the same effect if at the time that they are expanded, there is only one command-line argument. They only behave differently if, when they are expanded, there are two or more command line arguments, as in the example I've given above.

No arguments, but it sure looks to me that g_option_context_parse can figure it out, which is why I say "safer". But you're right, I didn't test it rigorously enough to be sure. If it does break, it will be with "--logto=/path/that has/spaces --extra", so g_option can't assume that everything after the "=" belongs to logto.

Anyway, no sense in arguing about it, it went in as "$@".

Regards,
John Ralls


More information about the gnucash-user mailing list