Skip to content

Commit 2e6d7cf

Browse files
committed
fix: convert help to enum
1 parent 1991c9e commit 2e6d7cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ enum Flags {
88
_Metadata,
99
PreviewImage,
1010
Thumbnails,
11+
Help,
1112
}
1213

1314
// impl fmt::Display for Flags {
@@ -36,6 +37,7 @@ impl Flags {
3637
Flags::_Metadata => "metadata",
3738
Flags::PreviewImage => "preview_image",
3839
Flags::Thumbnails => "thumbs",
40+
Flags::Help => "help",
3941
}
4042
}
4143
}
@@ -85,8 +87,8 @@ fn main() {
8587
)
8688
.get_matches();
8789

88-
let input = matches.value_of("input").unwrap_or("help");
89-
if input == "help" {
90+
let input = matches.value_of("input").unwrap_or(Flags::Help.as_str());
91+
if input == Flags::Help.as_str() {
9092
println!("Usage: <TODO>");
9193
process::exit(1);
9294
}

0 commit comments

Comments
 (0)