[GNC] Command Line Args

Peter West pbw at pbw.id.au
Thu Apr 22 20:17:39 EDT 2021


I’m on a Mac, and command line access is not available by default.

If I 
$ export PATH="$PATH:/Applications/Gnucash.app/Contents/MacOS”
then
$ Gnucash --help
Application Path /Applications/Gnucash.app/Contents/MacOS/Gnucash

(process:12007): gnc.gui-WARNING **: 10:10:34.704: [mac_set_languages()] Language list: en:en_AU:C:el_AU
Gnucash [options] [datafile] - GnuCash, accounting for personal and small business finance:

Common Options:
  -h [ --help ]           Show this help message
  -v [ --version ]        Show GnuCash version
  --debug                 Enable debugging mode: provide deep detail in the
                          logs.
                          This is equivalent to: --log "=info" --log "qof=info"
                          --log "gnc=info"
  --extra                 Enable extra/development/debugging features.
  --log arg               Log level overrides, of the form
                          "modulename={debug,info,warn,crit,error}"
                          Examples: "--log qof=debug" or "--log
                          gnc.backend.file.sx=info"
                          This can be invoked multiple times.
  --logto arg             File to log into; defaults to "/tmp/gnucash.trace";
                          can be "stderr" or "stdout".
  --gsettings-prefix arg  Set the prefix for gsettings schemas for gsettings
                          queries. This can be useful to have a different
                          settings tree while debugging.

Application Options:
  --nofile                Do not load the last file opened
  --help-gtk              Show help for gtk options

Deprecated Options:
  --add-price-quotes      Add price quotes to given GnuCash datafile.
                          Note this option has been deprecated and will be
                          removed in GnuCash 5.0.
                          Please use 'gnucash-cli --quotes get <datafile>'
                          instead.
  --namespace arg         Regular expression determining which namespace
                          commodities will be retrieved.
                          Note this option has been deprecated and will be
                          removed in GnuCash 5.0.
                          Please use 'gnucash-cli --quotes get --namespace
                          <namespace> <datafile>' instead.


If I then
$ gnucash-cli --help
Application Path /Applications/Gnucash.app/Contents/MacOS/gnucash-cli

(process:12805): gnc.gui-WARNING **: 10:11:17.131: [mac_set_languages()] Language list: en:en_AU:C:el_AU
gnucash-cli [options] [datafile] - GnuCash, accounting for personal and small business finance:

Common Options:
  -h [ --help ]           Show this help message
  -v [ --version ]        Show GnuCash version
  --debug                 Enable debugging mode: provide deep detail in the
                          logs.
                          This is equivalent to: --log "=info" --log "qof=info"
                          --log "gnc=info"
  --extra                 Enable extra/development/debugging features.
  --log arg               Log level overrides, of the form
                          "modulename={debug,info,warn,crit,error}"
                          Examples: "--log qof=debug" or "--log
                          gnc.backend.file.sx=info"
                          This can be invoked multiple times.
  --logto arg             File to log into; defaults to "/tmp/gnucash.trace";
                          can be "stderr" or "stdout".
  --gsettings-prefix arg  Set the prefix for gsettings schemas for gsettings
                          queries. This can be useful to have a different
                          settings tree while debugging.

Price Quotes Retrieval Options:
  -Q [ --quotes ] arg     Execute price quote related commands. Currently only
                          one command is supported.

                            get: Fetch current quotes for all foreign
                                 currencies and stocks in the given GnuCash
                                 datafile.

  --namespace arg         Regular expression determining which namespace
                          commodities will be retrieved for

Report Generation Options:
  -R [ --report ] arg     Execute report related commands. The following
                          commands are supported.

                            list: Lists available reports.
                            show: Describe the options modified in the named
                                  report. A datafile may be specified to
                                  describe some saved options.
                            run: Run the named report in the given GnuCash
                                 datafile.

  --name arg              Name of the report to run

  --export-type arg       Specify export type

  --output-file arg       Output file for report


Note: my SSD is formatted as case-sensitive, hence I must use ‘Gnucash’ rather than ‘gnucash’.


Peter


—
Peter West
pbw at ehealth.id.au
“I am the living bread that came down from heaven.”

> On 23 Apr 2021, at 9:41 am, John Ralls <jralls at ceridwen.us> wrote:
> 
> Glenn,
> 
> I know, and that's what Derek posted and what I added to the wiki page.
> 
> Regards,
> John Ralls
> 
>> On Apr 22, 2021, at 4:35 PM, Glenn Fowler <gfowler1 at outlook.com> wrote:
>> 
>>  Hi John, I was referring to gnucash command line switches, not gnucash-cli command line switches as you mentioned earlier starting GnuCash with --extra earlier in the post.  
>> 
>> On Thu, Apr 22, 2021 at 6:42 PM John Ralls <jralls at ceridwen.us> wrote:
>> I've just added the current output of `gnucash --help` to https://wiki.gnucash.org/wiki/Logging#Command_Line_Options. It's the same as Derek posted.
>> 
>> Regards,
>> John Ralls
>> 
>> 
>>> On Apr 22, 2021, at 3:25 PM, Glenn Fowler <gfowler1 at outlook.com> wrote:
>>> 
>>> Thank you, in that case is there documentation on the command line switches?
>>> 
>>> On Thu, Apr 22, 2021 at 6:06 PM John Ralls <jralls at ceridwen.us> wrote:
>>> 
>>> 
>>>> On Apr 22, 2021, at 2:30 PM, Derek Atkins <derek at ihtfp.com> wrote:
>>>> 
>>>> That is very VERY odd.  It works for me.  I wonder if this is a Windows bug?
>>> 
>>> Not odd at all, and not a bug in the sense that Microsoft did it on purpose [1]. Windows executables have a couple of bytes in their preambles that say what type they are. Console apps have stdin, stdout, and stderr and so they require a shell window of some sort (CMD and Powershell being the most common) and will open one for you if you launch them from Windows File Explorer. The others redirect the basic FDs to NULL and so they don't need a shell window. gnucash is a Windows program (no basic FDs) and gnucash-cli is a Console program (has basic FDs).
>>> 
>>> Regards,
>>> John Ralls
>>> 
>>> [1] https://answers.microsoft.com/en-us/ie/forum/ie11-iewindows_10/what-is-difference-between-console-application/f8bd3d4f-7c2c-4c86-a64b-41a046a38be4
>> 
> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.



More information about the gnucash-user mailing list