MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / MainUsage

Function MainUsage

cmd/cql/internal/help.go:126–169  ·  view source on GitHub ↗

MainUsage prints cql base help

()

Source from the content-addressed store, hash-verified

124
125// MainUsage prints cql base help
126func MainUsage() {
127 helpHead := `cql is a tool for managing CovenantSQL database.
128
129Usage:
130
131 cql <command> [params] [arguments]
132
133The commands are:
134
135`
136 helpCommon := `
137The common params for commands (except help and version) are:
138
139`
140 helpDebug := `
141The debug params for commands (except help and version) are:
142
143`
144 helpTail := `
145Use "cql help <command>" for more information about a command.
146`
147
148 output := bytes.NewBuffer(nil)
149 output.WriteString(helpHead)
150 for _, cmd := range CqlCommands {
151 if cmd.Name() == "help" {
152 continue
153 }
154 fmt.Fprintf(output, "\t%-10s\t%s\n", cmd.Name(), cmd.Short)
155 }
156
157 addCommonFlags(CmdHelp)
158 addConfigFlag(CmdHelp)
159 fmt.Fprint(output, helpCommon)
160 CmdHelp.CommonFlag.SetOutput(output)
161 CmdHelp.CommonFlag.PrintDefaults()
162 fmt.Fprint(output, helpDebug)
163 CmdHelp.DebugFlag.SetOutput(output)
164 CmdHelp.DebugFlag.PrintDefaults()
165
166 fmt.Fprint(output, helpTail)
167 fmt.Fprintf(os.Stdout, output.String())
168 Exit()
169}

Callers 2

mainFunction · 0.92
runHelpFunction · 0.85

Calls 5

addCommonFlagsFunction · 0.85
addConfigFlagFunction · 0.85
ExitFunction · 0.85
NameMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected