sdoc 0.8.11

Framework for building custom CLIs around shell, scripts, and executables
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use workflow::{Work, Instruction};
use workflow::Instruction::Display;
use config::Context;
use dto::{Request, Response};

pub fn execute_auto_complete(context: &Context) -> Work {
    Work::instruction(Display(build_auto_complete(context), Response::Ok))
}

pub fn build_auto_complete(context: &Context) -> String {
    context.get_commands().iter().fold(s!(), |a, b| format!("{}{}\n", a, &b.name))
}

pub fn no_auto_complete(_: Request, _: &Context) -> Work {
    Work::instruction(Instruction::ExitCode(Response::Ok))
}