aboutsummaryrefslogtreecommitdiff
path: root/mingling
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-11 19:56:10 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-11 19:56:10 +0800
commite42567b25093907cfd939edc92ace94a5d59b398 (patch)
treef2514fdd18277b5620b0fd6512cfc95569cfce15 /mingling
parent99d5a62aa3655f8676021a9bf70af3d12c9457bc (diff)
Add `builds` feature and install completion scripts
Diffstat (limited to 'mingling')
-rw-r--r--mingling/Cargo.lock59
-rw-r--r--mingling/Cargo.toml3
-rw-r--r--mingling/src/example_docs.rs16
3 files changed, 74 insertions, 4 deletions
diff --git a/mingling/Cargo.lock b/mingling/Cargo.lock
index 879973d..56c591c 100644
--- a/mingling/Cargo.lock
+++ b/mingling/Cargo.lock
@@ -89,6 +89,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
[[package]]
+name = "dirs"
+version = "6.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"
+dependencies = [
+ "dirs-sys",
+]
+
+[[package]]
+name = "dirs-sys"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
+dependencies = [
+ "libc",
+ "option-ext",
+ "redox_users",
+ "windows-sys",
+]
+
+[[package]]
name = "env_filter"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -128,6 +149,17 @@ dependencies = [
]
[[package]]
+name = "getrandom"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi",
+]
+
+[[package]]
name = "hashbrown"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -201,6 +233,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
[[package]]
+name = "libredox"
+version = "0.1.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c"
+dependencies = [
+ "libc",
+]
+
+[[package]]
name = "lock_api"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -237,6 +278,7 @@ dependencies = [
name = "mingling_core"
version = "0.1.8"
dependencies = [
+ "dirs",
"env_logger",
"just_fmt",
"just_template",
@@ -285,6 +327,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
[[package]]
+name = "option-ext"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
+
+[[package]]
name = "parking_lot"
version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -356,6 +404,17 @@ dependencies = [
]
[[package]]
+name = "redox_users"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
+dependencies = [
+ "getrandom",
+ "libredox",
+ "thiserror",
+]
+
+[[package]]
name = "regex"
version = "1.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/mingling/Cargo.toml b/mingling/Cargo.toml
index dd93a5e..ebe3620 100644
--- a/mingling/Cargo.toml
+++ b/mingling/Cargo.toml
@@ -16,12 +16,13 @@ tokio = { version = "1", features = ["full"] }
mingling = { path = ".", features = ["comp", "general_renderer", "parser"] }
[package.metadata.docs.rs]
-features = ["general_renderer", "repl", "comp", "parser"]
+features = ["builds", "general_renderer", "repl", "comp", "parser"]
[features]
nightly = ["mingling_core/nightly", "mingling_macros/nightly"]
debug = ["mingling_core/debug"]
async = ["mingling_core/async", "mingling_macros/async"]
+builds = ["mingling_core/builds"]
default = ["mingling_core/default", "mingling_macros/default"]
diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs
index 9f1b46b..0a6c1b9 100644
--- a/mingling/src/example_docs.rs
+++ b/mingling/src/example_docs.rs
@@ -133,13 +133,23 @@ pub mod example_basic {}
/// # How to Deploy
/// 1. Enable the `comp` feature
/// ```toml
+/// [dependencies]
/// mingling = { version = "...", features = [
/// "comp", // Enable this feature
/// "parser"
/// ] }
/// ```
///
-/// 2. Write `build.rs` to generate completion scripts at compile time
+/// 2. Add `mingling` as a build dependency, enabling the `builds` and `comp` features
+/// ```toml
+/// [build-dependencies]
+/// mingling = { version = "...", features = [
+/// "builds", // Enable this feature for build scripts
+/// "comp"
+/// ] }
+/// ```
+///
+/// 3. Write `build.rs` to generate completion scripts at compile time
/// ```ignore
/// use mingling::build::{build_comp_scripts, build_comp_scripts_with_bin_name};
/// fn main() {
@@ -151,8 +161,8 @@ pub mod example_basic {}
/// }
/// ```
///
-/// 3. Write `main.rs`, adding completion logic for your command entry point
-/// 4. Execute `cargo install --path ./`, then run the corresponding completion script in your shell
+/// 4. Write `main.rs`, adding completion logic for your command entry point
+/// 5. Execute `cargo install --path ./`, then run the corresponding completion script in your shell
///
/// Cargo.toml
/// ```ignore