MCPcopy Create free account
hub / github.com/cloudwan/gohan / handleCommonArguments

Method handleCommonArguments

cli/client/arguments.go:136–166  ·  view source on GitHub ↗
(args map[string]interface{})

Source from the content-addressed store, hash-verified

134}
135
136func (gohanClientCLI *GohanClientCLI) handleCommonArguments(args map[string]interface{}) error {
137 if outputFormatOpt, ok := args[outputFormatKey]; ok {
138 outputFormat, err := findOutputFormat(outputFormatOpt)
139 if err != nil {
140 return err
141 }
142 delete(args, outputFormatKey)
143 gohanClientCLI.opts.outputFormat = outputFormat
144 }
145
146 if verbosity, ok := args[logLevelKey]; ok {
147 logLevel, err := parseLogLevel(verbosity)
148 if err != nil {
149 return err
150 }
151 delete(args, logLevelKey)
152 gohanClientCLI.opts.logLevel = logLevel
153 setUpLogging(logLevel)
154 }
155
156 if fieldsOpt, ok := args[fieldsKey]; ok {
157 fields, err := findFields(fieldsOpt)
158 if err != nil {
159 return err
160 }
161 delete(args, fieldsKey)
162 gohanClientCLI.opts.fields = fields
163 }
164
165 return nil
166}
167
168func (gohanClientCLI *GohanClientCLI) handleRelationArguments(s *schema.Schema, args map[string]interface{}) (map[string]interface{}, error) {
169 parsedArgs := map[string]interface{}{}

Callers 3

getCustomArgsAsMapMethod · 0.95
handleArgumentsMethod · 0.95
arguments_test.goFile · 0.80

Calls 4

findOutputFormatFunction · 0.85
parseLogLevelFunction · 0.85
setUpLoggingFunction · 0.85
findFieldsFunction · 0.85

Tested by

no test coverage detected