Skip to content

Commit

Permalink
feat(cli): add detailed version info w/ shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Jul 5, 2024
1 parent 60bc96e commit 2a67c9c
Show file tree
Hide file tree
Showing 8 changed files with 256 additions and 116 deletions.
352 changes: 238 additions & 114 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ uds_windows = "1"
win32-display-data = { git = "https://github.com/LGUG2Z/win32-display-data", rev = "2a0f7166da154880a1750b91829b1186d9c6a00c" }
windows-implement = { version = "0.53" }
windows-interface = { version = "0.53" }
shadow-rs = "0.29"

[workspace.dependencies.windows]
version = "0.54"
Expand Down
4 changes: 4 additions & 0 deletions komorebi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ windows-implement = { workspace = true }
windows-interface = { workspace = true }
winput = "0.2"
winreg = "0.52"
shadow-rs = { workspace = true }

[build-dependencies]
shadow-rs = { workspace = true }

[features]
deadlock_detection = ["parking_lot/deadlock_detection"]
3 changes: 3 additions & 0 deletions komorebi/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
shadow_rs::new().unwrap();
}
4 changes: 3 additions & 1 deletion komorebi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ use komorebi::HOME_DIR;
use komorebi::INITIAL_CONFIGURATION_LOADED;
use komorebi::SESSION_ID;

shadow_rs::shadow!(build);

fn setup() -> Result<(WorkerGuard, WorkerGuard)> {
if std::env::var("RUST_LIB_BACKTRACE").is_err() {
std::env::set_var("RUST_LIB_BACKTRACE", "1");
Expand Down Expand Up @@ -132,7 +134,7 @@ fn detect_deadlocks() {
}

#[derive(Parser)]
#[clap(author, about, version)]
#[clap(author, about, version = build::CLAP_LONG_VERSION)]
struct Opts {
/// Allow the use of komorebi's custom focus-follows-mouse implementation
#[clap(short, long = "ffm")]
Expand Down
2 changes: 2 additions & 0 deletions komorebic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ uds_windows = "1"
which = "6"
win32-display-data = { workspace = true }
windows = { workspace = true }
shadow-rs = { workspace = true }

[build-dependencies]
reqwest = { version = "0.12", features = ["blocking"] }
shadow-rs = { workspace = true }
2 changes: 2 additions & 0 deletions komorebic/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ fn main() {
).unwrap().text().unwrap();
std::fs::write("applications.yaml", applications_yaml).unwrap();
}

shadow_rs::new().unwrap();
}
4 changes: 3 additions & 1 deletion komorebic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ lazy_static! {
};
}

shadow_rs::shadow!(build);

#[derive(thiserror::Error, Debug, miette::Diagnostic)]
#[error("{message}")]
#[diagnostic(code(komorebi::configuration), help("try fixing this syntax error"))]
Expand Down Expand Up @@ -815,7 +817,7 @@ struct EnableAutostart {
}

#[derive(Parser)]
#[clap(author, about, version)]
#[clap(author, about, version = build::CLAP_LONG_VERSION)]
struct Opts {
#[clap(subcommand)]
subcmd: SubCommand,
Expand Down

0 comments on commit 2a67c9c

Please sign in to comment.