We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 04ddf42 + c37c421 commit 558b878Copy full SHA for 558b878
src/tools/jsondocck/src/main.rs
@@ -149,7 +149,22 @@ fn get_commands(template: &str) -> Result<Vec<Command>, ()> {
149
}
150
151
152
- let args = cap.name("args").map_or(vec![], |m| shlex::split(m.as_str()).unwrap());
+ let args = cap.name("args").map_or(Some(vec![]), |m| shlex::split(m.as_str()));
153
+
154
+ let args = match args {
155
+ Some(args) => args,
156
+ None => {
157
+ print_err(
158
+ &format!(
159
+ "Invalid arguments to shlex::split: `{}`",
160
+ cap.name("args").unwrap().as_str()
161
+ ),
162
+ lineno,
163
+ );
164
+ errors = true;
165
+ continue;
166
+ }
167
+ };
168
169
if !cmd.validate(&args, commands.len(), lineno) {
170
errors = true;
0 commit comments