Skip to main content

tuwunel_admin/debug/
list_dependencies.rs

1use tuwunel_core::{
2	Result,
3	info::cargo::{dependencies, dependencies_names},
4	itertools::Itertools,
5};
6
7use crate::admin_command;
8
9#[admin_command]
10pub(super) async fn list_dependencies(&self, names: bool) -> Result {
11	if names {
12		let out = dependencies_names().join(" ");
13
14		return self.write_str(&out).await;
15	}
16
17	writeln!(self, "| name | version | features |").await?;
18	writeln!(self, "| ---- | ------- | -------- |").await?;
19	for (name, version, features) in dependencies() {
20		let features = features.iter().format(" ");
21
22		writeln!(self, "| {name} | {version} | {features} |").await?;
23	}
24
25	Ok(())
26}