mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-16 20:10:59 +01:00
- added man command - added unit tests - fixed import+export file parameters (now -o and -r respectively) - added README + License - added ci pipelines
40 lines
815 B
Go
40 lines
815 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"fmt"
|
|
"os"
|
|
"runtime"
|
|
|
|
"github.com/inconshreveable/mousetrap"
|
|
"github.com/tlinden/anydb/cmd"
|
|
)
|
|
|
|
func main() {
|
|
Main()
|
|
}
|
|
|
|
func Main() int {
|
|
cmd.Execute()
|
|
return 0
|
|
}
|
|
|
|
func init() {
|
|
// if we're running on Windows AND if the user double clicked the
|
|
// exe file from explorer, we tell them and then wait until any
|
|
// key has been hit, which will make the cmd window disappear and
|
|
// thus give the user time to read it.
|
|
if runtime.GOOS == "windows" {
|
|
if mousetrap.StartedByExplorer() {
|
|
fmt.Println("Please do no double click anydb.exe!")
|
|
fmt.Println("Please open a command shell and run it from there.")
|
|
fmt.Println()
|
|
fmt.Print("Press any key to quit: ")
|
|
_, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
}
|
|
}
|