December 2021
Intermediate to advanced
510 pages
11h 20m
English
Once the SQLite repository is available, you need to update the Pomo application to use it. Start by switching into the cmd directory:
| | $ cd $HOME/pragprog.com/rggo/persistentDataSQL/pomo/cmd |
Edit the file root.go to add a new command-line parameter that lets the user specify the database file to use. Bind that flag with viper so the user can set it in the configuration file as well:
| | func init() { |
| | cobra.OnInitialize(initConfig) |
| | |
| | rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", |
| | "config file (default is $HOME/.pomo.yaml)") |
| | |
| » | rootCmd.Flags().StringP("db", "d", "pomo.db", "Database file") |
| | |
| | rootCmd.Flags().DurationP( ... |
Read now
Unlock full access