It should be fairly trivial to introduce a helper function in utils that evaluates any non-matching input against the keys from the FakeDevice[SupportedCommands] map. This would allow us to not have to have duplicate entries, but to simply search for any string with the most matches from the beginning of the line.
Psuedo-code:
func LongestMatch(input string, SupportedCommands slice) (matched bool, matched_command string):
for command in SupportedCommands:
\\ Do Regex to match start of string against user input
return (matched, matched_command)
It should be fairly trivial to introduce a helper function in utils that evaluates any non-matching input against the keys from the
FakeDevice[SupportedCommands]
map. This would allow us to not have to have duplicate entries, but to simply search for any string with the most matches from the beginning of the line.Psuedo-code: