From d3b4027f5926569cb9371b2ea62b6be9387ea650 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 5 Jun 2026 21:08:07 +0800 Subject: Add example pages and sync-examples tool for docs --- index.html | 921 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 921 insertions(+) create mode 100644 index.html (limited to 'index.html') diff --git a/index.html b/index.html new file mode 100644 index 0000000..da42f99 --- /dev/null +++ b/index.html @@ -0,0 +1,921 @@ + + +
+ + +A proc-macro based Rust CLI framework
+ + ++ A proc-macro & type-system CLI framework for + building complex command-line programs with many + subcommands. +
+
+use mingling::prelude::*;
+
+dispatcher!("greet", CMDGreet => EntryGreet);
+
+fn main() {
+ let mut program = ThisProgram::new();
+ program.with_dispatcher(CMDGreet);
+ program.exec_and_exit();
+}
+
+pack!(ResultGreeting = String);
+
+#[chain]
+fn handle_greet(args: EntryGreet) -> Next {
+ let name =
+ args.pick_or((), "World").unpack();
+ ResultGreeting::new(name)
+}
+
+#[renderer]
+fn render_greeting(greeting: ResultGreeting) {
+ r_println!("Hello, {}!", *greeting);
+}
+
+gen_program!();
+
+ + Decouple parsing, business logic, rendering, help + text, and completion — each is just a function with + the right attribute macro. +
+
+ With the dispatch_tree feature, your
+ subcommand structure is hardened into a prefix tree
+ at compile time. O(len) lookup.
+
+ Enable comp and get smart,
+ context-aware shell completions for bash, zsh, fish,
+ and pwsh — no manual registration.
+
+ Minimal core dependencies. Pull in advanced features + (REPL, structured output, Clap binding) only when + you need them via feature flags. +
+
+ Add general_renderer and your program
+ gains --json /
+ --yaml flags automatically. Great for
+ scripting and pipe workflows.
+
+ Call program.exec_repl() and your CLI
+ becomes an interactive shell — perfect for debugging
+ and exploration.
+