feat: added config implementation using viper
This commit is contained in:
parent
7713c2e55d
commit
481a0782c5
6 changed files with 215 additions and 64 deletions
|
|
@ -49,6 +49,7 @@ var downloadCmd = cobra.Command{
|
|||
host, _ = cmd.Flags().GetString("host")
|
||||
path, _ = cmd.Flags().GetString("path")
|
||||
outputPath, _ = cmd.Flags().GetString("output")
|
||||
configPath, _ = cmd.Flags().GetString("config")
|
||||
cacertPath, _ = cmd.Flags().GetString("cacert")
|
||||
pluginNames, _ = cmd.Flags().GetStringSlice("plugins")
|
||||
profileIDs, _ = cmd.Flags().GetStringSlice("profiles")
|
||||
|
|
@ -62,6 +63,7 @@ var downloadCmd = cobra.Command{
|
|||
err error
|
||||
)
|
||||
|
||||
// build download query URL
|
||||
query = fmt.Sprintf("/download/%s?", path)
|
||||
if len(pluginNames) > 0 {
|
||||
query += "plugins=" + url.QueryEscape(strings.Join(pluginNames, ","))
|
||||
|
|
@ -79,6 +81,7 @@ var downloadCmd = cobra.Command{
|
|||
log.Debug().
|
||||
Str("host", host).
|
||||
Str("path", path).
|
||||
Str("config", configPath).
|
||||
Str("query", query).
|
||||
Str("output", outputPath).
|
||||
Strs("profiles", profileIDs).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue