MCPcopy Create free account
hub / github.com/dolthub/doltgresql / parseArgs

Function parseArgs

cmd/doltgres/main.go:84–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82)
83
84func parseArgs() (flags map[string]*bool, params map[string]*string) {
85 flag.Usage = func() {
86 cli.Println("Usage: doltgres [options]")
87 cli.Println("Options:")
88 PrintDefaults(flag.CommandLine)
89 }
90
91 flags = make(map[string]*bool)
92 params = make(map[string]*string)
93
94 params[configParam] = flag.String(configParam, "", configHelpText)
95 params[dataDirParam] = flag.String(dataDirParam, "", dataDirHelpText)
96 params[chdirParam] = flag.String(chdirParam, "", "set the working directory for doltgres")
97 params[stdInParam] = flag.String(stdInParam, "", "file to use as stdin")
98 params[stdOutParam] = flag.String(stdOutParam, "", "file to use as stdout")
99 params[stdErrParam] = flag.String(stdErrParam, "", "file to use as stderr")
100 params[stdOutAndErrParam] = flag.String(stdOutAndErrParam, "", "file to use as stdout and stderr")
101
102 flags[versionFlag] = flag.Bool(versionFlag, false, "print the version")
103 flags[configHelpFlag] = flag.Bool(configHelpFlag, false, "print the config file help")
104
105 flag.Parse()
106
107 return flags, params
108}
109
110// PrintDefaults is modified from the flag package to control the order of printing
111func PrintDefaults(fs *flag.FlagSet) {

Callers 1

mainFunction · 0.85

Calls 4

PrintDefaultsFunction · 0.85
StringMethod · 0.65
BoolMethod · 0.45
ParseMethod · 0.45

Tested by

no test coverage detected