Skip to content

Commit

Permalink
Show default config full path
Browse files Browse the repository at this point in the history
Signed-off-by: Masudur Rahman <[email protected]>
  • Loading branch information
masudur-rahman committed Feb 24, 2024
1 parent 7463095 commit 5ca8cf5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ limitations under the License.
package cmd

import (
"fmt"
"os"
"path/filepath"

"github.com/masudur-rahman/expense-tracker-bot/pkg"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -51,9 +55,7 @@ func init() {
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.

rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./configs/.expense-tracker.yaml)")
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.expense-tracker-bot.yaml)")
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", fmt.Sprintf("config file (default is %v)", filepath.Join(pkg.ProjectDirectory, "configs", ".expense-tracker.yaml")))

// Cobra also supports local flags, which will only run
// when this action is called directly.
Expand Down

0 comments on commit 5ca8cf5

Please sign in to comment.