Skip to content

Commit 58f8c75

Browse files
authored
fix: network/sockets command (#978)
1 parent 96c7e61 commit 58f8c75

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

modules/network/sockets/sockets.nu

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export def sockets [--abbreviate-java-class-paths (-j)] {
1+
export def main [--abbreviate-java-class-paths (-j)] {
22
let input = (^lsof +c 0xFFFF -i -n -P)
33
let header = ($input | lines
44
| take 1
@@ -12,7 +12,7 @@ export def sockets [--abbreviate-java-class-paths (-j)] {
1212
| upsert 'pid' { |r| $r.pid | into int }
1313
| rename --column { name: connection }
1414
| reject 'command'
15-
| join-table (ps -l) 'pid' 'pid'
15+
| join (ps -l) 'pid' 'pid'
1616
| if $abbreviate_java_class_paths {
1717
upsert 'classpath' { |r| $r.command | java-cmd classpath }
1818
| upsert 'command' { |r| $r.command | java-cmd abbreviate-classpath }
@@ -26,7 +26,3 @@ export def 'java-cmd classpath' [] {
2626
export def 'java-cmd abbreviate-classpath' [] {
2727
str replace '[^ ]*\.jar' '*.jar'
2828
}
29-
30-
export def join-table [table: table, left_on: string, right_on: string] {
31-
dfr into df | join ($table | dfr into df) $left_on $right_on | dfr into nu
32-
}

0 commit comments

Comments
 (0)