Implement session locking with --lock-session option

This commit is contained in:
Dan Sosedoff
2016-11-05 21:23:37 -05:00
parent 97b612c1b3
commit 20da36416c
6 changed files with 59 additions and 22 deletions

View File

@@ -7,6 +7,7 @@ import (
"os/signal"
"github.com/gin-gonic/gin"
"github.com/jessevdk/go-flags"
"github.com/sosedoff/pgweb/pkg/api"
"github.com/sosedoff/pgweb/pkg/client"
@@ -54,6 +55,12 @@ func initClient() {
func initOptions() {
err := command.ParseOptions()
if err != nil {
switch err.(type) {
case *flags.Error:
// no need to print error, flags package already does that
default:
fmt.Println(err.Error())
}
os.Exit(1)
}