setting cli flags to proper commands (#860)

This commit is contained in:
pascal-fischer
2023-05-29 13:52:22 +02:00
committed by GitHub
parent 4fcf176a39
commit 0fa3abbec0
9 changed files with 88 additions and 34 deletions

View File

@@ -2,13 +2,23 @@ package cmd
import (
"context"
"fmt"
"os"
"path/filepath"
"runtime"
"github.com/spf13/cobra"
"github.com/netbirdio/netbird/client/internal"
)
func init() {
installCmd.PersistentFlags().StringVarP(&logLevel, "log-level", "l", "info", "sets Netbird log level")
installCmd.PersistentFlags().StringVar(&logFile, "log-file", defaultLogFile, "sets Netbird log path. If console is specified the the log will be output to stdout")
installCmd.PersistentFlags().StringVarP(&configPath, "config", "c", defaultConfigPath, "Netbird config file location")
installCmd.PersistentFlags().StringVarP(&managementURL, "management-url", "m", "", fmt.Sprintf("Management Service URL [http|https]://[host]:[port] (default \"%s\")", internal.DefaultManagementURL))
}
var installCmd = &cobra.Command{
Use: "install",
Short: "installs Netbird service",