Collection of reusable flags for Clap.
```rust use futures::prelude::*; use hyper::service::servicefnok; use hyper::{Body, Response, Server}; use structopt::StructOpt;
struct Cli { #[structopt(flatten)] verbosity: clapflags::Verbosity, #[structopt(flatten)] logger: clapflags::Log, #[structopt(flatten)] port: clap_flags::Port, }
fn main() -> Result<(), Box
args.logger.logall(args.verbosity.loglevel())?;
let handle = tokio::reactor::Handle::current(); let listener = tokio::net::TcpListener::fromstd(listener, &handle)?; let addr = listener.localaddr()?;
let server = Server::builder(listener.incoming()) .serve(|| servicefnok(|| Response::new(Body::from("Hello World")))) .maperr(|e| eprintln!("server error: {}", e));
info!("Server listening on {}", addr); tokio::run(server);
Ok(()) } ```
```txt clap_flags 0.1.0 Yoshua Wuyts yoshuawuyts@gmail.com Collection of reusable flags for Clap
USAGE: main [FLAGS] [OPTIONS]
FLAGS: -h, --help Prints help information -P, --pretty Enable pretty printing. -V, --version Prints version information -v, --verbosity Pass many times for more log output
OPTIONS: -a, --address
The network address to listen to. [default: 127.0.0.1] --listen-fdsh
$ cargo add clap_flags
MIT OR Apache-2.0