mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
28 lines
No EOL
547 B
Go
28 lines
No EOL
547 B
Go
package cmd
|
|
|
|
import (
|
|
"davidallendj/magellan/internal/db/sqlite"
|
|
"fmt"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
|
|
var listCmd = &cobra.Command{
|
|
Use: "list",
|
|
Short: "List information from scan",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
probeResults, err := sqlite.GetProbeResults(dbpath)
|
|
if err != nil {
|
|
logrus.Errorf("could not get probe results: %v\n", err)
|
|
}
|
|
for _, r := range probeResults {
|
|
fmt.Printf("%s:%d (%s)\n", r.Host, r.Port, r.Protocol)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(listCmd)
|
|
} |