[Top] [Prev] [Next]

sh

sh - command interface

Synopsis

include "sh.m";
Command: module
{
  PATH: con "/dis/sh.dis";
  init: fn(ctxt: ref Draw->Context, argv: list of string);
};

Description

A generic module interface appropriate for modules launched by the Inferno shell.
ctxt

The ctxt parameter is of type ref Draw->Context and can be used by graphical applications.

argv

The argv parameter is of type list of string. The Inferno shell constructs this list from the fields parsed from the user's response line to the command prompt. The module (command) being invoked (the leftmost field) is made the first accessible item of the list. The other fields are accessible in the order entered.

Any module (not just the Inferno shell) can launch a command-style module (specified by at run time by filename, the second operand to Limbo's load operator) by using this interface.

Example

  include "sh.m";
  cmd:= load Command filename;
  define ctxt
  construct argv with module name at top of the list
  cmd->init(ctxt, argv);

Caveat

The usual convention of using ModuleType ->PATH at load time is inappropriate in this case.



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.