Short:"Generate the documentation in `./doc/`. Directory must exist.",
Args:cobra.ExactArgs(0),
Hidden:true,
Run:func(cmd*cobra.Command,args[]string){
doc.GenMarkdownTree(rootCmd,"./doc/")
},
}
rootCmd.AddCommand(cmdDocGen)
/*usage*/
varcmdVersion=&cobra.Command{
Use:"version",
Short:"Display version and exit.",
Args:cobra.ExactArgs(0),
Hidden:true,
Run:func(cmd*cobra.Command,args[]string){
cwversion.Show()
},
}
rootCmd.AddCommand(cmdVersion)
//rootCmd.PersistentFlags().BoolVarP(&config.simulation, "simulate", "s", false, "No action; perform a simulation of events that would occur based on the current arguments.")
rootCmd.PersistentFlags().StringVarP(&config.configFolder,"config-dir","c","/etc/crowdsec/cscli/","Configuration directory to use.")
rootCmd.PersistentFlags().StringVarP(&config.output,"output","o","human","Output format : human, json, raw.")
rootCmd.PersistentFlags().BoolVar(&dbg_lvl,"debug",false,"Set logging to debug.")
rootCmd.PersistentFlags().BoolVar(&nfo_lvl,"info",false,"Set logging to info.")
rootCmd.PersistentFlags().BoolVar(&wrn_lvl,"warning",false,"Set logging to warning.")
rootCmd.PersistentFlags().BoolVar(&err_lvl,"error",false,"Set logging to error.")