mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue