2017-01-24 15:09:23 +00:00
|
|
|
package internal
|
|
|
|
|
2017-02-09 06:04:50 +00:00
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"os"
|
|
|
|
)
|
2017-01-24 15:09:23 +00:00
|
|
|
|
|
|
|
// FlagSet is the set of application flags.
|
2017-02-09 06:04:50 +00:00
|
|
|
var FlagSet = flag.NewFlagSet(os.Args[0], flag.ExitOnError)
|
2017-01-24 15:09:23 +00:00
|
|
|
|
|
|
|
// The application flags.
|
|
|
|
var (
|
|
|
|
FlagPkg = FlagSet.String("pkg", "github.com/knq/chromedp/cdp", "output package")
|
|
|
|
FlagFile = FlagSet.String("file", "protocol.json", "path to chrome protocol.json")
|
|
|
|
FlagDep = FlagSet.Bool("dep", false, "toggle deprecated API generation")
|
|
|
|
FlagExp = FlagSet.Bool("exp", true, "toggle experimental API generation")
|
|
|
|
FlagRedirect = FlagSet.Bool("redirect", false, "toggle redirect API generation")
|
|
|
|
FlagNoRemove = FlagSet.Bool("noremove", false, "toggle to not remove existing package directory")
|
|
|
|
)
|
|
|
|
|
|
|
|
// Prefix and suffix values.
|
|
|
|
var (
|
|
|
|
DomainTypePrefix = ""
|
|
|
|
DomainTypeSuffix = ""
|
|
|
|
TypePrefix = ""
|
|
|
|
TypeSuffix = ""
|
|
|
|
EventMethodPrefix = "Event"
|
|
|
|
EventMethodSuffix = ""
|
|
|
|
CommandMethodPrefix = "Command"
|
|
|
|
CommandMethodSuffix = ""
|
|
|
|
EventTypePrefix = "Event"
|
|
|
|
EventTypeSuffix = ""
|
|
|
|
CommandTypePrefix = ""
|
|
|
|
CommandTypeSuffix = "Params"
|
|
|
|
CommandReturnsPrefix = ""
|
|
|
|
CommandReturnsSuffix = "Returns"
|
|
|
|
OptionFuncPrefix = "With"
|
|
|
|
OptionFuncSuffix = ""
|
|
|
|
)
|