You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -153,11 +156,50 @@ var ServerCmd = &cobra.Command{
153
156
},
154
157
}
155
158
159
+
typeflagSpecstruct {
160
+
namestring
161
+
shorthandstring
162
+
defaultValueany
163
+
usagestring
164
+
flagTypestring
165
+
}
166
+
167
+
const (
168
+
FlagType="type"
169
+
FlagPort="port"
170
+
FlagPrintOpenAPI="print-openapi"
171
+
FlagChatBasePath="chat-base-path"
172
+
FlagTermWidth="term-width"
173
+
FlagTermHeight="term-height"
174
+
)
175
+
156
176
funcinit() {
157
-
ServerCmd.Flags().StringVarP(&agentTypeVar, "type", "t", "", fmt.Sprintf("Override the agent type (one of: %s, custom)", strings.Join(agentNames, ", ")))
158
-
ServerCmd.Flags().IntVarP(&port, "port", "p", 3284, "Port to run the server on")
159
-
ServerCmd.Flags().BoolVarP(&printOpenAPI, "print-openapi", "P", false, "Print the OpenAPI schema to stdout and exit")
160
-
ServerCmd.Flags().StringVarP(&chatBasePath, "chat-base-path", "c", "/chat", "Base path for assets and routes used in the static files of the chat interface")
161
-
ServerCmd.Flags().Uint16VarP(&termWidth, "term-width", "W", 80, "Width of the emulated terminal")
162
-
ServerCmd.Flags().Uint16VarP(&termHeight, "term-height", "H", 1000, "Height of the emulated terminal")
177
+
flagSpecs:= []flagSpec{
178
+
{FlagType, "t", "", fmt.Sprintf("Override the agent type (one of: %s, custom)", strings.Join(agentNames, ", ")), "string"},
179
+
{FlagPort, "p", 3284, "Port to run the server on", "int"},
180
+
{FlagPrintOpenAPI, "P", false, "Print the OpenAPI schema to stdout and exit", "bool"},
181
+
{FlagChatBasePath, "c", "/chat", "Base path for assets and routes used in the static files of the chat interface", "string"},
182
+
{FlagTermWidth, "W", uint16(80), "Width of the emulated terminal", "uint16"},
183
+
{FlagTermHeight, "H", uint16(1000), "Height of the emulated terminal", "uint16"},
0 commit comments