forked from extern/nushell
Autogenerate missing docs (#3514)
* Autogenerate missing docs * Update ansi.md * Rename question mark command docs * Delete empty?.md
This commit is contained in:
39
docs/commands/path-parse.md
Normal file
39
docs/commands/path-parse.md
Normal file
@ -0,0 +1,39 @@
|
||||
# path parse
|
||||
Convert a path into structured data.
|
||||
|
||||
Each path is split into a table with 'parent', 'stem' and 'extension' fields.
|
||||
On Windows, an extra 'prefix' column is added.
|
||||
|
||||
## Usage
|
||||
```shell
|
||||
> path parse ...args {flags}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
* ...args: Optionally operate by column path
|
||||
|
||||
## Flags
|
||||
* -h, --help: Display this help message
|
||||
* -e, --extension <string>: Manually supply the extension (without the dot)
|
||||
|
||||
## Examples
|
||||
Parse a path
|
||||
```shell
|
||||
> echo '/home/viking/spam.txt' | path parse
|
||||
```
|
||||
|
||||
Replace a complex extension
|
||||
```shell
|
||||
> echo '/home/viking/spam.tar.gz' | path parse -e tar.gz | update extension { 'txt' }
|
||||
```
|
||||
|
||||
Ignore the extension
|
||||
```shell
|
||||
> echo '/etc/conf.d' | path parse -e ''
|
||||
```
|
||||
|
||||
Parse all paths under the 'name' column
|
||||
```shell
|
||||
> ls | path parse name
|
||||
```
|
||||
|
Reference in New Issue
Block a user