From 0581950b216dfe0076cb42aa93a0075df4fb13ed Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sun, 25 Feb 2024 13:26:03 -0800 Subject: [PATCH] feat(cli): add whkdrc config path command This commit adds the "komorebic whkdrc" command to go along with the "komorebic configuration" command introduced in 608ec0304707aa420931aee71e14f11b4281a84c, aimed it making it easier to edit this file using a command line editor. The "config" command has been renamed in the code to Configuration, with an alias of "config". The Whkdrc command similarly comes with the "whkd" alias. --- komorebic/src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/komorebic/src/main.rs b/komorebic/src/main.rs index 93af72f0..9ab0737f 100644 --- a/komorebic/src/main.rs +++ b/komorebic/src/main.rs @@ -808,7 +808,11 @@ enum SubCommand { /// Check komorebi configuration and related files for common errors Check, /// Show the path to komorebi.json - Config, + #[clap(alias = "config")] + Configuration, + /// Show the path to whkdrc + #[clap(alias = "whkd")] + Whkdrc, /// Show a JSON representation of the current window manager state State, /// Show a JSON representation of visible windows @@ -1416,14 +1420,20 @@ fn main() -> Result<()> { println!("If running 'komorebic start --await-configuration', you will manually have to call the following command to begin tiling: komorebic complete-configuration\n"); } } - SubCommand::Config => { + SubCommand::Configuration => { let static_config = HOME_DIR.join("komorebi.json"); if static_config.exists() { println!("{}", static_config.display()); } } + SubCommand::Whkdrc => { + let whkdrc = WHKD_CONFIG_DIR.join("whkdrc"); + if whkdrc.exists() { + println!("{}", whkdrc.display()); + } + } SubCommand::AhkLibrary => { let library = HOME_DIR.join("komorebic.lib.ahk"); let mut file = OpenOptions::new()