Skip to content

Commit

Permalink
feat: Add video directories option
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeine-addictt committed Apr 7, 2024
1 parent 45745bb commit 78b3d54
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ var (
cfgFile string
verbose bool
debug bool

// Working Directory
workingDir string
)

// Root command
Expand All @@ -36,6 +39,15 @@ func init() {
// Verbosity
rootCommand.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Verbose output")
rootCommand.PersistentFlags().BoolVarP(&debug, "debug", "d", false, "Debug output")

// Working directory
rootCommand.PersistentFlags().StringVarP(&workingDir, "dir", "w", "~/Videos", "Working directory (default is ~/Videos)")
if err := viper.BindPFlag("dir", rootCommand.PersistentFlags().Lookup("dir")); err != nil {
fmt.Println("Failed to bind persistent flag 'dir'")
Debug(err.Error())
os.Exit(1)
}
viper.SetDefault("dir", "~/Videos")
}

func initConfig() {
Expand Down

0 comments on commit 78b3d54

Please sign in to comment.