Add help warnings for path exists and path type regarding usage (#7062)

* Add help warnings to `path exists` and `path type`

* Correction
This commit is contained in:
Leon
2022-11-09 22:41:55 +10:00
committed by GitHub
parent 2b9f258126
commit cd89304706
3 changed files with 11 additions and 1 deletions

View File

@ -38,6 +38,11 @@ impl Command for SubCommand {
"Check whether a path exists"
}
fn extra_usage(&self) -> &str {
r#"This only checks if it is possible to either `open` or `cd` to the given path.
If you need to distinguish dirs and files, please use `path type`."#
}
fn run(
&self,
engine_state: &nu_protocol::engine::EngineState,

View File

@ -36,6 +36,11 @@ impl Command for SubCommand {
"Get the type of the object a path refers to (e.g., file, dir, symlink)"
}
fn extra_usage(&self) -> &str {
r#"This checks the file system to confirm the path's object type.
If nothing is found, an empty string will be returned."#
}
fn run(
&self,
engine_state: &nu_protocol::engine::EngineState,