Skip to content

Commit

Permalink
Handle short options in form '-<short><value>'
Browse files Browse the repository at this point in the history
  • Loading branch information
petrpavlu committed Oct 11, 2024
1 parent a67e122 commit 0f233be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ where
};
}

// Handle '-<short><value>'.
if let Some(value) = arg.strip_prefix(short) {
return Ok(Some(value.to_string()));
}

// Handle '--<long>=<value>'.
if let Some(rem) = arg.strip_prefix(long) {
if let Some(value) = rem.strip_prefix("=") {
Expand Down

0 comments on commit 0f233be

Please sign in to comment.