Created
January 4, 2022 16:25
-
-
Save eduardonunesp/012cd5ecd4ae7e4d716dd9e3461b32b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate argparse; | |
use argparse::{ArgumentParser, StoreFalse, StoreTrue, Store}; | |
let mut vart = false; | |
let mut varf = true; | |
let mut vars = String::from(""); | |
{ | |
let mut ap = ArgumentParser::new(); | |
ap.set_description("Program description"); | |
ap.refer(&mut vart).add_option(&["-t", "--true"], StoreTrue, "description"); | |
ap.refer(&mut varf).add_option(&["-f", "--false"], StoreFalse, "description"); | |
ap.refer(&mut vars).add_option(&["-s", "--store"], Store, "description"); | |
ap.parse_args_or_exit(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment