After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 637414 - Command Line parsing problem
Command Line parsing problem
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: MacOS
2.3.x
Other Mac OS
: Normal normal
: ---
Assigned To: John Ralls
Depends on:
Blocks:
 
 
Reported: 2010-12-16 18:50 UTC by David
Modified: 2018-06-29 22:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David 2010-12-16 18:50:21 UTC
In bug 629712, it was found that using the command line to update commodity prices will fail if the file name includes white space. Thus, 

/Applications/Gnucash.app/Contents/MacOS/Gnucash --add-price-quotes /path/to/my/data/file/My Accounts

will fail, although

/Applications/Gnucash.app/Contents/MacOS/Gnucash --add-price-quotes /path/to/my/data/file/MyAccounts

will work.
Comment 1 Daniel Macks 2010-12-19 05:04:53 UTC
What about:

/Applications/Gnucash.app/Contents/MacOS/Gnucash --add-price-quotes
/path/to/my/data/file/My\ Accounts

or

/Applications/Gnucash.app/Contents/MacOS/Gnucash --add-price-quotes
"/path/to/my/data/file/My Accounts"

The whitespace issue is a fundamental aspect of the command-line parser in the shell/terminal itself (it's already broken apart into separate "words" well before Gnucash even starts up).
Comment 2 John Ralls 2010-12-19 05:38:26 UTC
Well, yes and no. It certainly doesn't help that the string is passed to the shell twice, once on the command line and once by the launcher script. It should be possible to concoct some combination of quoting and escaping that gets the right string presented to the parser in Gnucash (which is GOptionContext).

So far neither David nor I have succeeded in doing so.

It does work fine with Linux, where there's only one layer of shell.
Comment 3 David 2010-12-19 06:41:46 UTC
Daniel--neither of those methods works here. I tried (I noted this on bug 629712)
Comment 4 John Ralls 2013-09-09 22:23:52 UTC
It seems the trick is to use single quotes:
/Applications/Gnucash.app/Contents/MacOS/Gnucash --add-price-quotes '/path/to/my/data/file/My Accounts'

Works for me with 2.5.4.
Comment 5 John Ralls 2018-06-29 22:49:31 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=637414. Please update any external references or bookmarks.