Here is my code in src/bin/foo.rs
:
use clap::command;
pub fn main() {
let matches = command!("foo")
.about("Simple util")
.get_matches();
}
I'm getting:
error: `cargo` feature flag is required
--> src/bin/foo.rs:30:19
|
30 | let matches = command!("foo")
| ^^^^^^^^^^^^^^^
|
In your Cargo.toml
file change your clap dependency to enable the cargo
feature.
e.g.
clap = { version = "3.2.20", features = ["cargo"] }