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.
1 parent b814b63 commit 351b2acCopy full SHA for 351b2ac
src/tools/jsondocck/src/main.rs
@@ -149,7 +149,20 @@ 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")
153
+ .map_or(Some(vec![]), |m| shlex::split(m.as_str()));
154
+
155
+ let args = match args {
156
+ Some(args) => args,
157
+ None => {
158
+ print_err(
159
+ &format!("Invalid arguments to shlex::split: `{}`", cap.name("args").unwrap().as_str()),
160
+ lineno
161
+ );
162
+ errors = true;
163
+ continue;
164
+ }
165
+ };
166
167
if !cmd.validate(&args, commands.len(), lineno) {
168
errors = true;
0 commit comments