MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / our_args

Method our_args

tools/scripts/gdbext.py:110–134  ·  view source on GitHub ↗
(self, args_str, complete=False)

Source from the content-addressed store, hash-verified

108 return ValueError()
109
110 def our_args(self, args_str, complete=False):
111 cmd_name, cmd_desc, required_args, optional_args = self.our_info()
112 all_args = required_args + optional_args
113 args = args_str.split(' ')
114 if len(args) > len(all_args):
115 if complete:
116 return []
117 else:
118 self.our_error('Too many args')
119 if len(args) < len(required_args) and not complete:
120 self.our_error('Not enough args')
121 results = []
122 for i, (arg_name, arg_desc, arg_type, arg_cmp) in enumerate(all_args):
123 if complete:
124 if len(args) == i:
125 return arg_cmp
126 elif i < len(args):
127 arg = args[i]
128 try:
129 results.append(arg_type(arg))
130 except Exception as ex:
131 self.our_error(f'Issue with {arg_name} argument ({repr(arg)}): {ex}')
132 else:
133 break
134 return results
135
136 # TODO
137 # def complete(self, text, word):

Callers 1

invokeMethod · 0.95

Calls 5

our_infoMethod · 0.95
our_errorMethod · 0.95
lenFunction · 0.85
splitMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected