aboutsummaryrefslogtreecommitdiff
path: root/mling/src/lib.rs
blob: d4ce69709076254f667e85dda7ecf98b4f758fc9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#![allow(unused_imports)]

use mingling::{
    macros::{gen_program, r_println, renderer},
    res::ResExitCode,
};

pub mod cli;

mod cargo_style;
pub use cargo_style::*;
pub mod display;
pub mod res;

mod proj_mgr;
use proj_mgr::*;

use crate::display::markdown;

#[renderer]
pub fn render_error_dispatch_not_found(err: ErrorDispatcherNotFound, ec: &mut ResExitCode) {
    if err.is_empty() {
        r_println!("{}", markdown(include_str!("helps/mling_help.txt")));
        ec.exit_code = 0;
    } else {
        let s = eformat_cargo!("Cannot find subcommand \"{}\"", err.join(" "));
        r_println!("{}", s);
        ec.exit_code = 1;
    }
}

gen_program!();