mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[gnucash-core-app] "--paths" returns gnc_list_all_paths()
This commit is contained in:
parent
1a263040ab
commit
f5f303714c
@ -249,6 +249,22 @@ Gnucash::CoreApp::parse_command_line (int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_show_paths)
|
||||||
|
{
|
||||||
|
auto paths { gnc_list_all_paths ()};
|
||||||
|
std::cout << _("GnuCash Paths") << '\n';
|
||||||
|
for (auto n = paths; n; n = n->next)
|
||||||
|
{
|
||||||
|
auto it = static_cast<EnvPaths*>(n->data);
|
||||||
|
std::cout << it->env_name << ": " << it->env_path;
|
||||||
|
if (it->modifiable)
|
||||||
|
std::cout << ' ' << _("(user modifiable)");
|
||||||
|
std::cout << '\n';
|
||||||
|
}
|
||||||
|
g_list_free_full (paths, g_free);
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_show_version)
|
if (m_show_version)
|
||||||
{
|
{
|
||||||
bl::format rel_fmt (bl::translate ("GnuCash {1}"));
|
bl::format rel_fmt (bl::translate ("GnuCash {1}"));
|
||||||
@ -289,6 +305,8 @@ Gnucash::CoreApp::add_common_program_options (void)
|
|||||||
_("Enable extra/development/debugging features."))
|
_("Enable extra/development/debugging features."))
|
||||||
("log", bpo::value (&m_log_flags),
|
("log", bpo::value (&m_log_flags),
|
||||||
_("Log level overrides, of the form \"modulename={debug,info,warn,crit,error}\"\nExamples: \"--log qof=debug\" or \"--log gnc.backend.file.sx=info\"\nThis can be invoked multiple times."))
|
_("Log level overrides, of the form \"modulename={debug,info,warn,crit,error}\"\nExamples: \"--log qof=debug\" or \"--log gnc.backend.file.sx=info\"\nThis can be invoked multiple times."))
|
||||||
|
("paths", bpo::bool_switch(&m_show_paths),
|
||||||
|
_("Show paths"))
|
||||||
("logto", bpo::value (&m_log_to_filename),
|
("logto", bpo::value (&m_log_to_filename),
|
||||||
_("File to log into; defaults to \"/tmp/gnucash.trace\"; can be \"stderr\" or \"stdout\"."));
|
_("File to log into; defaults to \"/tmp/gnucash.trace\"; can be \"stderr\" or \"stdout\"."));
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ private:
|
|||||||
/* Command-line option variables */
|
/* Command-line option variables */
|
||||||
bool m_show_help = false;
|
bool m_show_help = false;
|
||||||
bool m_show_version = false;
|
bool m_show_version = false;
|
||||||
|
bool m_show_paths = false;
|
||||||
bool m_debug = false;
|
bool m_debug = false;
|
||||||
bool m_extra = false;
|
bool m_extra = false;
|
||||||
boost::optional <std::string> m_gsettings_prefix;
|
boost::optional <std::string> m_gsettings_prefix;
|
||||||
|
Loading…
Reference in New Issue
Block a user