mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 14:47:47 +00:00
complete manpages (#534)
* add manpage completions * fix replacing .gz in man cmp, format braces
This commit is contained in:
parent
fde7f5b768
commit
1d1a70417f
1 changed files with 16 additions and 0 deletions
16
custom-completions/man/man-completions.nu
Normal file
16
custom-completions/man/man-completions.nu
Normal file
|
@ -0,0 +1,16 @@
|
|||
def "manpages" [] {
|
||||
|
||||
^man -w
|
||||
| str trim
|
||||
| split row (char esep)
|
||||
| par-each { glob $'($in)/man?' }
|
||||
| flatten
|
||||
| par-each { ls $in | get name }
|
||||
| flatten
|
||||
| path basename
|
||||
| str replace -s ".gz" ""
|
||||
}
|
||||
|
||||
export extern "man" [
|
||||
...targets: string@"manpages"
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue