topical media & game development
lib-js-terminal-parser-sample.htm / htm
<html>
<head>
<title>termlib Sample Parser</title>
<script language="JavaScript" type="text/javascript" src="lib-js-terminal-termlib.js"></script>
<script language="JavaScript" type="text/javascript" src="lib-js-terminal-termlib-parser.js"></script>
<script language="JavaScript" type="text/javascript">
<!--
/*
test sample for termlib.js and termlib_parser.js
(c) Norbert Landsteiner 2005
mass:werk - media environments
<http://www.masswerk.at>
*/
var term;
var helpPage=[
'\%CS%+r Terminal Help %-r\%n',
' This is just a sample to demonstrate command line parsing.',
' ',
' Use one of the following commands:',
' clear [-a] .......... clear the terminal',
' option "a" also removes the status line',
' number -n<value> .... return value of option "n" (test for options)',
' repeat -n<value> .... repeats the first argument n times (another test)',
' login <username> .... sample login (test for raw mode)',
' exit ................ close the terminal (same as <ESC>)',
' help ................ show this help page',
' ',
' other input will be echoed to the terminal as a list of parsed arguments',
' in the format <argument index> <quoting level> "<parsed value>".',
' '
];
function termOpen() {
if (!term) {
term=new Terminal(
{
x: 220,
y: 70,
termDiv: 'termDiv',
ps: '[guest]
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.