mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 03:25:10 +02:00
Environment-aware help for open
and save
(#15651)
# Description This extends the documentation on the commands `open` and `save` can run under the hood, and explicitly lists those, based on the current user environment. Also see [this discord thread](https://discord.com/channels/601130461678272522/988303282931912704/1364930487092777020) # User-Facing Changes Users will be able to see the list of commands that `open` and `save` can run, and the extensions that each command is run for, in `help open` and `help save` respectively: ## `help open`  ## `help save`  # Tests + Formatting All pass except for the ones that don't (and never did pass for me before). # After Submitting No updates needed.
This commit is contained in:
@ -281,6 +281,16 @@ impl Command for Open {
|
||||
example: r#"def "from ndjson" [] { from json -o }; open myfile.ndjson"#,
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description: "Show the extensions for which the `open` command will automatically parse",
|
||||
example: r#"scope commands
|
||||
| where name starts-with "from "
|
||||
| insert extension { get name | str replace -r "^from " "" | $"*.($in)" }
|
||||
| select extension name
|
||||
| rename extension command
|
||||
"#,
|
||||
result: None,
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -263,6 +263,17 @@ impl Command for Save {
|
||||
example: r#"do -i {} | save foo.txt --stderr bar.txt"#,
|
||||
result: None,
|
||||
},
|
||||
Example {
|
||||
description:
|
||||
"Show the extensions for which the `save` command will automatically serialize",
|
||||
example: r#"scope commands
|
||||
| where name starts-with "to "
|
||||
| insert extension { get name | str replace -r "^to " "" | $"*.($in)" }
|
||||
| select extension name
|
||||
| rename extension command
|
||||
"#,
|
||||
result: None,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user