@@ -8,7 +8,7 @@ pub enum ClapErrorType {
8
8
/// Error occurs when some possible values were set, but clap found unexpected value
9
9
///
10
10
///
11
- /// # Example
11
+ /// # Examples
12
12
///
13
13
/// ```no_run
14
14
/// # use clap::{App, Arg};
@@ -22,7 +22,7 @@ pub enum ClapErrorType {
22
22
/// Error occurs when clap found unexpected flag or option
23
23
///
24
24
///
25
- /// # Example
25
+ /// # Examples
26
26
///
27
27
/// ```no_run
28
28
/// # use clap::{App, Arg};
@@ -34,7 +34,7 @@ pub enum ClapErrorType {
34
34
/// Error occurs when clap found unexpected subcommand
35
35
///
36
36
///
37
- /// # Example
37
+ /// # Examples
38
38
///
39
39
/// ```no_run
40
40
/// # use clap::{App, Arg, SubCommand};
@@ -50,7 +50,7 @@ pub enum ClapErrorType {
50
50
/// Error occurs when option does not allow empty values but some was found
51
51
///
52
52
///
53
- /// # Example
53
+ /// # Examples
54
54
///
55
55
/// ```no_run
56
56
/// # use clap::{App, Arg};
@@ -70,7 +70,7 @@ pub enum ClapErrorType {
70
70
/// Error occurs when argument got more values then were expected
71
71
///
72
72
///
73
- /// # Example
73
+ /// # Examples
74
74
///
75
75
/// ```no_run
76
76
/// # use clap::{App, Arg};
@@ -83,7 +83,7 @@ pub enum ClapErrorType {
83
83
/// Error occurs when argument got less values then were expected
84
84
///
85
85
///
86
- /// # Example
86
+ /// # Examples
87
87
///
88
88
/// ```no_run
89
89
/// # use clap::{App, Arg};
@@ -96,7 +96,7 @@ pub enum ClapErrorType {
96
96
/// Error occurs when clap find two ore more conflicting arguments
97
97
///
98
98
///
99
- /// # Example
99
+ /// # Examples
100
100
///
101
101
/// ```no_run
102
102
/// # use clap::{App, Arg};
@@ -109,7 +109,7 @@ pub enum ClapErrorType {
109
109
/// Error occurs when one or more required arguments missing
110
110
///
111
111
///
112
- /// # Example
112
+ /// # Examples
113
113
///
114
114
/// ```no_run
115
115
/// # use clap::{App, Arg};
@@ -122,7 +122,7 @@ pub enum ClapErrorType {
122
122
/// Error occurs when required subcommand missing
123
123
///
124
124
///
125
- /// # Example
125
+ /// # Examples
126
126
///
127
127
/// ```no_run
128
128
/// # use clap::{App, Arg, AppSettings, SubCommand};
@@ -140,7 +140,7 @@ pub enum ClapErrorType {
140
140
/// `AppSettings::ArgRequiredElseHelp` was used
141
141
///
142
142
///
143
- /// # Example
143
+ /// # Examples
144
144
///
145
145
/// ```no_run
146
146
/// # use clap::{App, Arg, AppSettings, SubCommand};
@@ -157,7 +157,7 @@ pub enum ClapErrorType {
157
157
/// Error occurs when clap find argument while is was not expecting any
158
158
///
159
159
///
160
- /// # Example
160
+ /// # Examples
161
161
///
162
162
/// ```no_run
163
163
/// # use clap::{App};
@@ -168,7 +168,7 @@ pub enum ClapErrorType {
168
168
/// Error occurs when argument was used multiple times and was not set as multiple.
169
169
///
170
170
///
171
- /// # Example
171
+ /// # Examples
172
172
///
173
173
/// ```no_run
174
174
/// # use clap::{App, Arg};
@@ -178,6 +178,24 @@ pub enum ClapErrorType {
178
178
/// .get_matches_from_safe(vec!["", "--debug", "--debug"]);
179
179
/// ```
180
180
UnexpectedMultipleUsage ,
181
+ /// Error occurs when argument contains invalid unicode characters
182
+ ///
183
+ ///
184
+ /// # Examples
185
+ ///
186
+ /// ```no_run
187
+ /// # use clap::{App, Arg};
188
+ /// # use std::os::unix::ffi::OsStringExt;
189
+ /// # use std::ffi::OsString;
190
+ /// let result = App::new("myprog")
191
+ /// .arg(Arg::with_name("debug")
192
+ /// .short("u")
193
+ /// .takes_value(true))
194
+ /// .get_matches_from_safe(vec![OsString::from_vec(vec![0x20]),
195
+ /// OsString::from_vec(vec![0xE9])]);
196
+ /// assert!(result.is_err());
197
+ /// ```
198
+ InvalidUnicode
181
199
}
182
200
183
201
/// Command line argument parser error
0 commit comments