From e42567b25093907cfd939edc92ace94a5d59b398 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Mon, 11 May 2026 19:56:10 +0800 Subject: Add `builds` feature and install completion scripts --- examples/example-completion/src/main.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'examples/example-completion/src/main.rs') diff --git a/examples/example-completion/src/main.rs b/examples/example-completion/src/main.rs index 413afd3..3f1a377 100644 --- a/examples/example-completion/src/main.rs +++ b/examples/example-completion/src/main.rs @@ -3,13 +3,23 @@ //! # 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() { @@ -21,8 +31,8 @@ //! } //! ``` //! -//! 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 use mingling::{ EnumTag, Groupped, ShellContext, Suggest, -- cgit