From 1e9c97c21f8a4e55420712b054895ff8b4f9a849 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 19 Jun 2026 01:40:38 +0800 Subject: feat(rola-bucket): add bucket bind management Implement bucket bind CRUD operations and config loading, along with CLI integration for listing, setting, and removing bucket bindings. --- rola-cli/src/lib.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'rola-cli/src/lib.rs') diff --git a/rola-cli/src/lib.rs b/rola-cli/src/lib.rs index b3587e2..b472169 100644 --- a/rola-cli/src/lib.rs +++ b/rola-cli/src/lib.rs @@ -1,6 +1,9 @@ use std::process::exit; -use mingling::macros::{gen_program, help}; +use mingling::{ + macros::{gen_program, help, r_println, renderer}, + res::ResExitCode, +}; pub mod output; pub mod res; @@ -14,8 +17,10 @@ use error::*; use crate::output::display::markdown; +pub const EC_COMMAND_NOT_FOUND: i32 = 1000; + #[help] -fn handle_error_dispatch_not_found(_err: ErrorDispatcherNotFound) { +fn help_global(_err: ErrorDispatcherNotFound) { let help = locale::helps::Basic::help().trim(); // Print directly to stderr and exit with code 0 @@ -23,6 +28,18 @@ fn handle_error_dispatch_not_found(_err: ErrorDispatcherNotFound) { exit(0) } +#[renderer] +fn render_error_dispatch_not_found(err: ErrorDispatcherNotFound, ec: &mut ResExitCode) { + if !err.inner.is_empty() { + let cmd_str = err.inner.join(" "); + r_println!( + "{}", + markdown(locale::errors::Common::command_not_found(cmd_str).trim()) + ); + ec.exit_code = EC_COMMAND_NOT_FOUND; + } +} + gen_program!(); pub mod locale { -- cgit