mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-17 04:20:59 +01:00
add custom bucket support
This commit is contained in:
committed by
T.v.Dein
parent
be79886e89
commit
3de65aa1c3
@@ -54,7 +54,7 @@ func Execute() {
|
||||
Short: "anydb",
|
||||
Long: `A personal key value store`,
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
db, err := app.New(conf.Dbfile, conf.Debug)
|
||||
db, err := app.New(conf.Dbfile, conf.Dbbucket, conf.Debug)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -92,6 +92,8 @@ func Execute() {
|
||||
rootCmd.PersistentFlags().BoolVarP(&conf.Debug, "debug", "d", false, "Enable debugging")
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.Dbfile, "dbfile", "f",
|
||||
filepath.Join(home, ".config", "anydb", "default.db"), "DB file to use")
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.Dbbucket, "bucket", "b",
|
||||
app.BucketData, "use other bucket (default: " + app.BucketData +")")
|
||||
|
||||
rootCmd.AddCommand(Set(&conf))
|
||||
rootCmd.AddCommand(List(&conf))
|
||||
|
||||
Reference in New Issue
Block a user