Skip to content

Commit 84712ea

Browse files
committed
2 parents 3290bfc + 9108ea0 commit 84712ea

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
- Flamegraph: `cargo flamegraph`
1212
- Profile: `cargo run --features profiling -- [args]`
1313

14+
## Dependency versioning
15+
16+
Always use only `major.minor` unless there is a good reason to use the `patch` part.
17+
1418
## Demo and sample scripts
1519
- For the main thag_rs crate, example code should be implemented as scripts in the demo subdirectory.
1620
Run with `cargo run demo/script_name.rs`. Any valid Cargo.toml info can be placed in the normal format in a toml block at the top of the program, like this:

src/bin/thag_mintty_add_theme.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ use std::{
2121
};
2222

2323
#[cfg(target_os = "windows")]
24-
use thag_styling::{file_navigator, themed_inquire_config, Styleable};
25-
26-
use thag_styling::{auto_help, help_system::check_help_and_exit};
24+
use thag_styling::{
25+
auto_help, file_navigator, help_system::check_help_and_exit, themed_inquire_config, Styleable,
26+
};
2727

2828
#[cfg(target_os = "windows")]
2929
file_navigator! {}
3030

31+
#[cfg(target_os = "windows")]
3132
#[allow(clippy::too_many_lines)]
3233
fn main() -> Result<(), Box<dyn Error>> {
3334
// Check for help first - automatically extracts from source comments
@@ -470,6 +471,12 @@ fn show_usage_instructions() {
470471
println!(" Existing windows may need to be restarted to see the changes.");
471472
}
472473

474+
#[cfg(not(target_os = "windows"))]
475+
fn main() {
476+
eprintln!("This tool is only available on Windows.");
477+
std::process::exit(1);
478+
}
479+
473480
#[cfg(test)]
474481
mod tests {
475482
#[cfg(target_os = "windows")]

src/bin/thag_winterm_add_theme.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ thag_styling = { version = "0.2, thag-auto", features = ["inquire_theming"] }
1212
//# Categories: color, styling, terminal, theming, tools, windows
1313
#[cfg(target_os = "windows")]
1414
use inquire::set_global_render_config;
15+
1516
#[cfg(target_os = "windows")]
1617
use std::{
1718
error::Error,
@@ -20,13 +21,15 @@ use std::{
2021
};
2122

2223
#[cfg(target_os = "windows")]
23-
use thag_styling::{file_navigator, themed_inquire_config, Styleable, Theme};
24-
25-
use thag_styling::{auto_help, help_system::check_help_and_exit};
24+
use thag_styling::{
25+
auto_help, file_navigator, help_system::check_help_and_exit, themed_inquire_config, Styleable,
26+
Theme,
27+
};
2628

2729
#[cfg(target_os = "windows")]
2830
file_navigator! {}
2931

32+
#[cfg(target_os = "windows")]
3033
fn main() -> Result<(), Box<dyn Error>> {
3134
// Check for help first - automatically extracts from source comments
3235
let help = auto_help!();
@@ -678,6 +681,12 @@ fn show_usage_instructions(added_schemes: &[(String, String)]) {
678681
// })
679682
// }
680683

684+
#[cfg(not(target_os = "windows"))]
685+
fn main() {
686+
eprintln!("This tool is only available on Windows.");
687+
std::process::exit(1);
688+
}
689+
681690
#[cfg(test)]
682691
mod tests {
683692

0 commit comments

Comments
 (0)