def lookup(self, subcmd_prefix):
for subcmd_name in list(self.subcmds.keys()):<EOL><INDENT>if subcmd_name.startswith(subcmd_prefix)and len(subcmd_prefix) >=self.subcmds[subcmd_name].__class__.min_abbrev:<EOL><INDENT>return self.subcmds[subcmd_name]<EOL><DEDENT>pass<EOL><DEDENT>return None<EOL>
Find subcmd in self.subcmds