acb2a62da5
Routes Migrations Settings form Activation/deactivation through retailCRM/MG Transport API
33 lines
586 B
Go
33 lines
586 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/getsentry/raven-go"
|
|
"github.com/jessevdk/go-flags"
|
|
)
|
|
|
|
// Options struct
|
|
type Options struct {
|
|
Config string `short:"c" long:"config" default:"config.yml" description:"Path to configuration file"`
|
|
}
|
|
|
|
const transport = "mg-telegram"
|
|
|
|
var options Options
|
|
var parser = flags.NewParser(&options, flags.Default)
|
|
|
|
func init() {
|
|
raven.SetDSN(config.SentryDSN)
|
|
}
|
|
|
|
func main() {
|
|
if _, err := parser.Parse(); err != nil {
|
|
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp {
|
|
os.Exit(0)
|
|
} else {
|
|
os.Exit(1)
|
|
}
|
|
}
|
|
}
|