First version of a gnucash-cli man page

This commit is contained in:
Geert Janssens 2020-06-05 20:13:34 +02:00
parent cee52d4f91
commit 769196fec6
4 changed files with 124 additions and 14 deletions

View File

@ -6,7 +6,7 @@ set(doc_DATA
set(doc_noinst_DATA
CMakeLists.txt gnc-fq-dump.1 gnc-fq-helper.1 gnucash.1.in
tip_of_the_day.list.c README.txt)
gnucash-cli.1.in tip_of_the_day.list.c README.txt)
install(FILES ${doc_DATA} DESTINATION ${CMAKE_INSTALL_DOCDIR})
@ -41,16 +41,18 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tip_of_the_day.list DESTINATION ${CMA
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tip_of_the_day.list
DESTINATION ${DATADIR_BUILD}/gnucash)
add_custom_command(OUTPUT gnucash.1
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gnucash.1.in ${VCS_INFO_FILE}
COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/gnucash.1.in
-D DST=gnucash.1
-D VCS_INFO_FILE=${VCS_INFO_FILE}
-D DATADIR_BUILD=${DATADIR_BUILD}
-D SRC_DIR=${CMAKE_SOURCE_DIR}
-P ${CMAKE_SOURCE_DIR}/cmake/configure-manpage.cmake
)
add_custom_target(gnucash-manpage DEPENDS gnucash.1)
dist_add_generated (${BUILDING_FROM_VCS} gnucash.1)
foreach (manpage gnucash gnucash-cli)
add_custom_command(OUTPUT ${manpage}.1
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1.in ${VCS_INFO_FILE}
COMMAND ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1.in
-D DST=${manpage}.1
-D VCS_INFO_FILE=${VCS_INFO_FILE}
-D DATADIR_BUILD=${DATADIR_BUILD}
-D SRC_DIR=${CMAKE_SOURCE_DIR}
-P ${CMAKE_SOURCE_DIR}/cmake/configure-manpage.cmake
)
add_custom_target(${manpage}-manpage DEPENDS ${manpage}.1)
dist_add_generated (${BUILDING_FROM_VCS} ${manpage}.1)
endforeach()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gnucash.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)

103
doc/gnucash-cli.1.in Normal file
View File

@ -0,0 +1,103 @@
.\" Written by Robert Merkel (rgmerk@mira.net)
.\" Process this file with
.\" groff -man -Tascii foo.1
.\"
.TH GNUCASH 1 "@GNC_VCS_REV_DATE@" "Version @GNC_VCS_REV@" "GnuCash Manual Pages"
.SH NAME
gnucash-cli \- command line tool to go with GnuCash
.SH SYNOPSIS
.B gnucash-cli [options] [
.I accounts.gnc
.B ]
.SH DESCRIPTION
.B gnucash-cli
enables certain intraction with a gnucash datafile directly from
the command line.
It has two modes:
.B quotes
mode and
.B report
mode.
.SH Quotes Mode (activated with --quotes <cmd>)
This mode has options to get online quotes for foreign currencies and stocks
in the given data file. It supports the following command:
.IP get
Retrieves online quotes. Note this requires Finance::Quote to be properly
configured for your system.
The
.B get
command takes the following options:
.IP --namespace=REGEXP
Regular expression determining which namespace commodities will be retrieved.
.SH Report Mode (activated with --report <cmd>)
This mode has options to work with reports in the given data file.
It supports the following command:
.IP run
Runs a report on the given data file.
The
.B run
command takes the following options:
.IP --name=REPORT_NAME
Name of the report to run
.IP --export-type=TYPE
Specify export type
.SH General Options
.IP --version
Show
.B GnuCash
version
.IP --help
Show this help message
.IP --debug
Enable debugging mode: increasing logging to provide deep detail.
.IP --extra
Enable extra/development/debugging features.
.IP --log
Log level overrides, of the form "log.ger.path={debug,info,warn,crit,error}"
This option can be specified multiple times.
.IP --logto
File to log into; defaults to "/tmp/gnucash.trace"; can be "stderr" or "stdout".
.SH FILES
.I ~/.gnucash/config.auto
.RS
Automatically generated per-user configuration file. DO NOT EDIT
MANUALLY!
.SH ENVIRONMENT
.IP GNC_DEBUG
Enable debugging output. This allows you to turn on the debugging
earlier in the startup process than you can with
.B --debug.
.IP GUILE_LOAD_PATH
An override for the
.B GnuCash
scheme load path. You shouldn't need to alter this. For more
information see the README file.
.IP GNC_MODULE_PATH
An override for the
.B GnuCash
scheme load path for
.B Gnucash
modules. You shouldn't need to alter this. For more
information see the README file.
.SH BUGS
.B Please report any bugs using the bug reporting form on the
.B GnuCash
web site.
.SH "SEE ALSO"
.B GnuCash
has extensive on-line help available from the "help" menu.
Additional information and the latest version is available
at the web site:
.B https://www.gnucash.org
.SH AUTHOR
Robert Merkel <rgmerk@mira.net> wrote this manpage.
.B GnuCash
was written by Robin Clark, Linas Vepstas, and a cast of thousands.

View File

@ -31,14 +31,19 @@ Enable debugging mode: increasing logging to provide deep detail.
Enable extra/development/debugging features.
.IP --log
Log level overrides, of the form "log.ger.path={debug,info,warn,crit,error}"
This option can be specified multiple times.
.IP --logto
File to log into; defaults to "/tmp/gnucash.trace"; can be "stderr" or "stdout".
.IP --nofile
Do not load the last file opened
.IP "--add-price-quotes FILE"
Add price quotes to the given data file
Add price quotes to the given data file. Note this option has been deprecated
and will be removed in GnuCash 5.0. Instead use 'gnucash-cli --quotes get'.
.IP --namespace=REGEXP
Regular expression determining which namespace commodities will be retrieved.
This is only relevant for the --add-price-quotes option. And as with that option
it is deprecated and will be removed in GnuCash 5.0. The same option can be
passed to 'gnucash-cli --quotes get' to achieve the same result.
.SH FILES
.I ~/.gnucash/config.auto
.RS

View File

@ -53,7 +53,7 @@ add_executable (gnucash
${gnucash_noinst_HEADERS}
)
add_dependencies (gnucash gnucash-manpage)
add_dependencies (gnucash gnucash-manpage gnucash-cli-manpage)
target_compile_definitions(gnucash PRIVATE -DG_LOG_DOMAIN=\"gnc.bin\")