add MediaLofi in kontor-gin (#97)
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #97
This commit was merged in pull request #97.
This commit is contained in:
@@ -2,30 +2,25 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"kontor-api-gin/internal/config"
|
||||
"log/slog"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var cfgFile string
|
||||
var verbose int
|
||||
|
||||
// rootCmd represents the base command when called without any subcommands
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "kontor-cli",
|
||||
Short: "A brief description of your application",
|
||||
Long: `A longer description that spans multiple lines and likely contains
|
||||
examples and usage of using your application. For example:
|
||||
|
||||
Cobra is a CLI library for Go that empowers applications.
|
||||
This application is a tool to generate the needed files
|
||||
to quickly create a Cobra application.`,
|
||||
Use: "kontor-cli",
|
||||
TraverseChildren: true,
|
||||
Short: "A brief description of your application",
|
||||
Long: ``,
|
||||
// Uncomment the following line if your bare application
|
||||
// has an action associated with it:
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cmd.Help()
|
||||
slog.Info("Verbosity level", "level", verbose)
|
||||
slog.Info("Verbosity level", "level", config.Verbose)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -37,6 +32,10 @@ func Execute() {
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "c", "config file (default is $HOME/.config/kli.yaml)")
|
||||
rootCmd.PersistentFlags().CountVarP(&verbose, "verbose", "v", "increase verbosity (-v, -vv, -vvv)")
|
||||
rootCmd.PersistentFlags().StringVarP(&config.CfgFile, "config", "c", "/home/tpeetz/.config/kli.yaml", "config file")
|
||||
rootCmd.PersistentFlags().CountVarP(&config.Verbose, "verbose", "v", "increase verbosity (-v, -vv, -vvv)")
|
||||
viper.BindPFlag("config", rootCmd.PersistentFlags().Lookup("config"))
|
||||
exportCmd.Flags().StringVarP(&config.ServerName, "servername", "s", "local", "Define server to get Kontor items")
|
||||
viper.BindPFlag("server", exportCmd.PersistentFlags().Lookup("server"))
|
||||
cobra.OnInitialize(config.InitCliConfig)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user