Skip to content

Commit

Permalink
make clap and optional dependency (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
wildwestrom committed May 7, 2023
1 parent 99f0814 commit d8480df
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
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 }
```

## 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

0 comments on commit d8480df

Please sign in to comment.