From 89f0fe6992b452bbf9427ba3f892d2431dfef9f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonathan=20Neusch=C3=A4fer?= Date: Wed, 4 Jan 2012 20:36:05 +0100 Subject: [PATCH] show the path of the config files in --version output fixes http://musicpd.org/mantis/view.php?id=3354 --- NEWS | 1 + doc/ncmpc.1 | 2 +- src/options.c | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f435e1c..e55bae9 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ ncmpc 0.20 - not yet released * screen_lyrics: You can now edit lyrics by pressing 'e' * configurable timeout for MPD connections * screen_keydef: show command descriptions +* show the paths of the configuration files in --version output ncmpc 0.19 - (07/23/2011) diff --git a/doc/ncmpc.1 b/doc/ncmpc.1 index 2716798..f72c99c 100644 --- a/doc/ncmpc.1 +++ b/doc/ncmpc.1 @@ -59,7 +59,7 @@ Read key bindings from FILE. .TP Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. .SH "CONFIGURATION" -When ncmpc starts it tries to read the user's configuration file, ~/.ncmpc/config. If no user configuration file is found then ncmpc tries to load the global settings from $SYSCONFDIR/ncmpc/config (the actual path is displayed on the help screen). An example configuration file (config.sample) should be provided with ncmpc. +When ncmpc starts it tries to read the user's configuration file, ~/.ncmpc/config. If no user configuration file is found then ncmpc tries to load the global settings from $SYSCONFDIR/ncmpc/config (the actual path is displayed in the output of the --version option). An example configuration file (config.sample) should be provided with ncmpc. diff --git a/src/options.c b/src/options.c index 35de128..c331fa5 100644 --- a/src/options.c +++ b/src/options.c @@ -218,6 +218,16 @@ handle_option(int c, const char *arg) "\n"); #ifndef NCMPC_MINI + { + char *user_conf = build_user_conf_filename(); + char *system_conf = build_system_conf_filename(); + + printf("configuration files:\n %s\n %s\n\n", + user_conf, system_conf); + + g_free(user_conf); + g_free(system_conf); + } if (strcmp("translator-credits", _("translator-credits")) != 0) /* To translators: these credits are shown when ncmpc is started with "--version" */ -- 2.30.2