Martin Atkins (mart) wrote in lj_dev,
Martin Atkins
mart
lj_dev

Admin Console 'help' command, plus little fixes

This patch primarily adds a 'help' command to the admin console. This is of negligible benefit to people using the web-based interface, of course, and is mostly for those using either the console thingy in LogJam or ljsh, where loading a web browser to view the command reference might be inconvenient or annoying.

I'm not really keen on how I did the wrapping. I'd actually like it better if the admin console returned some kind of basic markup which each interface was free to format in any way desired, but as it is I had no alternative but to do the wrapping server-side as the client has no idea what data it's getting in order to decide whether to wrap it or not, and how to wrap it. I have a better plan for this, which I'll go into shortly. Text::Wrap should probably be loaded outside this subroutine...

It also fixes the spelling of "this" in one of the help texts, and makes the web-based interface to the console escape HTML and BML in the output, since my help command was returning the argsummary with its variables enclosed in pointy brackets thus making them vanish.

My 'better' plan to the wrapping is for an option in the console-calling thing to specify a preferred output width. This can then be wired into the protocol mode so clients can send some number (or in the case of ljsh, send the actual width of the terminal) and have textual output wrapped to that width where possible or relevant. A good default of 80 could be assumed if the client doesn't supply a value. This is more of a workaround than a plan, but never mind.

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 8 comments