mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-17 04:20:59 +01:00
add list command, fix set command
This commit is contained in:
12
cmd/root.go
12
cmd/root.go
@@ -66,20 +66,26 @@ func Execute() {
|
||||
},
|
||||
}
|
||||
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// options
|
||||
rootCmd.PersistentFlags().BoolVarP(&ShowVersion, "version", "v", false, "Print program version")
|
||||
rootCmd.PersistentFlags().BoolVarP(&conf.Debug, "debug", "d", false, "Enable debugging")
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.Dbfile, "dbfile", "f", filepath.Join(os.Getenv("HOME"), ".config", "anydb", "default.db"), "DB file to use")
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.Dbfile, "dbfile", "f",
|
||||
filepath.Join(home, ".config", "anydb", "default.db"), "DB file to use")
|
||||
|
||||
rootCmd.AddCommand(Set(&conf))
|
||||
rootCmd.AddCommand(List(&conf))
|
||||
// rootCmd.AddCommand(Set(&conf))
|
||||
// rootCmd.AddCommand(Del(&conf))
|
||||
// rootCmd.AddCommand(List(&conf))
|
||||
// rootCmd.AddCommand(Find(&conf))
|
||||
// rootCmd.AddCommand(Help(&conf))
|
||||
// rootCmd.AddCommand(Man(&conf))
|
||||
|
||||
err := rootCmd.Execute()
|
||||
err = rootCmd.Execute()
|
||||
if err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user