On 24/05/2021 14:34, John Snow wrote: > On 5/24/21 9:32 AM, Stefan Hajnoczi wrote: >> On Sat, May 22, 2021 at 12:32:00AM +0530, Niteesh G. S. wrote: > > Welcome Niteesh :) I look forward to working with you this summer. > >>> By end of this summer, I would like to get a basic TUI with some >>> desirable >>> features working. Some of the features I would like to get working are > > As a reminder to anyone reading this thread, the goal is to create a > qmp-shell that functions more as a TUI, akin to mutt, irssi, or (my > favorite example) mitmproxy. The idea is that there will be, at > minimum, a history panel showing QMP messages that have occurred so > far and a text entry panel for entering new commands. > > This shell can then be augmented with various other features to > facilitate testing, debugging, etc. One of the core upgrades over the > existing qmp-shell will be the featuring of truly asynchronous events > which will appear in the history panel without requiring the human > user to press to allow them to display. This will use a new > Asynchronous QMP library to facilitate this feature, bringing with it > fixes over our current use of undocumented Python features abusing > non-blocking sockets in the old QMP library. > > My plan is to worry about implementing the very basics of the shell > first, and then to add more features on as we feel comfortable with > the basics. We can discuss what we consider to be the bare minimum for > this project and lay out the feature requirements that define a > successful minimum. > >>> 1) Syntax checking > > To a limited extent. I don't want to disallow the user from sending > commands that are invalid in the event that we want to test the > server's ability to cope with and reply to invalid commands. > > However, if the syntax is malformed enough that we can't understand it > to send it to the server, good error messages that point out what > exactly went wrong are helpful. > I would actually suggest going the other way around. If there is a plan to test a server's ability to deal with invalid commands, it should be very obviously malformed, and when a user is trying to enter a command but has a small mistake (like a typo or something) telling the user that this was the likely mistake would make it more user-friendly. A way to implement this would be to calculate a "proximity" value to all likely commands, and if it is very far from all known commands you send it to test, if it is very close to one or more, you print some helpful information. Other option is that you always show the closest command, say there's a mistake, and ask if the command should be sent anyway, which is easier to implement, but is a worse UX. I admit this is pretty counter intuitive, but I think if it is well documented, it could be a better way to implement the feature -- Bruno Piazera Larsen Instituto de Pesquisas ELDORADO Departamento Computação Embarcada Analista de Software Trainee Aviso Legal - Disclaimer