Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli/terminal: add formatting for Network
Fintan Halpenny committed 2 months ago
commit bc101f8ec0ec949df75569c7bc8d41bafc78c0dd
parent 5d51552b8c58e02f4bc5e4770b64bfb8be087a10
1 file changed +7 -0
modified crates/radicle-cli/src/terminal/format.rs
@@ -7,6 +7,7 @@ pub use radicle_term::{style, Paint};

use radicle::cob::ObjectId;
use radicle::identity::Visibility;
+
use radicle::node::config::Network;
use radicle::node::policy::Policy;
use radicle::node::{Address, Alias, AliasStore, HostName, NodeId};
use radicle::prelude::Did;
@@ -105,6 +106,12 @@ pub fn policy(p: &Policy) -> Paint<String> {
    }
}

+
/// Format a network name.
+
#[must_use]
+
pub fn network(n: &Network) -> Paint<String> {
+
    bold(term::format::secondary(n).to_string())
+
}
+

/// Format a timestamp.
pub fn timestamp(time: impl Into<LocalTime>) -> Paint<String> {
    let time = time.into();