auraline 0.6.0

utility that renders information into a string suitable to be embedded in the shell prompt.
1
2
3
4
5
6
7
8
9
10
11
12
13
use smol_str::SmolStr;

use crate::{chunk::Chunk, cmd::CMD, options::Options};

pub async fn show(opts: &Options) -> Option<Chunk<SmolStr>> {
    if !opts.netns {
        return None;
    }
    CMD.exec("ip", ["netns", "identify"])
        .await
        .filter(|s| !s.is_empty())
        .map(|s| Chunk::new(opts.select_str("{}", ""), s))
}