31
31
// rootCmd represents the base command when called without any subcommands
32
32
var rootCmd = & cobra.Command {
33
33
Use : "cses-cli" ,
34
- Short : "A brief description of your application" ,
35
- Long : `A longer description` ,
36
- // Uncomment the following line if your bare application
37
- // has an action associated with it:
38
- // Run: func(cmd *cobra.Command, args []string) { },
34
+ Short : "command line to solve probmens from https://cses.fi/problemset/" ,
35
+ Long : `command line to solve probmens from https://cses.fi/problemset/` ,
39
36
}
40
37
41
38
// Execute adds all child commands to the root command and sets flags appropriately.
@@ -58,32 +55,11 @@ func init() {
58
55
// will be global for your application.
59
56
60
57
rootCmd .PersistentFlags ().StringVar (& cfgFile , "config" , "" , "config file (default is " + rootPath + "/config.*)" )
61
-
62
- //rootCmd.PersistentFlags().StringP("username","u", "", "username on cses")
63
- //err := viper.BindPFlag("username", rootCmd.PersistentFlags().Lookup("username"))
64
- //cobra.CheckErr(err)
65
-
66
- //rootCmd.PersistentFlags().StringP("csrf","t", "", "csrf token")
67
- //err := viper.BindPFlag("csrf", rootCmd.PersistentFlags().Lookup("csrf"))
68
- //cobra.CheckErr(err)
69
- //
70
- //rootCmd.PersistentFlags().StringP("cookie","c", "", "http cookie")
71
- //err = viper.BindPFlag("cookie", rootCmd.PersistentFlags().Lookup("cookie"))
72
- //cobra.CheckErr(err)
73
-
74
- //rootCmd.PersistentFlags().StringP("rootPath","p", rootPath, "path to store problem statements")
75
- //err = viper.BindPFlag("rootPath", rootCmd.PersistentFlags().Lookup("rootPath"))
76
- //cobra.CheckErr(err)
77
-
78
-
79
-
80
- // Cobra also supports local flags, which will only run
81
- // when this action is called directly.
82
- rootCmd .Flags ().BoolP ("toggle" , "o" , false , "Help message for toggle" )
83
58
}
84
59
85
60
// initConfig reads in config file and ENV variables if set.
86
61
func initConfig () {
62
+ // disabling it for now
87
63
//viper.AutomaticEnv() // read in environment variables first to be overwritten by config
88
64
89
65
if cfgFile != "" {
@@ -96,7 +72,6 @@ func initConfig() {
96
72
viper .AddConfigPath ("/etc/cses/" )
97
73
98
74
viper .SetConfigName ("config" ) // name of config file (without extension)
99
- viper .SetConfigType ("yaml" ) // REQUIRED if the config file does not have the extension in the name
100
75
}
101
76
102
77
// If a config file is found, read it in.
0 commit comments