feat: configure download & upload (shared) directories
Add a --shared-dir / SOULSEEK_SHARED_DIR option and a SOULSEEK_DOWNLOAD_DIR env for the download directory. The shared directory is resolved and validated up front (tilde-expanded, must exist and be a directory); a misconfigured value is a warning, not a fatal error. The library gains an optional shared_directory on ClientSettings/Client with a getter, keeping soulseek-rs-lib dependency-free. Resolution lives in a new soulseek-rs/src/directories.rs with unit tests.
This commit is contained in:
+13
-1
@@ -43,9 +43,21 @@ pub struct Cli {
|
||||
#[command(subcommand)]
|
||||
pub command: Option<Commands>,
|
||||
|
||||
#[arg(short, long, default_value = "~/Downloads")]
|
||||
#[arg(
|
||||
short,
|
||||
long,
|
||||
env = "SOULSEEK_DOWNLOAD_DIR",
|
||||
default_value = "~/Downloads"
|
||||
)]
|
||||
pub download_dir: String,
|
||||
|
||||
#[arg(
|
||||
long,
|
||||
env = "SOULSEEK_SHARED_DIR",
|
||||
help = "Directory whose files are shared with (uploaded to) other peers"
|
||||
)]
|
||||
pub shared_dir: Option<String>,
|
||||
|
||||
#[arg(
|
||||
short = 'c',
|
||||
long,
|
||||
|
||||
Reference in New Issue
Block a user