MCPcopy Create free account
hub / github.com/dropbox/dbxcli / commandInputFlagDefault

Function commandInputFlagDefault

cmd/help_input_schema.go:164–185  ·  view source on GitHub ↗
(flag jsonCommandFlag, propertyType string)

Source from the content-addressed store, hash-verified

162}
163
164func commandInputFlagDefault(flag jsonCommandFlag, propertyType string) (any, bool) {
165 if flag.Default == "" {
166 return nil, false
167 }
168
169 switch propertyType {
170 case "boolean":
171 value, err := strconv.ParseBool(flag.Default)
172 if err != nil {
173 return nil, false
174 }
175 return value, true
176 case "integer":
177 value, err := strconv.ParseInt(flag.Default, 10, 64)
178 if err != nil {
179 return nil, false
180 }
181 return value, true
182 default:
183 return flag.Default, true
184 }
185}

Callers 1

commandInputSchemaForFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected