give shortcode to --config

This commit is contained in:
Adora Laura Kalb 2023-07-06 07:02:46 +02:00
parent fa1f4388c5
commit 11768a682c
Signed by: adoralaura
GPG key ID: 7A4552166FC8C056
2 changed files with 6 additions and 2 deletions

6
.gitignore vendored
View file

@ -92,4 +92,8 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
/config.yaml
!examples/config.yaml
**/config.yaml
humble-bot
bin/

View file

@ -39,7 +39,7 @@ func Execute() {
func init() {
cobra.OnInitialize(initConfig, db.Initialize, log.InitializeLogger)
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $workingdir/config.yaml)")
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file (default is $workingdir/config.yaml)")
rootCmd.PersistentFlags().BoolVarP(&log.FlagDebug, "debug", "d", false, "enable debug logging")
// Cobra also supports local flags, which will only run