Use clap app_from_crate

This commit is contained in:
Frank Denis 2020-08-01 17:37:58 +02:00
parent 87b06ef77d
commit 5a6d3d0b02
3 changed files with 6 additions and 8 deletions

View File

@ -1,7 +1,7 @@
[package]
name = "iptoasn-webservice"
description = "API server for iptoasn.com"
version = "0.2.4"
version = "0.2.5"
homepage = "https://iptoasn.com"
repository = "https://github.com/jedisct1/iptoasn-webservice"
keywords = ["ip", "asn", "bgp"]

View File

@ -1,6 +1,6 @@
BSD 2-Clause License
Copyright (c) 2016-2019, Frank Denis
Copyright (c) 2016-2020, Frank Denis
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -1,17 +1,18 @@
#[macro_use]
extern crate horrorshow;
#[macro_use]
extern crate log;
#[macro_use]
extern crate router;
#[macro_use]
extern crate clap;
mod asns;
mod webservice;
use crate::asns::*;
use crate::webservice::*;
use clap::{App, Arg};
use clap::Arg;
use std::sync::{Arc, RwLock};
use std::thread;
use std::time::Duration;
@ -35,10 +36,7 @@ fn update_asns(asns_arc: &Arc<RwLock<Arc<ASNs>>>, db_url: &str) {
}
fn main() {
let matches = App::new("iptoasn webservice")
.version("0.2.0")
.author("Frank Denis")
.about("Webservice for https://iptoasn.com")
let matches = app_from_crate!()
.arg(
Arg::with_name("listen_addr")
.short("l")