Added ability to get authorization code

This commit is contained in:
David Allen 2024-02-21 20:26:25 -07:00
parent bfcbca9cf1
commit 5bae300daa
9 changed files with 174 additions and 48 deletions

View file

@ -7,7 +7,10 @@ import (
"github.com/spf13/cobra"
)
var configPath = ""
var (
configPath = ""
config Config
)
var rootCmd = &cobra.Command{
Use: "oidc",
Short: "An experimental OIDC helper tool for handling logins",
@ -18,11 +21,11 @@ var rootCmd = &cobra.Command{
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "Whoops. There was an error while executing your CLI '%s'", err)
fmt.Fprintf(os.Stderr, "failed to start CLI: %s", err)
os.Exit(1)
}
}
func init() {
rootCmd.Flags().StringVar(&configPath, "config", "", "set the config path")
rootCmd.PersistentFlags().StringVar(&configPath, "config", "", "set the config path")
}