diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-07 02:56:48 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-07 02:56:48 +0800 |
| commit | 21defab2fc95f1e1d0639b66ab2c449266a114fe (patch) | |
| tree | 587cc0ca98cfc461366375abe62b143ec1ec36b2 /mling/src/lib.rs | |
| parent | 91e847bf873ff2e404554ea7bb97fad7beac0530 (diff) | |
Rename cargo style functions and remove unused imports
Diffstat (limited to 'mling/src/lib.rs')
| -rw-r--r-- | mling/src/lib.rs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/mling/src/lib.rs b/mling/src/lib.rs index 2ea6305..0f58ccc 100644 --- a/mling/src/lib.rs +++ b/mling/src/lib.rs @@ -1,12 +1,30 @@ #![allow(unused_imports)] -use mingling::macros::gen_program; +use mingling::{ + macros::{gen_program, r_println, renderer}, + res::ResExitCode, +}; -pub mod cargo_style; +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.len() < 1 { + 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!(); |
