Browse Source

Starting with the comand line options

master
Julio Biason 6 years ago
parent
commit
6d4651d654
  1. 3
      .gitignore
  2. 2
      templater/Cargo.toml
  3. 24
      templater/src/main.rs

3
.gitignore vendored

@ -1 +1,4 @@
*.sw?
.idea
**/target/**

2
templater/Cargo.toml

@ -3,5 +3,7 @@ name = "templater"
version = "0.1.0"
authors = ["Julio Biason <julio.biason@gmail.com>"]
edition = "2018"
description = "Generate files based on templates."
[dependencies]
clap = "2.32"

24
templater/src/main.rs

@ -1,3 +1,27 @@
use clap::App;
use clap::Arg;
use clap::crate_name;
use clap::crate_version;
use clap::crate_authors;
use clap::crate_description;
fn main() {
let params = App::new(crate_name!())
.version(crate_version!())
.author(crate_authors!())
.about(crate_description!())
.arg(Arg::with_name("bind")
.short("b")
.long("bind")
.value_name("ADDRESS")
.help("Binding address for the service")
.takes_value(true))
.arg(Arg::with_name("port")
.short("p")
.long("port")
.value_name("PORT")
.help("Port to bind")
.takes_value(true))
.get_matches();
println!("Hello, world!");
}

Loading…
Cancel
Save