mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
chore: more refactoring and cleanup
This commit is contained in:
parent
aecb56971d
commit
844ce3c3e0
3 changed files with 29 additions and 33 deletions
|
|
@ -3,10 +3,10 @@ package cmd
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os/user"
|
||||
|
||||
"github.com/OpenCHAMI/magellan/internal/cache/sqlite"
|
||||
urlx "github.com/OpenCHAMI/magellan/internal/url"
|
||||
"github.com/OpenCHAMI/magellan/internal/util"
|
||||
magellan "github.com/OpenCHAMI/magellan/pkg"
|
||||
"github.com/OpenCHAMI/magellan/pkg/auth"
|
||||
"github.com/OpenCHAMI/magellan/pkg/bmc"
|
||||
|
|
@ -141,14 +141,13 @@ var CollectCmd = &cobra.Command{
|
|||
}
|
||||
|
||||
func init() {
|
||||
currentUser, _ = user.Current()
|
||||
CollectCmd.Flags().StringVar(&host, "host", "", "Set the URI to the SMD root endpoint")
|
||||
CollectCmd.Flags().StringVarP(&username, "username", "u", "", "Set the master BMC username")
|
||||
CollectCmd.Flags().StringVarP(&password, "password", "p", "", "Set the master BMC password")
|
||||
CollectCmd.Flags().StringVar(&secretsFile, "secrets-file", "", "Set path to the node secrets file")
|
||||
CollectCmd.Flags().StringVar(&scheme, "scheme", "https", "Set the default scheme used to query when not included in URI")
|
||||
CollectCmd.Flags().StringVar(&protocol, "protocol", "tcp", "Set the protocol used to query")
|
||||
CollectCmd.Flags().StringVarP(&outputPath, "output", "o", fmt.Sprintf("/tmp/%smagellan/inventory/", currentUser.Username+"/"), "Set the path to store collection data")
|
||||
CollectCmd.Flags().StringVarP(&outputPath, "output", "o", fmt.Sprintf("/tmp/%smagellan/inventory/", util.GetCurrentUsername()+"/"), "Set the path to store collection data")
|
||||
CollectCmd.Flags().BoolVar(&forceUpdate, "force-update", false, "Set flag to force update data sent to SMD")
|
||||
CollectCmd.Flags().StringVar(&cacertPath, "cacert", "", "Set the path to CA cert file. (defaults to system CAs when blank)")
|
||||
CollectCmd.Flags().StringVarP(&format, "format", "F", "hive", "Set the output format (json|yaml)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue