Possibility to specify alternative config file

Introduce `profanity -c` to specify an alternative config file.
This commit is contained in:
Michael Vetter
2019-08-02 15:28:28 +02:00
parent 5d711639b0
commit 10ca3e8c31
7 changed files with 22 additions and 11 deletions

View File

@@ -79,10 +79,15 @@ static gboolean _get_default_boolean(preference_t pref);
static char* _get_default_string(preference_t pref);
void
prefs_load(void)
prefs_load(char *config_file)
{
GError *err;
prefs_loc = files_get_config_path(FILE_PROFRC);
if (config_file == NULL) {
prefs_loc = files_get_config_path(FILE_PROFRC);
} else {
prefs_loc = config_file;
}
if (g_file_test(prefs_loc, G_FILE_TEST_EXISTS)) {
g_chmod(prefs_loc, S_IRUSR | S_IWUSR);

View File

@@ -166,7 +166,7 @@ typedef struct prof_winplacement_t {
int inputwin_pos;
} ProfWinPlacement;
void prefs_load(void);
void prefs_load(char *config_file);
void prefs_save(void);
void prefs_close(void);