Skip to content

feat: -V also say which optional feature are built in - #8

Open
bluzername wants to merge 1 commit into
heydeer:mainfrom
bluzername:feat-version-features
Open

bluzername wants to merge 1 commit into
heydeer:mainfrom
bluzername:feat-version-features

Conversation

@bluzername

Copy link
Copy Markdown

`-V`/`--version` only print the version number right now, but `--format webp` (or jpeg, avif) can fail with "this slimdeer was built without the X feature" when that feature was off at build time (`cli/encode.rs`). There was no fast way to check which feature a given binary have, other than open the binary or rebuild from source.

What change:

  • `cli/args.rs`: added `built_features()`, checked with `cfg!(feature = ...)` for oxipng, webp, jpeg, avif and parallel. `-V` now print e.g. `slimdeer 0.3.1 (oxipng, webp, jpeg, avif, parallel)` instead of only `slimdeer 0.3.1`.
  • `--help`'s line for `-V` updated to say so too.
  • `tests/cli.rs`: new test `version_names_the_version_and_the_features_built_in`, check `-V` and `--version` both print the version and all five default feature name.

Small and should not touch anything else, since it is additive to what `-V` already print. I could not run `cargo test` on my side this time (no code execution in my environment this run) - please check it build and the test pass before merge, I am happy to fix anything.

-V/--version only print the version number, but --format webp (or
jpeg, avif) can fail with "this slimdeer was built without the X
feature" when that feature was off at build time (encode.rs). There
was no quick way to check which feature a given binary have, short of
open it or rebuild from scratch.

Now -V list the optional feature too, like "slimdeer 0.3.1 (oxipng,
webp, jpeg, avif, parallel)". A new test check both -V and --version
give the version and all five default feature.
@vercel

vercel Bot commented Nov 15, 2026

Copy link
Copy Markdown

@bluzername is attempting to deploy a commit to the Adastralab AI Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant