Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make clap an optional dependency #69

Merged
merged 1 commit into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ version = "0.4.0"
[dependencies]
anyhow = "1"
bytes = "1"
clap = {version = "4.2.5", features = ["color", "help", "usage", "derive"]}
clap = {version = "4.2.5", features = ["color", "help", "usage", "derive"], optional = true}
lazy_static = "1.4.0"
prost = "0.11"
rand = "0.8.5"
Expand All @@ -32,6 +32,14 @@ cities-json = "0.3.6"
[dev-dependencies]
criterion = {version = "0.4", features = ["html_reports"]}

[features]
default = ["clap"]

[[bin]]
name = "tzf"
required-features = ["clap"]
doc = false

[[bench]]
harness = false
name = "finders"
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
- Geometry: use <https://github.com/ringsaturn/geometry-rs> which is
<https://github.com/tidwall/geometry>'s Rust port.

## Build options

By default, the binary is built as well. If you don't want/need it, then build like this:

```bash
> cargo build --no-default-features
```

Or put in your `Cargo.toml` file:

```toml
tzf-rs = { version = "0.4.0", default-features = false }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try this in tzfpy, and will merge this PR if everything is fine:

tzf-rs = { git =  "https://github.com/wildwestrom/tzf-rs", rev = "6e523af", default-features = false}

```

## Bindings

- Ruby, see [tzf-rb](https://github.com/HarlemSquirrel/tzf-rb)
Expand Down
2 changes: 2 additions & 0 deletions src/bin/tzf.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "clap")]

use clap::Parser;
use tzf_rs::DefaultFinder;

Expand Down