tangled
alpha
login
or
join now
ptr.pet
/
faunu
2
fork
atom
nushell on your web browser
nushell
wasm
terminal
2
fork
atom
overview
issues
pulls
pipelines
correct rm argument types
ptr.pet
2 months ago
fd6567f4
1c5f862e
verified
This commit was signed with the committer's
known signature
.
ptr.pet
SSH Key Fingerprint:
SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw=
+8
-8
2 changed files
expand all
collapse all
unified
split
src
cmd
glob.rs
rm.rs
+7
-7
src/cmd/glob.rs
···
169
169
} else {
170
170
1
171
171
};
172
172
-
172
172
+
173
173
let should_recurse = is_recursive
174
174
|| (has_path_separator && current_depth + 1 < pattern_component_count);
175
175
···
224
224
.required(
225
225
"pattern",
226
226
SyntaxShape::OneOf(vec![SyntaxShape::String, SyntaxShape::GlobPattern]),
227
227
-
"The glob expression.",
227
227
+
"the glob expression.",
228
228
)
229
229
.named(
230
230
"depth",
···
234
234
)
235
235
.switch(
236
236
"no-dir",
237
237
-
"Whether to filter out directories from the returned paths",
237
237
+
"whether to filter out directories from the returned paths",
238
238
Some('D'),
239
239
)
240
240
.switch(
241
241
"no-file",
242
242
-
"Whether to filter out files from the returned paths",
242
242
+
"whether to filter out files from the returned paths",
243
243
Some('F'),
244
244
)
245
245
.input_output_type(Type::Nothing, Type::List(Box::new(Type::String)))
···
247
247
}
248
248
249
249
fn description(&self) -> &str {
250
250
-
"Creates a list of files and/or folders based on the glob pattern provided."
250
250
+
"creates a list of paths based on the glob pattern provided."
251
251
}
252
252
253
253
fn run(
···
268
268
Value::String { val, .. } | Value::Glob { val, .. } => val,
269
269
_ => {
270
270
return Err(ShellError::IncorrectValue {
271
271
-
msg: "Incorrect glob pattern supplied to glob. Please use string or glob only."
271
271
+
msg: "incorrect glob pattern supplied to glob. use string or glob only."
272
272
.to_string(),
273
273
-
val_span: call.head,
273
273
+
val_span: pattern_span,
274
274
call_span: pattern_span,
275
275
});
276
276
}
+1
-1
src/cmd/rm.rs
···
23
23
Signature::build("rm")
24
24
.required(
25
25
"path",
26
26
-
SyntaxShape::OneOf(vec![SyntaxShape::String, SyntaxShape::GlobPattern]),
26
26
+
SyntaxShape::OneOf(vec![SyntaxShape::Filepath, SyntaxShape::GlobPattern]),
27
27
"path to file or directory to remove",
28
28
)
29
29
.switch(