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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -36,7 +36,7 @@ impl Command for SubCommand {
}
fn extra_usage(&self) -> &str {
"into duration does not take leap years into account and every month is calculated with 30 days"
"This command does not take leap years into account, and every month is assumed to have 30 days."
}
fn search_terms(&self) -> Vec<&str> {

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,