Difference between revisions of "Unit Shell"
From Ultibo.org
(13 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '' | + | '''Ultibo Generic Shell unit''' |
=== Constants === | === Constants === | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell specific constants''' <code> SHELL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_LINE_END = Chr(13) + Chr(10); {CR LF}</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SHELL_DEFAULT_BANNER = 'Ultibo Core (Release: ' + ULTIBO_RELEASE_NAME + ' Version: ' + ULTIBO_RELEASE_VERSION + ' Date: ' + ULTIBO_RELEASE_DATE + ')';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_DEFAULT_PROMPT = '>';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_DEFAULT_ERROR = 'Huh?';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell flag''' <code> SHELL_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_FLAG_NONE = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SHELL_FLAG_CLEAR = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_FLAG_SIZE = $00000002;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_FLAG_CURSOR = $00000004;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_FLAG_COLORS = $00000008;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_FLAG_COORDINATES = $00000010;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell cursor mode''' <code> SHELL_CURSOR_MODE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_CURSOR_MODE_INSERT = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SHELL_CURSOR_MODE_OVERWRITE = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell cursor shape''' <code> SHELL_CURSOR_SHAPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_CURSOR_SHAPE_LINE = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SHELL_CURSOR_SHAPE_BAR = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_CURSOR_SHAPE_BLOCK = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell session flag''' <code> SHELL_SESSION_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_SESSION_FLAG_NONE = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell command flag''' <code> SHELL_COMMAND_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_FLAG_HIDDEN = $00000001;</code> | ||
+ | | Hidden command, do not show in HELP or INFO | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_FLAG_HELP = $00000002;</code> | ||
+ | | Command has HELP available | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_FLAG_INFO = $00000004;</code> | ||
+ | | Command has INFO available | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_FLAG_DEFAULT = $00000008;</code> | ||
+ | | Default command, pass unknown commands to this before showing error | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_FLAG_EXTENDED = $00000008;</code> | ||
+ | | Extended command, pass command name to command for extended handling | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_FLAG_COMPLETION = $00000008;</code> | ||
+ | | Command supports auto completion | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell alias flag''' <code> SHELL_ALIAS_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_ALIAS_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_ALIAS_FLAG_HIDDEN = $00000001;</code> | ||
+ | | Hidden alias, do not show in HELP or INFO | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell command''' <code> SHELL_COMMAND_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_HELP = 'HELP';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_INFO = 'INFO';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_VER = 'VER';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_TIME = 'TIME';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_CLS = 'CLS';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_RESTART = 'RESTART';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_SHUTDOWN = 'SHUTDOWN';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_CPU = 'CPU';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_UPTIME = 'UPTIME';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_WORKER = 'WORKER';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_THREAD = 'THREAD';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_MEMORY = 'MEMORY';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_COMMAND_DEVICE = 'DEVICE';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell alias''' <code> SHELL_ALIAS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_ALIAS_HELP = '?';</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SHELL_ALIAS_VERSION = 'VERSION';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_ALIAS_CLEAR = 'CLEAR';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHELL_ALIAS_REBOOT = 'REBOOT';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell history''' <code> SHELL_HISTORY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_HISTORY_MAX_COUNT = 100;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Shell logging''' <code> SHELL_LOG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHELL_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code> | ||
+ | | Shell debugging messages | ||
+ | |- | ||
+ | | <code>SHELL_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
+ | | Shell informational messages | ||
+ | |- | ||
+ | | <code>SHELL_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code> | ||
+ | | Shell warning messages | ||
+ | |- | ||
+ | | <code>SHELL_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
+ | | Shell error messages | ||
+ | |- | ||
+ | | <code>SHELL_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code> | ||
+ | | No Shell messages | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
+ | |||
+ | === Class definitions === | ||
+ | ---- | ||
+ | |||
+ | |||
+ | '''Shell specific classes | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellManager|<code>TShellManager = class(TObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShell|<code>TShell = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellSession|<code>TShellSession = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommand|<code>TShellCommand = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellAlias|<code>TShellAlias = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellHistory|<code>TShellHistory = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandHelp|<code>TShellCommandHelp = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandInfo|<code>TShellCommandInfo = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandVer|<code>TShellCommandVer = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandTime|<code>TShellCommandTime = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandClear|<code>TShellCommandClear = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandRestart|<code>TShellCommandRestart = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandShutdown|<code>TShellCommandShutdown = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandUptime|<code>TShellCommandUptime = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandThreads|<code>TShellCommandThreads = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandMemory|<code>TShellCommandMemory = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TShellCommandDevices|<code>TShellCommandDevices = class(TShellCommand)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | |
+ | '''Shell logging''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SHELL_DEFAULT_LOG_LEVEL:LongWord = SHELL_LOG_LEVEL_DEBUG;</code> | ||
+ | | style="width: 40%;"|Minimum level for Shell messages. Only messages with level greater than or equal to this will be printed. | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SHELL_LOG_ENABLED:Boolean;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Function declarations === | === Function declarations === | ||
Line 34: | Line 376: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! '''Note''' | + | ! Note |
− | | To be documented | + | | None documented |
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Shell functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ShellGetShell(APrevious:TShell; ALock,AUnlock:Boolean):TShell;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ShellFindShell(const AName:String):TShell;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ShellRegisterShell(AShell:TShell):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ShellDeregisterShell(AShell:TShell):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ShellGetCommand(APrevious:TShellCommand; ALock,AUnlock:Boolean):TShellCommand;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ShellFindCommand(const AName:String):TShellCommand;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ShellRegisterCommand(ACommand:TShellCommand):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ShellDeregisterCommand(ACommand:TShellCommand):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Shell helper functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ShellLog(Level:LongWord; const AText:String);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ShellLogInfo(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ShellLogWarn(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ShellLogError(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ShellLogDebug(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
|- | |- | ||
|} | |} |
Latest revision as of 04:43, 31 August 2021
Return to Unit Reference
Contents
Description
Ultibo Generic Shell unit
Constants
Shell specific constants
SHELL_*
SHELL_LINE_END = Chr(13) + Chr(10); {CR LF}
|
|
SHELL_DEFAULT_BANNER = 'Ultibo Core (Release: ' + ULTIBO_RELEASE_NAME + ' Version: ' + ULTIBO_RELEASE_VERSION + ' Date: ' + ULTIBO_RELEASE_DATE + ')';
|
|
SHELL_DEFAULT_PROMPT = '>';
|
|
SHELL_DEFAULT_ERROR = 'Huh?';
|
Shell flag
SHELL_FLAG_*
SHELL_FLAG_NONE = $00000000;
|
|
SHELL_FLAG_CLEAR = $00000001;
|
|
SHELL_FLAG_SIZE = $00000002;
|
|
SHELL_FLAG_CURSOR = $00000004;
|
|
SHELL_FLAG_COLORS = $00000008;
|
|
SHELL_FLAG_COORDINATES = $00000010;
|
Shell cursor mode
SHELL_CURSOR_MODE_*
SHELL_CURSOR_MODE_INSERT = 0;
|
|
SHELL_CURSOR_MODE_OVERWRITE = 1;
|
Shell cursor shape
SHELL_CURSOR_SHAPE_*
SHELL_CURSOR_SHAPE_LINE = 0;
|
|
SHELL_CURSOR_SHAPE_BAR = 1;
|
|
SHELL_CURSOR_SHAPE_BLOCK = 2;
|
Shell session flag
SHELL_SESSION_FLAG_*
SHELL_SESSION_FLAG_NONE = $00000000;
|
Shell command flag
SHELL_COMMAND_FLAG_*
SHELL_COMMAND_FLAG_NONE = $00000000;
|
|
SHELL_COMMAND_FLAG_HIDDEN = $00000001;
|
Hidden command, do not show in HELP or INFO |
SHELL_COMMAND_FLAG_HELP = $00000002;
|
Command has HELP available |
SHELL_COMMAND_FLAG_INFO = $00000004;
|
Command has INFO available |
SHELL_COMMAND_FLAG_DEFAULT = $00000008;
|
Default command, pass unknown commands to this before showing error |
SHELL_COMMAND_FLAG_EXTENDED = $00000008;
|
Extended command, pass command name to command for extended handling |
SHELL_COMMAND_FLAG_COMPLETION = $00000008;
|
Command supports auto completion |
Shell alias flag
SHELL_ALIAS_FLAG_*
SHELL_ALIAS_FLAG_NONE = $00000000;
|
|
SHELL_ALIAS_FLAG_HIDDEN = $00000001;
|
Hidden alias, do not show in HELP or INFO |
Shell command
SHELL_COMMAND_*
SHELL_COMMAND_HELP = 'HELP';
|
|
SHELL_COMMAND_INFO = 'INFO';
|
|
SHELL_COMMAND_VER = 'VER';
|
|
SHELL_COMMAND_TIME = 'TIME';
|
|
SHELL_COMMAND_CLS = 'CLS';
|
|
SHELL_COMMAND_RESTART = 'RESTART';
|
|
SHELL_COMMAND_SHUTDOWN = 'SHUTDOWN';
|
|
SHELL_COMMAND_CPU = 'CPU';
|
|
SHELL_COMMAND_UPTIME = 'UPTIME';
|
|
SHELL_COMMAND_WORKER = 'WORKER';
|
|
SHELL_COMMAND_THREAD = 'THREAD';
|
|
SHELL_COMMAND_MEMORY = 'MEMORY';
|
|
SHELL_COMMAND_DEVICE = 'DEVICE';
|
Shell alias
SHELL_ALIAS_*
SHELL_ALIAS_HELP = '?';
|
|
SHELL_ALIAS_VERSION = 'VERSION';
|
|
SHELL_ALIAS_CLEAR = 'CLEAR';
|
|
SHELL_ALIAS_REBOOT = 'REBOOT';
|
Shell history
SHELL_HISTORY_*
SHELL_HISTORY_MAX_COUNT = 100;
|
Shell logging
SHELL_LOG_*
SHELL_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;
|
Shell debugging messages |
SHELL_LOG_LEVEL_INFO = LOG_LEVEL_INFO;
|
Shell informational messages |
SHELL_LOG_LEVEL_WARN = LOG_LEVEL_WARN;
|
Shell warning messages |
SHELL_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;
|
Shell error messages |
SHELL_LOG_LEVEL_NONE = LOG_LEVEL_NONE;
|
No Shell messages |
Type definitions
None defined
Class definitions
Shell specific classes
TShellManager = class(TObject)
|
TShell = class(TListObject)
|
TShellSession = class(TListObject)
|
TShellCommand = class(TListObject)
|
TShellAlias = class(TListObject)
|
TShellHistory = class(TListObject)
|
TShellCommandHelp = class(TShellCommand)
|
TShellCommandInfo = class(TShellCommand)
|
TShellCommandVer = class(TShellCommand)
|
TShellCommandTime = class(TShellCommand)
|
TShellCommandClear = class(TShellCommand)
|
TShellCommandRestart = class(TShellCommand)
|
TShellCommandShutdown = class(TShellCommand)
|
TShellCommandUptime = class(TShellCommand)
|
TShellCommandThreads = class(TShellCommand)
|
TShellCommandMemory = class(TShellCommand)
|
TShellCommandDevices = class(TShellCommand)
|
Public variables
Shell logging
SHELL_DEFAULT_LOG_LEVEL:LongWord = SHELL_LOG_LEVEL_DEBUG;
|
Minimum level for Shell messages. Only messages with level greater than or equal to this will be printed. |
SHELL_LOG_ENABLED:Boolean;
|
Function declarations
Initialization functions
procedure ShellInit;
Description: To be documented
Note | None documented |
---|
Shell functions
function ShellGetShell(APrevious:TShell; ALock,AUnlock:Boolean):TShell;
Description: To be documented
Note | None documented |
---|
function ShellFindShell(const AName:String):TShell;
Description: To be documented
Note | None documented |
---|
function ShellRegisterShell(AShell:TShell):Boolean;
Description: To be documented
Note | None documented |
---|
function ShellDeregisterShell(AShell:TShell):Boolean;
Description: To be documented
Note | None documented |
---|
function ShellGetCommand(APrevious:TShellCommand; ALock,AUnlock:Boolean):TShellCommand;
Description: To be documented
Note | None documented |
---|
function ShellFindCommand(const AName:String):TShellCommand;
Description: To be documented
Note | None documented |
---|
function ShellRegisterCommand(ACommand:TShellCommand):Boolean;
Description: To be documented
Note | None documented |
---|
function ShellDeregisterCommand(ACommand:TShellCommand):Boolean;
Description: To be documented
Note | None documented |
---|
Shell helper functions
procedure ShellLog(Level:LongWord; const AText:String);
Description: To be documented
Note | None documented |
---|
procedure ShellLogInfo(const AText:String); inline;
Description: To be documented
Note | None documented |
---|
procedure ShellLogWarn(const AText:String); inline;
Description: To be documented
Note | None documented |
---|
procedure ShellLogError(const AText:String); inline;
Description: To be documented
Note | None documented |
---|
procedure ShellLogDebug(const AText:String); inline;
Description: To be documented
Note | None documented |
---|
Return to Unit Reference