breaking: reserve a data directory for the application

This commit is contained in:
J / Jacob Babich
2024-09-30 02:16:47 -04:00
parent 69fc7865db
commit 44fcea467a
3 changed files with 139 additions and 0 deletions

View File

@@ -15,3 +15,5 @@ cli-clap = ["dep:ac-qu-ai-nt-cli-clap"]
[dependencies]
ac-qu-ai-nt-cli-clap = { version = "0.0.2", path = "../cli-clap", optional = true }
clap = { workspace = true, features = ["derive", "env"] }
dirs-next = "2.0.0"

View File

@@ -1,4 +1,20 @@
use std::path::PathBuf;
use clap::Parser;
#[derive(Debug, Parser)]
struct Args {
#[arg(
long,
env,
default_value_os_t = dirs_next::data_local_dir().expect("sorry but you're on a platform where dirs_next::data_local_dir() returned None, so please specify a data directory for the application").join("ac-qu-ai-nt")
)]
application_data_directory: PathBuf,
}
fn main() {
let args = Args::parse();
#[cfg(feature = "cli-clap")]
ac_qu_ai_nt_cli_clap::main();
}