Skip to content

Commit

Permalink
Added basic argument parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
JarredAllen committed Aug 3, 2019
1 parent b8c9ff7 commit 4d33492
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/arguments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Ja
version: "0.1"
about: Like Yes, but better
author: Jarred Allen <[email protected]>

settings:
- ArgRequiredElseHelp

args:
- DELAY:
help: A delay to wait between each output, in seconds (default none)
short: d
long: delay
multiple: false
takes_value: true
- STRING:
help: Text to repeatedly output
required: true
index: 1
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
extern crate clap;

fn main() {
println!("Hello, world!");
use clap::App;

let yml = load_yaml!("arguments.yml");
let m = App::from_yaml(yml).get_matches();
}

0 comments on commit 4d33492

Please sign in to comment.