If --run-report="Reportname" matches multiple reports, offer a
disambiguation. Will show guid and display the options selected in the
saved report. Example:
"Multicolumn View" matches multiple reports. Select guid instead:
* guid: 2f17ecb535f24a3a9f314bc5855569e5
General / Number of columns: 2.0
General / Report name: A saved-report based on multicolumn-view
General / Stylesheet: Easy
* guid: d8ba4a2e89e8479ca9f6eccdeb164588
As gnucash and most gnucash-cli commands will work on an input file
it makes sense to use the common positional input-file parameter everywhere.
It's still optional for a normal gnucash run though. It will fall back to
to last-used file as before.
A --add-price-quotes run on the other hand will bail out with an error
message. As this command is typically run unattended in a cron script
it's safer to explicitly request a file to work on.
Right now it doesn't make a difference as the end of main
is currently never reached. However with some additional
tweaks it can be, and that would allow the application
destructor to be called for a nicer cleanup on exit.
Print help message if that happens.
The alternative would be to pass allow_unregistered() to the options description
while parsing. That however would only make sense if we had other code to parse
the options. We don't.
This means they will always exist in the value store after parsing and
are set to true or false. This eliminates the need to test for their
existence first.
Contrary to gtk_init, boost::program_options won't remove parsed options from
the argument list so there's no need to provide the option to update
the list.
* As the gtk command line options are only relevant for
gnucash and not gnucash-cli, remove the bit that adds
them from Gnucash::CoreApp.
* As the gtk command line options are parsed out by gtk_init_check
it's sufficient to run that before parsing our own command line
options to have gtk handle them for us.
* That just leaves us with the loss of a help message for the
gtk command line options. To handle that we derive a class
Gnucash::Gnucash from Gnucash::CoreApp which will generate an
option context for the gtk options purely to extract the help message.
This will then be used if the users pass option --help-gtk.
This is a bit clumsy to do with GOptionContext as it requires to store
a few gnucash only parameters in Gnucash::CoreApp. The plan is to
improve this in a future commit.
Note however we will still be stuck with the dummy option context generation
for the gtk option help message. There's just no other way to extract this
message otherwise.
KDevelop erroneously interprets [[ as the beginning of a C++17 attribute which
messes up all subsequent formatting. Changing this to '[ [' (with a space in between)
resolves the issue.
- Remove unneeded includes, required a few fixes in other header files
- Silence unused parameter warnings using c++17 attribute [[maybe_unused]]
- Remove some duplicate, unused functions from gnucash and gnucash-cli
They were a left over from a previous commit
This is just a first start, more refactoring will follow in later commits.
The idea is to have an application class that provides the basic framework
gnucash and gnucash-cli will become specializations of this class adding their
specific functionality. I'm splitting this over several commits to be able to
keep track of all the many changes.
This tool is intended to expose certain gnucash functions to a command line interface.
The first one is --add-price-quotes. This option currently also exists in gnucash.
It will be marked deprecated there. Future extensions to this can be things like
report generation, non-interactive imports,...
For release notes:
* new reports are now using different options and renderer
* options and layout are different
* Old reports still accessible via --extras