open-vault/plugins/database/mysql/mysql-database-plugin/main.go
Calvin Leung Huang 3136fbb678 Fix flag parsing on database plugins, exit on parse error (#3305)
* Change FlagSet error handling to flag.ExitOnError

* Ignore os.Args[0] (the command itself) when parsing flags

* Revert to using flag.ContinueOnError
2017-09-07 16:30:00 -04:00

22 lines
364 B
Go

package main
import (
"log"
"os"
"github.com/hashicorp/vault/helper/pluginutil"
"github.com/hashicorp/vault/plugins/database/mysql"
)
func main() {
apiClientMeta := &pluginutil.APIClientMeta{}
flags := apiClientMeta.FlagSet()
flags.Parse(os.Args[1:])
err := mysql.Run(apiClientMeta.GetTLSConfig())
if err != nil {
log.Println(err)
os.Exit(1)
}
}