mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 03:27:02 -07:00
Refactored and added client credentials flow
This commit is contained in:
parent
f912890a2d
commit
f490eb4fc4
9 changed files with 113 additions and 41 deletions
24
cmd/root.go
24
cmd/root.go
|
|
@ -21,6 +21,18 @@ var rootCmd = &cobra.Command{
|
|||
},
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "failed to start CLI: %s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
cobra.OnInitialize(initConfig)
|
||||
rootCmd.PersistentFlags().StringVar(&configPath, "config", "", "set the config path")
|
||||
}
|
||||
|
||||
func initConfig() {
|
||||
// load config if found or create a new one
|
||||
if configPath != "" {
|
||||
|
|
@ -35,15 +47,3 @@ func initConfig() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "failed to start CLI: %s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
cobra.OnInitialize(initConfig)
|
||||
rootCmd.PersistentFlags().StringVar(&configPath, "config", "", "set the config path")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue