1234567891011121314151617181920212223242526272829303132333435363738 |
- package main
- import (
- "fmt"
- "os"
- "code.osinet.fr/fgm/kurz/translations"
- "code.osinet.fr/fgm/kurz/web/i18n"
- "github.com/spf13/cobra"
- "github.com/spf13/viper"
- )
- var cmd = &cobra.Command{
- Use: "kurzd",
- Short: "kurzd is the Kurz daemon and back-office command",
- Long: `kurzd is the actual engine for Kurz. Use it as the server for your Kurz clients.
- Configure it by copying dist.config.yml to ~/.kurz/config.yml and editing the copy.`,
- }
- var verbose bool
- func initConfig() {
- viper.SetConfigName("config")
- viper.AddConfigPath(".")
- viper.AddConfigPath("$HOME/.kurz")
- err := viper.ReadInConfig()
- if err != nil {
- fmt.Fprintln(os.Stderr, err)
- os.Exit(2)
- }
- }
- func init() {
- cobra.OnInitialize(initConfig)
- verbose = *cmd.PersistentFlags().BoolP("verbose", "v", false, "Add -v for verbose operation")
- translations.MustLoadMessages(i18n.Bundle)
- }
|