MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / format_gateway_select_items

Function format_gateway_select_items

crates/openshell-cli/src/run.rs:645–660  ·  view source on GitHub ↗
(gateways: &[GatewayMetadata])

Source from the content-addressed store, hash-verified

643}
644
645fn format_gateway_select_items(gateways: &[GatewayMetadata]) -> Vec<String> {
646 let (name_width, endpoint_width, type_width) = gateway_select_column_widths(gateways);
647
648 gateways
649 .iter()
650 .map(|gateway| {
651 format!(
652 "{:<name_width$} {:<endpoint_width$} {:<type_width$} {}",
653 gateway.name,
654 gateway.gateway_endpoint,
655 gateway_type_label(gateway),
656 gateway_auth_label(gateway),
657 )
658 })
659 .collect()
660}
661
662fn gateway_select_column_widths(gateways: &[GatewayMetadata]) -> (usize, usize, usize) {
663 let name_width = gateways

Callers 2

gateway_selectFunction · 0.85

Calls 1