osp-cli 1.5.1

CLI and REPL for querying and managing OSP infrastructure data
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::ui::visible_inline_text;

pub(super) fn indent_lines(text: &str, margin: usize) -> String {
    let prefix = " ".repeat(margin);
    text.lines()
        .map(|line| format!("{prefix}{line}"))
        .collect::<Vec<_>>()
        .join("\n")
}

pub(super) fn format_list_item(item: &str, inline_markup: bool) -> String {
    if inline_markup {
        visible_inline_text(item)
    } else {
        item.to_string()
    }
}