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 @@ + + + + + + Mìng Lìng — Macro magician in your CLI + + + + + + + + + + + + +
+
+ + +

#[Mìng Lìng]

+

+ +

A proc-macro based Rust CLI framework

+ + +
+ +
+ scroll +
+
+
+ + +
+
+
+

+ Dispatch, Parse
+ Then Render +

+

+ A proc-macro & type-system CLI framework for + building complex command-line programs with many + subcommands. +

+
    +
  • + Separation of concerns: parsing, logic, rendering +
  • +
  • + Compile-time prefix-tree routing + (optional) +
  • +
  • + Dynamic shell completion out of the box + (optional) +
  • +
+
+ +
+

+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!();
+                    
+
+
+
+ + +
+
+

+ Mìng Lìng — Build Complex CLIs, For You! +

+ +
+
+ 🧩 +

Separation of Concerns

+

+ Decouple parsing, business logic, rendering, help + text, and completion — each is just a function with + the right attribute macro. +

+
+ +
+ +

Blazing Dispatch

+

+ With the dispatch_tree feature, your + subcommand structure is hardened into a prefix tree + at compile time. O(len) lookup. +

+
+ +
+ 🔄 +

Dynamic Completion

+

+ Enable comp and get smart, + context-aware shell completions for bash, zsh, fish, + and pwsh — no manual registration. +

+
+ +
+ 📦 +

Lightweight & Modular

+

+ Minimal core dependencies. Pull in advanced features + (REPL, structured output, Clap binding) only when + you need them via feature flags. +

+
+ +
+ 📤 +

Structured Output

+

+ Add general_renderer and your program + gains --json / + --yaml flags automatically. Great for + scripting and pipe workflows. +

+
+ +
+ 🔁 +

REPL Mode

+

+ Call program.exec_repl() and your CLI + becomes an interactive shell — perfect for debugging + and exploration. +

+
+
+
+
+ + +
+

Ready to command your CLI?

+

+ Add Mingling to your project in one line, or dive straight into + the docs. +

+ cargo add mingling +
+ + 📖 Read The Docs + + + GitHub → + +
+
+ + + + + + + + + + + + + -- cgit