psychogenic / SerialUI

A Serial User Interface for embedded devices, namely Arduinos.
48 stars 7 forks source link

Command completion #3

Open hameno opened 8 years ago

hameno commented 8 years ago

I think it would be a really great feature, if you could auto-complete the current command with tab-key or even only use the first X chars of a command (if it matches only one command) like e.g. Ciscos IOS CLI does.

psychogenic commented 8 years ago

Greets.

Well the tab-key completion is, I believe, impossible as many serial clients (e.g. the Arduino serial monitor) don't actually send the data until you hit enter.

However, the good news is that partial matches are already supported. That is if you have, say:

Then sending "en" (plus return) will match "enable". The caveat is that "st" matches both "start" and "stop", so whichever comes first (i.e. added first to the menu) will match. To ensure you get stop, then, you'd need at least 3 letters "sto".

FYI, I've been working on an update version of both SerialUI and druid which should be pretty rockin'... check back here or on the website in the next few weeks (yes, "the time between now and the end of the project tends to become constant", unfortunately).