MainUsage prints cql base help
()
| 124 | |
| 125 | // MainUsage prints cql base help |
| 126 | func MainUsage() { |
| 127 | helpHead := `cql is a tool for managing CovenantSQL database. |
| 128 | |
| 129 | Usage: |
| 130 | |
| 131 | cql <command> [params] [arguments] |
| 132 | |
| 133 | The commands are: |
| 134 | |
| 135 | ` |
| 136 | helpCommon := ` |
| 137 | The common params for commands (except help and version) are: |
| 138 | |
| 139 | ` |
| 140 | helpDebug := ` |
| 141 | The debug params for commands (except help and version) are: |
| 142 | |
| 143 | ` |
| 144 | helpTail := ` |
| 145 | Use "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 | } |
no test coverage detected