alias

alias

Synopsis
alias prints all available aliases and corresponding classnames
alias <alias> <classname> creates an alias for a given classname
alias -r <alias> removes an existing alias
Details
The alias command creates a binding between a name (the alias) and the fully qualified Java name of the class that implements the command. When an alias is created, no attempt is made to check that the supplied Java class name denotes a suitable Java class. If the alias name is already in use, alias will update the binding.

If the classname argument is actually an existing alias name, the alias command will create a new alias that is bound to the same Java classname as the existing alias.

A command class (e.g. one whose name is given by an aliased classname) needs to implement an entry point method with one of the following signatures:

public void execute(CommandLine cmd, InputStream in, PrintStream out, PrintStream err);
This is the JNode preferred entry point. It allows stream redirection in any invoker / interpreter that supports this. In addition, the CommandLine object provides the alias and arguments in both String and Token form.
public static void main(String[] args);
This is the classic Java entry point signature. It does not allow the command class to find out the alias name that was used to invoke it. In JNode, this makes stream redirection problematic unless the command is executed in an isolate or a proclet.

If a command class has both execute and main methods, most invokers will use the former in preference to the latter. Ideally, a command class should extend org.jnode.shell.AbstractCommand.