File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package cmd
33import (
44 "context"
55 "os"
6+ "slices"
67
78 "github.com/spf13/cobra"
89
@@ -51,6 +52,12 @@ var listCmd = &cobra.Command{
5152
5253 spinner .Stop ()
5354
55+ devices = slices .DeleteFunc (devices ,
56+ func (d list.Device ) bool {
57+ return d .Hostname == "N/A" && d .RemoteIP == nil
58+ },
59+ )
60+
5461 enc := encoder .New [list.Device ](os .Stdout , output )
5562 if err := enc .Encode (devices ... ); err != nil {
5663 usage .Fatalf (cmd , "failed to encode devices: %s" , err )
Original file line number Diff line number Diff line change 44 "context"
55 "net"
66 "os"
7+ "slices"
78
89 "github.com/spf13/cobra"
910
@@ -127,6 +128,12 @@ var scanCmd = &cobra.Command{
127128
128129 spinner .Stop ()
129130
131+ scans = slices .DeleteFunc (scans ,
132+ func (s scanner.Scan ) bool {
133+ return s .Host == "N/A" && len (s .Ports ) == 0
134+ },
135+ )
136+
130137 enc := encoder .New [scanner.Scan ](os .Stdout , output )
131138 if err := enc .Encode (scans ... ); err != nil {
132139 usage .Fatalf (cmd , "failed to encode devices: %s" , err )
You can’t perform that action at this time.
0 commit comments