mirror of
https://github.com/nushell/nu_scripts.git
synced 2024-08-16 17:00:32 +03:00
fix: replace -c ['name' 'connection']
by --column { name: connection }
(#646)
The documentation states that the flag `-c`/`--column` now takes a record as argument instead of an array: https://www.nushell.sh/commands/docs/rename.html#flags. I have made the change, and you can check in a nu prompt that it works as intended: ```nu let input = (^lsof +c 0xFFFF -i -n -P) let header = ($input | lines | take 1 | each { str downcase | str replace ' name$' ' name state' }) let body = ($input | lines | skip 1 | each { str replace '([^)])$' '$1 (NONE)' | str replace ' \((.+)\)$' ' $1' }) [$header] | append $body | to text | detect columns | upsert 'pid' { |r| $r.pid | into int } | rename --column { name: connection } ```
This commit is contained in:
parent
ed9165fda1
commit
7b2856ddff
@ -10,7 +10,7 @@ export def sockets [--abbreviate-java-class-paths (-j)] {
|
||||
| to text
|
||||
| detect columns
|
||||
| upsert 'pid' { |r| $r.pid | into int }
|
||||
| rename -c ['name' 'connection']
|
||||
| rename --column { name: connection }
|
||||
| reject 'command'
|
||||
| join-table (ps -l) 'pid' 'pid'
|
||||
| if $abbreviate_java_class_paths {
|
||||
|
Loading…
Reference in New Issue
Block a user