wekan-cli 2.1.0

Agent-first, human-friendly command-line client for Wekan
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::command_result::SkillListSuccess;

pub(super) fn list(data: &SkillListSuccess) -> String {
    let width = data
        .topics
        .iter()
        .map(|topic| topic.name.len())
        .max()
        .unwrap_or(5)
        .max(5);
    let mut lines = vec![format!("{:<width$}  DESCRIPTION", "TOPIC")];
    lines.extend(
        data.topics
            .iter()
            .map(|topic| format!("{:<width$}  {}", topic.name, topic.description)),
    );
    lines.join("\n")
}