diff --git a/man/epubgrep.1.adoc b/man/epubgrep.1.adoc index 2ca3fd3..fbb0668 100644 --- a/man/epubgrep.1.adoc +++ b/man/epubgrep.1.adoc @@ -2,7 +2,7 @@ :doctype: manpage :Author: tastytea :Email: tastytea@tastytea.de -:Date: 2021-05-30 +:Date: 2021-05-31 :Revision: 0.0.0 :man source: epubgrep :man manual: General Commands Manual @@ -130,8 +130,8 @@ regexp = [Oo]regano == FILES *Configuration file*:: -* If `XDG_CONFIG_HOME` is defined: `${XDG_CONFIG_HOME}/epubgrep.conf` -* If `HOME` is defined: `${HOME}/.config/epubgrep.conf` +* If `XDG_CONFIG_HOME` is defined: `${XDG_CONFIG_HOME}/epubgrep/epubgrep.conf` +* If `HOME` is defined: `${HOME}/.config/epubgrep/epubgrep.conf` * Otherwise: `epubgrep.conf` diff --git a/src/options.cpp b/src/options.cpp index 652107e..d8cda45 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -161,7 +161,16 @@ fs::path get_config_path() } if (!path.empty()) { - return path /= "epubgrep.conf"; + const auto old_path{path / "epubgrep.conf"}; + auto new_path{path / "epubgrep" / "epubgrep.conf"}; + + if (fs::exists(old_path)) + { + fs::create_directory(path /= "epubgrep"); + fs::rename(old_path, new_path); + } + + return new_path; } return "epubgrep.conf";