func Show(menu *Menu) bool {
	copiedDatabase := menu.Configuration.Database
	if err := handleConfiguration(menu, true); err != nil {
		log.Print(err)
		return true
	}
	menu.Configuration.ParseFlags(menu.CliArguments)
	if copiedDatabase.Database != menu.Configuration.Database.Database ||
		copiedDatabase.KeyFile != menu.Configuration.Database.KeyFile ||
		copiedDatabase.Password != menu.Configuration.Database.Password {
		menu.Database.Loaded = false
		log.Printf("database configuration is changed, re-opening the database")
	}
	if !menu.Configuration.Flags.Daemon {
		if menu.Configuration.General.NoCache {
			menu.Database.Loaded = false
			log.Printf("no cache flag is set, re-opening the database")
		} else if (menu.CacheStart == time.Time{}) {
			menu.Database.Loaded = false
			log.Printf("cache start time not set, re-opening the database")
		} else {
			difference := int(time.Now().Sub(menu.CacheStart).Seconds())
			if difference < menu.Configuration.General.CacheTimeout {
				if !menu.Configuration.General.CacheOneTime {
					menu.CacheStart = time.Now()
				}
			} else {
				menu.Database.Loaded = false
				log.Printf("cache timed out, re-opening the database")
			}
		}
	}
	return Execute(menu)
}
Show checks if the database configuration is changed, if so it will re-open the database
returns true if the program should exit
package kpmenulib
import (
	"errors"
	"fmt"
	"log"
	"os/exec"
	"time"
)
const Version = "1.4.0"
func Initialize() *Menu {
	menu := NewMenu()
	if err := handleConfiguration(menu, false); err != nil {
		log.Fatal(err)
		return nil
	}
	if quit := handleCli(menu); quit == true {
		return nil
	}
	if !menu.Configuration.Flags.Daemon && !menu.Configuration.General.NoCache {
		menu.CacheStart = time.Now()
	}
	return menu
}
func Execute(menu *Menu) bool {
	if menu.Database.Loaded == false {
		if err := menu.OpenDatabase(); err != nil {
			log.Print(err)
			return err.Fatal
		}
	}
	if err := menu.OpenMenu(); err != nil {
		log.Print(err)
		return err.Fatal
	}
	return false
}