diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29a2eae..ee5dafd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - - run: cargo test --features complete --workspace + - run: cargo test --workspace rustfmt: name: Rustfmt @@ -48,7 +48,7 @@ jobs: components: clippy - uses: Swatinem/rust-cache@v2 - name: Clippy check - run: cargo clippy --all-targets --features complete --workspace -- -D warnings + run: cargo clippy --all-targets --workspace -- -D warnings docs: name: Docs diff --git a/Cargo.toml b/Cargo.toml index e9c6517..32a3905 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,13 +11,12 @@ readme = "README.md" [dependencies] uutils-args-derive = { version = "0.1.0", path = "derive" } -uutils-args-complete = { version = "0.1.0", path = "complete", optional = true } +uutils-args-complete = { version = "0.1.0", path = "complete" } strsim = "0.11.1" lexopt = "0.3.0" [features] -parse-is-complete = ["complete"] -complete = ["uutils-args-complete"] +parse-is-complete = [] [workspace] members = ["derive", "complete"] diff --git a/Justfile b/Justfile index 7790af0..c7cea4d 100644 --- a/Justfile +++ b/Justfile @@ -1,5 +1,5 @@ check: cargo fmt --all - cargo test --features complete - cargo clippy --all-targets --features complete --workspace -- -D warnings + cargo test + cargo clippy --all-targets --workspace -- -D warnings cargo doc diff --git a/derive/src/lib.rs b/derive/src/lib.rs index 5f6d9d7..5b0aa79 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -117,7 +117,6 @@ pub fn arguments(input: TokenStream) -> TokenStream { #version_string } - #[cfg(feature = "complete")] fn complete() -> ::uutils_args_complete::Command<'static> { use ::uutils_args::Value; #complete_command @@ -212,7 +211,6 @@ pub fn value(input: TokenStream) -> TokenStream { }) } - #[cfg(feature = "complete")] fn value_hint() -> ::uutils_args_complete::ValueHint { let keys: [&str; #keys_len] = [#(#all_keys),*]; ::uutils_args_complete::ValueHint::Strings( diff --git a/docs/guide/completions.md b/docs/guide/completions.md index d89d3dd..e7d04c1 100644 --- a/docs/guide/completions.md +++ b/docs/guide/completions.md @@ -39,7 +39,7 @@ The `[shell]` value here can be `fish`, `zsh`, `nu`, `sh`, `bash`, `csh`, `elvis Additionally, the values `man` or `md` can be passed to generate man pages and markdown documentation (for `mdbook`). -If you do not want to hijack the [`Options::parse`](crate::Options::parse) function, you can instead enable the `complete` feature flag. This makes the `Options::complete` function available in addition to the [`Options::parse`](crate::Options::parse) function to generate a `String` with the completion. +If you do not want to hijack the [`Options::parse`](crate::Options::parse) function, you can instead use the `Options::complete` function available in addition to the [`Options::parse`](crate::Options::parse) function to generate a `String` with the completion.