Debug
Debug CLI module.
Main function is the CommandLine type which implements a simple command line for interactive session for the user.
- This supports the following operations:
Left and right key moves cursor
Delete or backspace delete left character
Enter execute command
Up and down arrow navigates command history
Example of use is found the uartcli demo.
Types
CommandLine* = RECORD
line- : ARRAY MaxLineLength OF CHAR;
history : ARRAY HistoryLength OF CHAR;
pos-, len-, hidx : LENGTH;
state : INTEGER;
quit* : BOOLEAN;
END;
Procedures
Init
Initialize CommandLine.
PROCEDURE Init*(VAR cmd : CommandLine);
CommandLine.WriteChar
Write char to screen. Must be implemented.
PROCEDURE (VAR this : CommandLine) WriteChar* (ch : CHAR);
CommandLine.WriteStr
Write string to screen.
PROCEDURE (VAR this : CommandLine) WriteStr* (str- : ARRAY OF CHAR);
CommandLine.Clear
Clear screen.
PROCEDURE (VAR this : CommandLine) Clear*;
CommandLine.Reset
Reset ANSI attributes.
PROCEDURE (VAR this : CommandLine) Reset*;
CommandLine.OnWelcome
Write welcome message to screen.
PROCEDURE (VAR this : CommandLine) OnWelcome*;
CommandLine.OnPrompt
Write prompt to screen.
PROCEDURE (VAR this : CommandLine) OnPrompt*;
CommandLine.OnCommand
Execute command. Return TRUE if a valid command.
PROCEDURE (VAR this : CommandLine) OnCommand* (): BOOLEAN;
CommandLine.ProcessChar
Process single input char.
PROCEDURE (VAR this : CommandLine) ProcessChar* (ch : CHAR);