-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(derive): Merge handling of bool/from_flag
This will make it easier to divide off parser logic for adding in actions. This does mean we can't provide error reporting on bad values with `bool` but - We should have also been doing that for `from_flag` - We'll be dropping this soon in clap4 anyways
- Loading branch information
Showing
11 changed files
with
71 additions
and
119 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
error: `arg_enum` is meaningless for bool | ||
--> $DIR/bool_arg_enum.rs:7:11 | ||
error[E0277]: the trait bound `bool: ArgEnum` is not satisfied | ||
--> tests/derive_ui/bool_arg_enum.rs:7:11 | ||
| | ||
7 | opts: bool, | ||
| ^^^^ the trait `ArgEnum` is not implemented for `bool` | ||
| | ||
note: required by `clap::ArgEnum::from_str` | ||
--> src/derive.rs | ||
| | ||
| fn from_str(input: &str, ignore_case: bool) -> Result<Self, String> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0618]: expected function, found enum variant `bool` | ||
--> tests/derive_ui/bool_arg_enum.rs:7:11 | ||
| | ||
7 | opts: bool, | ||
| ^^^^ | ||
| ^^^^ call expression requires function | ||
| | ||
help: `bool` is a unit variant, you need to write it without the parenthesis | ||
| | ||
7 | opts: bool, | ||
| ~~~~ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.