Repository: sxyazi/yazi
File: yazi-boot/src/boot.rs (Rust)

Code before:

		writeln!(s, "\n\n--------------------------------------------------")?;
		writeln!(
			s,
			"When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time."
		)?;
		writeln!(s, "You can find it in the {:?} directory.", Xdg::state_dir())?;

		Ok(s)
	}

	fn action_clear_cache() {
		if PREVIEW.cache_dir == Xdg::cache_dir() {
			println!("Clearing cache directory: \n{:?}", PREVIEW.cache_dir);
			std::fs::remove_dir_all(&PREVIEW.cache_dir).unwrap();
		} else {
			println!(
				"You've changed the default cache directory, for your data's safety, please clear it manually: \n{:?}",
				PREVIEW.cache_dir
			);
		}
	}

	/// Allows for initialization without forcing the reading of command line
	/// arguments.
	pub fn init_with(local_events: HashSet<String>, remote_events: HashSet<String>) -> Boot {
		let config_dir = Xdg::config_dir();

		let (cwd, file) = Self::parse_entry(None);

		Self {
			cwd,
			file,

			local_events,
			remote_events,

			flavor_dir: config_dir.join("flavors"),
			plugin_dir: config_dir.join("plugins"),
			config_dir,
			state_dir: Xdg::state_dir(),
		}
	}
}

impl Default for Boot {
	fn default() -> Self {
		let config_dir = Xdg::config_dir();
		let (cwd, file) = Self::parse_entry(ARGS.entry.as_deref());

		let local_events = ARGS

Review comment (suggestion):
This initialization process is unnecessary because reading `local_events` and `remote_events` is only necessary when sending messages, which only occurs in the `yazi` program, and `ya` cli doesn't need them.

Code after:
			"    default: {:?}",
			yazi_config::OPEN.openers("f75a.txt", "text/plain").and_then(|a| a.first().cloned())
		)?;
		writeln!(s, "    block  : {:?}", yazi_config::OPEN.block_opener("bulk.txt", "text/plain"))?;

		writeln!(s, "\ntmux")?;
		writeln!(s, "    TMUX   : {:?}", *yazi_adapter::TMUX)?;
		writeln!(s, "    Version: {}", Self::process_output("tmux", "-V"))?;

		writeln!(s, "\nDependencies")?;
		writeln!(
			s,
			"    file             : {}",
			Self::process_output(env::var_os("YAZI_FILE_ONE").unwrap_or("file".into()), "--version")
		)?;
		writeln!(s, "    ueberzugpp       : {}", Self::process_output("ueberzugpp", "--version"))?;
		writeln!(s, "    ffmpegthumbnailer: {}", Self::process_output("ffmpegthumbnailer", "-v"))?;
		writeln!(s, "    magick           : {}", Self::process_output("magick", "--version"))?;
		writeln!(s, "    fzf              : {}", Self::process_output("fzf", "--version"))?;
		writeln!(s, "    fd               : {}", Self::process_output("fd", "--version"))?;
		writeln!(s, "    rg               : {}", Self::process_output("rg", "--version"))?;
		writeln!(s, "    chafa            : {}", Self::process_output("chafa", "--version"))?;
		writeln!(s, "    zoxide           : {}", Self::process_output("zoxide", "--version"))?;
		writeln!(s, "    unar             : {}", Self::process_output("unar", "--version"))?;
		writeln!(s, "    jq               : {}", Self::process_output("jq", "--version"))?;

		writeln!(s, "\n\n--------------------------------------------------")?;
		writeln!(
			s,
			"When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time."
		)?;
		writeln!(s, "You can find it in the {:?} directory.", Xdg::state_dir())?;

		Ok(s)
	}

	fn action_clear_cache() {
		if PREVIEW.cache_dir == Xdg::cache_dir() {
			println!("Clearing cache directory: \n{:?}", PREVIEW.cache_dir);
			std::fs::remove_dir_all(&PREVIEW.cache_dir).unwrap();
		} else {
			println!(
				"You've changed the default cache directory, for your data's safety, please clear it manually: \n{:?}",
				PREVIEW.cache_dir
			);
		}
	}
}

impl Default for Boot {
	fn default() -> Self {