From 6021ec89f56297772c617ae51b83def38302fb97 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Sat, 27 Dec 2025 10:04:38 +0100 Subject: [PATCH] feat: add default config path --- src/main.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e6dcf92..d3b18f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -57,7 +57,7 @@ std::pair mapKeyEventToRowColumn(int keyEventNumber, const std::unorde std::string getConfigPathFromCliArguments(int argc, char *argv[]) { - std::string configPath = "config.yaml"; + std::string configPath = ""; int opt; while ((opt = getopt(argc, argv, "c:")) != -1) { @@ -67,16 +67,12 @@ std::string getConfigPathFromCliArguments(int argc, char *argv[]) configPath = optarg; break; default: - std::cerr << "Usage: " << argv[0] << " [-c config_file_path]\n"; - exit(EXIT_FAILURE); + std::cout << "No config path provided. Using default config path: $HOME/.config/UsbMakroBoard.yaml\n"; + configPath = "$HOME/.config/UsbMakroBoard.yaml"; } } - return configPath; -} -YAML::Node loadConfig(const std::string &configPath) -{ - return YAML::LoadFile(configPath); + return configPath; } int openDevice(const std::string &devicePath)