Darius klein 716a65f019
All checks were successful
build and deploy kleinTodo / build (push) Successful in 15s
added register to client + fixed config bug + fixed register duplicate user bug
2026-01-11 21:05:37 +01:00

37 lines
624 B
Go

package config
import (
"bytes"
"context"
"fmt"
"github.com/BurntSushi/toml"
"github.com/urfave/cli/v3"
)
// GetConfig Command
func GetConfig() *cli.Command {
return &cli.Command{
Name: "get",
Usage: "read configuration file",
Action: getConfigAction,
}
}
// getConfigAction logic for GetConfig
func getConfigAction(context context.Context, c *cli.Command) error {
configFile, err := ReadConfig()
if err != nil {
return err
}
var buf bytes.Buffer
if err := toml.NewEncoder(&buf).Encode(configFile); err != nil {
return err
}
tomlString := buf.String()
fmt.Println(tomlString)
return nil
}