From fd3509de5c4e147252354e02fda2f2f6fae64e6d Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 11 Jul 2012 14:17:51 +0200 Subject: [PATCH] bugfix, candidates needs to recognize an input when it exactly matches --- sfa/client/candidates.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sfa/client/candidates.py b/sfa/client/candidates.py index a49f4429..f3a99ae3 100644 --- a/sfa/client/candidates.py +++ b/sfa/client/candidates.py @@ -9,13 +9,14 @@ class Candidates: # returns one of the names if the input name has a unique match # or None otherwise def only_match (self, input): + if input in self.names: return input matches=[ name for name in self.names if Candidates.fits(input,name) ] if len(matches)==1: return matches[0] else: return None #################### minimal test candidates_specs=[ -('create delete reset resources slices start status stop version', +('create delete reset resources slices start status stop version create_gid', [ ('ver','version'), ('r',None), ('re',None), @@ -28,6 +29,12 @@ candidates_specs=[ ('sta',None), ('stop','stop'), ('a',None), + ('cre',None), + ('create','create'), + ('create_','create_gid'), + ('create_g','create_gid'), + ('create_gi','create_gid'), + ('create_gid','create_gid'), ]) ] -- 2.47.0