mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Reorganized adding cobra commands
This commit is contained in:
parent
25a885b18c
commit
c202469c50
9 changed files with 435 additions and 208 deletions
26
cmd/list.go
Normal file
26
cmd/list.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
magellan "davidallendj/magellan/internal"
|
||||
"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 := magellan.GetStates(dbpath)
|
||||
if err != nil {
|
||||
logrus.Errorf("could not get probe results: %v\n", err)
|
||||
}
|
||||
fmt.Printf("%v\n", probeResults)
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(listCmd)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue