mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Changed the default storage location for scanning cache
This commit is contained in:
parent
e93f49eb82
commit
b6d429f072
3 changed files with 15 additions and 12 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"os/user"
|
||||
|
||||
magellan "github.com/OpenCHAMI/magellan/internal"
|
||||
"github.com/OpenCHAMI/magellan/internal/api/smd"
|
||||
|
|
@ -19,8 +20,8 @@ var (
|
|||
hosts []string
|
||||
protocol string
|
||||
cacertPath string
|
||||
user string
|
||||
pass string
|
||||
username string
|
||||
password string
|
||||
dbpath string
|
||||
drivers []string
|
||||
preferredDriver string
|
||||
|
|
@ -76,13 +77,15 @@ func LoadAccessToken() (string, error) {
|
|||
}
|
||||
|
||||
func init() {
|
||||
// get the current user
|
||||
currentUser, _ := user.Current()
|
||||
cobra.OnInitialize(InitializeConfig)
|
||||
rootCmd.PersistentFlags().IntVar(&threads, "threads", -1, "set the number of threads")
|
||||
rootCmd.PersistentFlags().IntVar(&timeout, "timeout", 30, "set the timeout")
|
||||
rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", "", "set the config file path")
|
||||
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "set verbose flag")
|
||||
rootCmd.PersistentFlags().StringVar(&accessToken, "access-token", "", "set the access token")
|
||||
rootCmd.PersistentFlags().StringVar(&dbpath, "db.path", "/tmp/magellan/magellan.db", "set the probe storage path")
|
||||
rootCmd.PersistentFlags().StringVar(&dbpath, "db.path", fmt.Sprintf("/tmp/%smagellan/magellan.db", currentUser.Name+"/"), "set the probe storage path")
|
||||
|
||||
// bind viper config flags with cobra
|
||||
viper.BindPFlag("threads", rootCmd.Flags().Lookup("threads"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue