MCPcopy Index your code
hub / github.com/dbcli/mycli / IntOrStringClickParamType

Class IntOrStringClickParamType

mycli/main.py:23–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class IntOrStringClickParamType(click.ParamType):
24 name = 'text' # display as TEXT in helpdoc
25
26 def convert(self, value, param, ctx):
27 if isinstance(value, int):
28 return value
29 elif isinstance(value, str):
30 return value
31 elif value is None:
32 return value
33 else:
34 self.fail('Not a valid password string', param, ctx)
35
36
37INT_OR_STRING_CLICK_TYPE = IntOrStringClickParamType()

Callers 1

main.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected