3131// rootCmd represents the base command when called without any subcommands
3232var rootCmd = & cobra.Command {
3333 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/` ,
3936}
4037
4138// Execute adds all child commands to the root command and sets flags appropriately.
@@ -58,32 +55,11 @@ func init() {
5855 // will be global for your application.
5956
6057 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" )
8358}
8459
8560// initConfig reads in config file and ENV variables if set.
8661func initConfig () {
62+ // disabling it for now
8763 //viper.AutomaticEnv() // read in environment variables first to be overwritten by config
8864
8965 if cfgFile != "" {
@@ -96,7 +72,6 @@ func initConfig() {
9672 viper .AddConfigPath ("/etc/cses/" )
9773
9874 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
10075 }
10176
10277 // If a config file is found, read it in.
0 commit comments