mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-17 04:20:59 +01:00
Feature/vhs demo (#15)
* add vhs made demo gif * add support for ANYDB_DB env var * left one section * fixed data type bug, added demo gifs, upgraded dependencies --------- Co-authored-by: Thomas von Dein <tom@vondein.org>
This commit is contained in:
@@ -118,12 +118,12 @@ func Get(conf *cfg.Config) *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
clear, err := app.Decrypt(pass, entry.Value)
|
||||
clear, err := app.Decrypt(pass, []byte(entry.Value))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
entry.Value = clear
|
||||
entry.Value = string(clear)
|
||||
entry.Encrypted = false
|
||||
}
|
||||
|
||||
|
||||
@@ -216,12 +216,12 @@ func Edit(conf *cfg.Config) *cobra.Command {
|
||||
}
|
||||
password = pass
|
||||
|
||||
clear, err := app.Decrypt(pass, entry.Value)
|
||||
clear, err := app.Decrypt(pass, []byte(entry.Value))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
entry.Value = clear
|
||||
entry.Value = string(clear)
|
||||
entry.Encrypted = false
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,9 @@ 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.Dbbucket, conf.Debug)
|
||||
dbfile := app.GetDbFile(conf.Dbfile)
|
||||
|
||||
db, err := app.New(dbfile, conf.Dbbucket, conf.Debug)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -114,7 +116,7 @@ func Execute() {
|
||||
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(home, ".config", "anydb", "default.db"), "DB file to use")
|
||||
"", "DB file to use (default: ~/.config/anydb/default.db)")
|
||||
rootCmd.PersistentFlags().StringVarP(&conf.Dbbucket, "bucket", "b",
|
||||
app.BucketData, "use other bucket (default: "+app.BucketData+")")
|
||||
rootCmd.PersistentFlags().StringVarP(&configfile, "config", "c", "", "toml config file")
|
||||
|
||||
Reference in New Issue
Block a user