diff options
author | Teddy Wing | 2019-11-02 21:06:35 +0100 |
---|---|---|
committer | Teddy Wing | 2019-11-02 21:06:35 +0100 |
commit | 1d5bbbd55d2307cd0c50e54e08f1ee632066eefb (patch) | |
tree | 45963462af870fcf1c37a2ee7cbac1b859fdef0c /src/main.rs | |
parent | eb2f9c78a4698ccc2d09e5021fbf7155e49f561d (diff) | |
download | pdf-urls-1d5bbbd55d2307cd0c50e54e08f1ee632066eefb.tar.bz2 |
Add a `--help` flag
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 8f246b3..12d5725 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,6 +28,7 @@ fn print_usage() { println!(r#"usage: pdf-urls [<options>] FILE Options: + -h, --help print this help menu -v, --version print the program version"#); } @@ -40,6 +41,12 @@ fn main() { process::exit(exitcode::USAGE); } + if args[1] == "-h" || args[1] == "--help" { + print_usage(); + + process::exit(exitcode::OK); + } + if args[1] == "-v" || args[1] == "--version" { println!("{}", VERSION); |