make a special case for print

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-12-13 00:26:17 +01:00
commit f95b9e1166
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -136,8 +136,6 @@ func main() {
})
defer DB.Close()
printDB()
if len(os.Args) < 2 {
fmt.Println("Usage: db <cmd> [args...]")
return
@ -186,6 +184,9 @@ func main() {
}
line, _ := GetFromDB(os.Args[2], os.Args[3])
fmt.Println(line)
case "print":
printDB()
os.Exit(1)
default:
fmt.Println("Unknown command:", cmd)
os.Exit(1)