aboutsummaryrefslogtreecommitdiff
path: root/mingling
diff options
context:
space:
mode:
Diffstat (limited to 'mingling')
-rw-r--r--mingling/Cargo.toml6
-rw-r--r--mingling/src/example_docs.rs12
-rw-r--r--mingling/src/features.rs11
-rw-r--r--mingling/src/lib.rs1
4 files changed, 23 insertions, 7 deletions
diff --git a/mingling/Cargo.toml b/mingling/Cargo.toml
index 351384f..9bf82a7 100644
--- a/mingling/Cargo.toml
+++ b/mingling/Cargo.toml
@@ -43,7 +43,8 @@ macros = ["dep:mingling_macros", "mingling_macros/default"]
nightly = ["mingling_core/nightly", "mingling_macros/nightly"]
debug = ["mingling_core/debug"]
async = ["mingling_core/async", "mingling_macros/async"]
-builds = ["mingling_core/builds"]
+
+build = ["mingling_core/build"]
default = ["core", "macros"]
@@ -92,6 +93,9 @@ extra_macros = ["mingling_macros/extra_macros"]
# Section only shown in docs.rs
docs_rs = []
+# This is an old name, will be Breaking Change in the future
+builds = ["mingling_core/build"]
+
[dependencies]
mingling_core = { workspace = true, optional = true }
mingling_macros = { workspace = true, optional = true }
diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs
index 3b36f00..35cf024 100644
--- a/mingling/src/example_docs.rs
+++ b/mingling/src/example_docs.rs
@@ -777,7 +777,7 @@ pub mod example_combine_pathf_dispatch_tree {}
/// To make your completions work, you need to generate a completion script using Mingling's tools
///
/// 1. Enable features
-/// You need to enable the `builds` and `comp` features for `mingling` in `[build-dependencies]`
+/// You need to enable the `build` and `comp` features for `mingling` in `[build-dependencies]`
///
/// 2. Write `build.rs`
/// Write the following in `build.rs`
@@ -838,8 +838,8 @@ pub mod example_combine_pathf_dispatch_tree {}
/// "comp",
///
/// # If you want to build completion scripts,
-/// # enable `builds` features
-/// "builds",
+/// # enable `build` features
+/// "build",
/// ]
///
/// [workspace]
@@ -1649,7 +1649,7 @@ pub mod example_help {}
/// .on_pre_chain(|info| {
/// println!("[DEBUG] Pre chain: {}", info.input);
/// })
-/// .on_post_chain(|info| println!("[DEBUG] Post chain: {}", info.output.member_id))
+/// .on_post_chain(|info| println!("[DEBUG] Post chain: {}", info.output.member_id()))
/// .on_finish(|_| {
/// println!("[DEBUG] Loop end");
/// ProgramControlUnit::OverrideExitCode(0) // Override exit code
@@ -2268,8 +2268,8 @@ pub mod example_panic_unwind {}
/// # Enable `pathf` features
/// "pathf",
///
-/// # Enable the `builds` feature for build-time support
-/// "builds",
+/// # Enable the `build` feature for build-time support
+/// "build",
/// ]
///
/// [workspace]
diff --git a/mingling/src/features.rs b/mingling/src/features.rs
index 78d6226..0dde333 100644
--- a/mingling/src/features.rs
+++ b/mingling/src/features.rs
@@ -20,6 +20,17 @@ pub const MINGLING_ASYNC: bool = false;
#[cfg(feature = "async")]
#[allow(unused)]
pub const MINGLING_ASYNC: bool = true;
+/// Whether the `build` feature is enabled
+/// Current: `disabled`
+#[cfg(not(feature = "build"))]
+#[allow(unused)]
+pub const MINGLING_BUILD: bool = false;
+
+/// Whether the `build` feature is enabled
+/// Current: `enabled`
+#[cfg(feature = "build")]
+#[allow(unused)]
+pub const MINGLING_BUILD: bool = true;
/// Whether the `builds` feature is enabled
/// Current: `disabled`
#[cfg(not(feature = "builds"))]
diff --git a/mingling/src/lib.rs b/mingling/src/lib.rs
index fd274aa..19f2188 100644
--- a/mingling/src/lib.rs
+++ b/mingling/src/lib.rs
@@ -4,6 +4,7 @@
)]
#![deny(missing_docs)]
#![doc = include_str!("lib.md")]
+#![cfg_attr(docsrs, feature(doc_cfg))]
#[cfg(feature = "core")]
mod example_docs;