You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
/*
|
|
* This file is part of the keycloak-import-realm distribution
|
|
* (https://github.com/nmasse-itix/keycloak-import-realm).
|
|
* Copyright (c) 2021 Nicolas Massé <nicolas.masse@itix.fr>.
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, version 3.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
// getCmd represents the get command
|
|
var getCmd = &cobra.Command{
|
|
Use: "get",
|
|
Short: "Show current configuration",
|
|
Long: `TODO`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
if len(args) != 1 {
|
|
logger.Println("No configuration key specified")
|
|
logger.Println()
|
|
cmd.Help()
|
|
return
|
|
}
|
|
|
|
fmt.Println(viper.Get(args[0]))
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
configCmd.AddCommand(getCmd)
|
|
}
|
|
|