1
0
peilaus alkaen https://github.com/quitesimpleorg/hs9001.git synced 2025-01-10 08:03:44 +01:00

Vertaa committeja

..

No commits in common. "e63ad28f74624db82031b8a5a691ae8850e8dd57" and "31973bd5dd5b4b261ae73609e9fa24f02eeea5e3" have entirely different histories.

13
main.go
Näytä tiedosto

@ -9,7 +9,6 @@ import (
"os"
"path/filepath"
"regexp"
"strings"
_ "modernc.org/sqlite"
)
@ -119,10 +118,6 @@ func exists(path string) (bool, error) {
return false, err
}
func printUsage() {
fmt.Fprintf(os.Stderr, "Usage: ./hs9001 <add/search/init/import>\n")
}
func main() {
var ret int
flag.IntVar(&ret, "ret", 0, "Return value of the command to add")
@ -131,7 +126,7 @@ func main() {
argslen := len(args)
if argslen < 1 {
printUsage()
fmt.Fprintf(os.Stderr, "Usage: ./hs9001 <add/search/init/import>\n")
return
}
@ -157,7 +152,7 @@ func main() {
if argslen < 2 {
fmt.Fprint(os.Stderr, "Please provide the search query\n")
}
q := strings.Join(args[1:], " ")
q := args[1]
search(conn, q)
os.Exit(23)
} else if cmd == "init" {
@ -168,9 +163,5 @@ func main() {
initDatabase(conn)
} else if cmd == "import" {
importFromStdin(conn)
} else {
fmt.Fprint(os.Stderr, "Error: Unknown command supplied\n\n")
printUsage()
return
}
}