File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -84,12 +84,12 @@ def downcase_hook(self, data: cmd2.plugin.PostparsingData) -> cmd2.plugin.Postpa
8484
8585 def abbrev_hook (self , data : cmd2 .plugin .PostparsingData ) -> cmd2 .plugin .PostparsingData :
8686 """Accept unique abbreviated commands"""
87- target = 'do_' + data .statement .command
88- if target not in dir ( self ) :
87+ func = self . cmd_func ( data .statement .command )
88+ if func is None :
8989 # check if the entered command might be an abbreviation
90- funcs = [func for func in self .keywords if func .startswith (data .statement .command )]
91- if len (funcs ) == 1 :
92- raw = data .statement .raw .replace (data .statement .command , funcs [0 ], 1 )
90+ possible_cmds = [cmd for cmd in self .keywords if cmd .startswith (data .statement .command )]
91+ if len (possible_cmds ) == 1 :
92+ raw = data .statement .raw .replace (data .statement .command , possible_cmds [0 ], 1 )
9393 data .statement = self .statement_parser .parse (raw )
9494 return data
9595
You can’t perform that action at this time.
0 commit comments