diff --git a/yazi-boot/src/args.rs b/yazi-boot/src/args.rs index 1732b92c..db6cc2a2 100644 --- a/yazi-boot/src/args.rs +++ b/yazi-boot/src/args.rs @@ -20,6 +20,9 @@ pub struct Args { #[arg(long)] pub clear_cache: bool, + /// Use the specified client ID, must be a globally unique number + #[arg(long)] + pub client_id: Option, /// Report the specified local events to stdout #[arg(long)] pub local_events: Option, @@ -34,8 +37,4 @@ pub struct Args { /// Print version #[arg(short = 'V', long)] pub version: bool, - - /// Set the YAZI_ID environment variable (integer) - #[arg(long)] - pub id: Option, } diff --git a/yazi-boot/src/boot.rs b/yazi-boot/src/boot.rs index 5016cfb1..9f412674 100644 --- a/yazi-boot/src/boot.rs +++ b/yazi-boot/src/boot.rs @@ -21,8 +21,6 @@ pub struct Boot { pub flavor_dir: PathBuf, pub plugin_dir: PathBuf, pub state_dir: PathBuf, - - pub yazi_id: Option, } impl Boot { @@ -186,7 +184,6 @@ impl Default for Boot { plugin_dir: config_dir.join("plugins"), config_dir, state_dir: Xdg::state_dir(), - yazi_id: ARGS.id.clone(), } } } diff --git a/yazi-dds/src/lib.rs b/yazi-dds/src/lib.rs index 90f4d022..6567fe19 100644 --- a/yazi-dds/src/lib.rs +++ b/yazi-dds/src/lib.rs @@ -17,7 +17,7 @@ pub use sendable::*; use server::*; pub use state::*; use stream::*; -use yazi_boot::BOOT; +use yazi_boot::ARGS; #[cfg(unix)] pub static USERS_CACHE: yazi_shared::RoCell = yazi_shared::RoCell::new(); @@ -26,7 +26,7 @@ pub fn init() { let (tx, rx) = tokio::sync::mpsc::unbounded_channel(); // Client - ID.init(BOOT.yazi_id.unwrap_or(yazi_shared::timestamp_us())); + ID.init(ARGS.client_id.unwrap_or(yazi_shared::timestamp_us())); PEERS.with(Default::default); QUEUE_TX.init(tx); QUEUE_RX.init(rx);