1 ### utility to match command-line args to names
3 def __init__ (self, names):
5 # is an input string acceptable for one of the known names?
7 def fits (input, name):
8 return name.find(input)==0
9 # returns one of the names if the input name has a unique match
11 def only_match (self, input):
12 matches=[ name for name in self.names if Candidates.fits(input,name) ]
13 if len(matches)==1: return matches[0]