X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fclient%2Fcandidates.py;h=f3a99ae3b7d2d7b49599555ccb7f7398792cb68c;hb=38a5b91de2913a5a5501b3b5a74ec01e3b3be3b7;hp=a49f44298093791ee22a7777368234d21f41306f;hpb=0a73fc72c8e96d5aee010efe3f31c29cfd2ccb13;p=sfa.git 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'), ]) ]