-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make specifying an invalid unlock method a parser error
Because it would require implementing the ValueEnum trait for UnlockMethod somewhere in stratisd rather than in stratis_min.rs, do not attempt that approach at this time. The gain is that the parser becomes responsible for useful things: 1. Listing the allowed options. 2. Exiting with error code 2 if the unlock_method option is used with an invalid unlock method value, rather than deferring the error until it is a runtime error. Uses the trick explained here: clap-rs/clap#4264 Signed-off-by: mulhern <[email protected]>
- Loading branch information
Showing
3 changed files
with
15 additions
and
18 deletions.
There are no files selected for viewing
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
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
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