diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-29 21:48:23 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-29 21:48:23 +0800 |
| commit | 596e5e2440df2d32f1cf3e052dc633e774edf6ee (patch) | |
| tree | dc98eb6a1789847b899207d0b99337bb3ccd92a5 | |
| parent | 25a164f74c011e6e78846f226cbd7a8bd87db92f (diff) | |
Rename mingling to mingling_core and update dependencies
| -rw-r--r-- | mingling/README.md | 70 | ||||
| -rw-r--r-- | mingling_core/Cargo.lock (renamed from mingling/Cargo.lock) | 2 | ||||
| -rw-r--r-- | mingling_core/Cargo.toml (renamed from mingling/Cargo.toml) | 8 | ||||
| -rw-r--r-- | mingling_core/LICENSE-APACHE (renamed from mingling/LICENSE-APACHE) | 0 | ||||
| -rw-r--r-- | mingling_core/LICENSE-MIT (renamed from mingling/LICENSE-MIT) | 0 | ||||
| -rw-r--r-- | mingling_core/src/any.rs (renamed from mingling/src/any.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/asset.rs (renamed from mingling/src/asset.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/asset/chain.rs (renamed from mingling/src/asset/chain.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/asset/chain/error.rs (renamed from mingling/src/asset/chain/error.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/asset/dispatcher.rs (renamed from mingling/src/asset/dispatcher.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/asset/node.rs (renamed from mingling/src/asset/node.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/asset/renderer.rs (renamed from mingling/src/asset/renderer.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/lib.rs (renamed from mingling/src/lib.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/program.rs (renamed from mingling/src/program.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/program/config.rs (renamed from mingling/src/program/config.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/program/exec.rs (renamed from mingling/src/program/exec.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/program/exec/error.rs (renamed from mingling/src/program/exec/error.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/program/flag.rs (renamed from mingling/src/program/flag.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/program/hint.rs (renamed from mingling/src/program/hint.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/program/setup.rs (renamed from mingling/src/program/setup.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/program/setup/basic.rs (renamed from mingling/src/program/setup/basic.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/renderer.rs (renamed from mingling/src/renderer.rs) | 0 | ||||
| -rw-r--r-- | mingling_core/src/renderer/render_result.rs (renamed from mingling/src/renderer/render_result.rs) | 0 | ||||
| -rw-r--r-- | mingling_macros/Cargo.toml | 4 |
24 files changed, 5 insertions, 79 deletions
diff --git a/mingling/README.md b/mingling/README.md deleted file mode 100644 index 506d5ce..0000000 --- a/mingling/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# Mìng Lìng - 命令 - -> [!WARNING] -> -> **Note**: Mingling is still under active development, and its API may change. Feel free to try it out and give us feedback! - -`Mingling` is a Rust command-line framework. Its name comes from the Chinese Pinyin for "命令", which means "Command". - -## Quick Start - -The example below shows how to use `Mingling` to create a simple command-line program: - -```rust -use mingling::{ - hint::NoDispatcherFound, - macros::{dispatcher, program, r_println, renderer}, -}; - -#[tokio::main] -async fn main() { - let mut program = MyProgram::new(); - program.with_dispatcher(HelloCommand); - program.exec().await; -} - -dispatcher!("hello", HelloCommand => HelloEntry); - -#[renderer] -pub fn render_hello(_prev: HelloEntry) { - r_println!("Hello, World!") -} - -#[renderer] -pub fn render_no_dispatcher_found(prev: NoDispatcherFound) { - r_println!("Subcommand not found: '{}'", prev.args.join(", ")) -} - -program!(MyProgram); -``` - -Output: - -``` -> mycmd hello -Hello, World! -> mycmd hallo -Subcommand not found: 'mycmd hallo' -``` - -## Core Concepts - -Mingling abstracts command execution into the following parts: - -1. **Dispatcher** - Routes user input to a specific renderer or chain based on the command node name. -2. **Chain** - Transforms the incoming type into another type, passing it to the next chain or renderer. -3. **Renderer** - Stops the chain and prints the currently processed type to the terminal. -4. **Program** - Manages the lifecycle and configuration of the entire CLI application. - -## Project Structure - -The Mingling project consists of two main parts: - -- **[mingling/](mingling/)** - The core runtime library, containing type definitions, error handling, and basic functionality. -- **[mingling_macros/](mingling_macros/)** - The procedural macro library, providing declarative macros to simplify development. - -## License - -This project is licensed under the MIT License. - -See [LICENSE-MIT](LICENSE-MIT) or [LICENSE-APACHE](LICENSE-APACHE) file for details. diff --git a/mingling/Cargo.lock b/mingling_core/Cargo.lock index cf6b520..001a08b 100644 --- a/mingling/Cargo.lock +++ b/mingling_core/Cargo.lock @@ -52,7 +52,7 @@ dependencies = [ ] [[package]] -name = "mingling" +name = "mingling_dispatcher" version = "0.1.0" dependencies = [ "just_fmt", diff --git a/mingling/Cargo.toml b/mingling_core/Cargo.toml index d7e820c..afeed3b 100644 --- a/mingling/Cargo.toml +++ b/mingling_core/Cargo.toml @@ -1,13 +1,9 @@ [package] -name = "mingling" +name = "mingling_core" version = "0.1.0" edition = "2024" -authors = ["Weicao-CatilGrass"] license = "MIT OR Apache-2.0" -readme = "README.md" -description = "A procedural command-line framework with subcommand support" -keywords = ["cli", "framework", "procedural", "subcommand", "command-line"] -categories = ["command-line-interface"] +description = "Core of the mingling library" repository = "https://github.com/catilgrass/mingling" [features] diff --git a/mingling/LICENSE-APACHE b/mingling_core/LICENSE-APACHE index 506aeb9..506aeb9 100644 --- a/mingling/LICENSE-APACHE +++ b/mingling_core/LICENSE-APACHE diff --git a/mingling/LICENSE-MIT b/mingling_core/LICENSE-MIT index ec48781..ec48781 100644 --- a/mingling/LICENSE-MIT +++ b/mingling_core/LICENSE-MIT diff --git a/mingling/src/any.rs b/mingling_core/src/any.rs index 1bce96a..1bce96a 100644 --- a/mingling/src/any.rs +++ b/mingling_core/src/any.rs diff --git a/mingling/src/asset.rs b/mingling_core/src/asset.rs index c2adf4e..c2adf4e 100644 --- a/mingling/src/asset.rs +++ b/mingling_core/src/asset.rs diff --git a/mingling/src/asset/chain.rs b/mingling_core/src/asset/chain.rs index 1ea1125..1ea1125 100644 --- a/mingling/src/asset/chain.rs +++ b/mingling_core/src/asset/chain.rs diff --git a/mingling/src/asset/chain/error.rs b/mingling_core/src/asset/chain/error.rs index d4da4ac..d4da4ac 100644 --- a/mingling/src/asset/chain/error.rs +++ b/mingling_core/src/asset/chain/error.rs diff --git a/mingling/src/asset/dispatcher.rs b/mingling_core/src/asset/dispatcher.rs index 13e35f7..13e35f7 100644 --- a/mingling/src/asset/dispatcher.rs +++ b/mingling_core/src/asset/dispatcher.rs diff --git a/mingling/src/asset/node.rs b/mingling_core/src/asset/node.rs index c8b7600..c8b7600 100644 --- a/mingling/src/asset/node.rs +++ b/mingling_core/src/asset/node.rs diff --git a/mingling/src/asset/renderer.rs b/mingling_core/src/asset/renderer.rs index 3852b55..3852b55 100644 --- a/mingling/src/asset/renderer.rs +++ b/mingling_core/src/asset/renderer.rs diff --git a/mingling/src/lib.rs b/mingling_core/src/lib.rs index 4d9bcc5..4d9bcc5 100644 --- a/mingling/src/lib.rs +++ b/mingling_core/src/lib.rs diff --git a/mingling/src/program.rs b/mingling_core/src/program.rs index 3d8bc14..3d8bc14 100644 --- a/mingling/src/program.rs +++ b/mingling_core/src/program.rs diff --git a/mingling/src/program/config.rs b/mingling_core/src/program/config.rs index 386b112..386b112 100644 --- a/mingling/src/program/config.rs +++ b/mingling_core/src/program/config.rs diff --git a/mingling/src/program/exec.rs b/mingling_core/src/program/exec.rs index 853bff1..853bff1 100644 --- a/mingling/src/program/exec.rs +++ b/mingling_core/src/program/exec.rs diff --git a/mingling/src/program/exec/error.rs b/mingling_core/src/program/exec/error.rs index fe66e22..fe66e22 100644 --- a/mingling/src/program/exec/error.rs +++ b/mingling_core/src/program/exec/error.rs diff --git a/mingling/src/program/flag.rs b/mingling_core/src/program/flag.rs index 3a678be..3a678be 100644 --- a/mingling/src/program/flag.rs +++ b/mingling_core/src/program/flag.rs diff --git a/mingling/src/program/hint.rs b/mingling_core/src/program/hint.rs index 6dbbac2..6dbbac2 100644 --- a/mingling/src/program/hint.rs +++ b/mingling_core/src/program/hint.rs diff --git a/mingling/src/program/setup.rs b/mingling_core/src/program/setup.rs index e81247e..e81247e 100644 --- a/mingling/src/program/setup.rs +++ b/mingling_core/src/program/setup.rs diff --git a/mingling/src/program/setup/basic.rs b/mingling_core/src/program/setup/basic.rs index 43c14b9..43c14b9 100644 --- a/mingling/src/program/setup/basic.rs +++ b/mingling_core/src/program/setup/basic.rs diff --git a/mingling/src/renderer.rs b/mingling_core/src/renderer.rs index 631092b..631092b 100644 --- a/mingling/src/renderer.rs +++ b/mingling_core/src/renderer.rs diff --git a/mingling/src/renderer/render_result.rs b/mingling_core/src/renderer/render_result.rs index 73c38e7..73c38e7 100644 --- a/mingling/src/renderer/render_result.rs +++ b/mingling_core/src/renderer/render_result.rs diff --git a/mingling_macros/Cargo.toml b/mingling_macros/Cargo.toml index b690505..1f4cb89 100644 --- a/mingling_macros/Cargo.toml +++ b/mingling_macros/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "mingling_macros" -version = "0.1.0" +version = "0.1.1" edition = "2024" license = "MIT OR Apache-2.0" repository = "https://github.com/catilgrass/mingling" -description = "Macros for the mingling library" +description = "Macros of the mingling library" [lib] proc-macro = true |
