public class Nsh extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ENV_HOME |
static String |
ENV_PATH |
protected NshContext |
rootContext |
public static final String ENV_PATH
public static final String ENV_HOME
protected NshContext rootContext
public Nsh()
public Nsh(NshConfig configuration)
public static void uninstallFromNuts()
public void addVarListener(NshVarListener listener)
public void removeVarListener(NshVarListener listener)
public NshVarListener[] getVarListeners()
public NshEvaluator getEvaluator()
public void setEvaluator(NshEvaluator evaluator)
public NshCommandTypeResolver getCommandTypeResolver()
public void setCommandTypeResolver(NshCommandTypeResolver whichResolver)
public NshExternalExecutor getExternalExecutor()
public void setExternalExecutor(NshExternalExecutor externalExecutor)
public NshErrorHandler getErrorHandler()
public void setErrorHandler(NshErrorHandler errorHandler)
protected NshContext createRootContext(String serviceName, String[] args)
public NshContext createNewContext(NshContext parentContext)
public NshContext createNewContext(NshContext ctx, String serviceName, String[] args)
public NshContext createInlineContext(NshContext ctx, String serviceName, String[] args)
public NshCommandNode createCommandNode(String[] args)
public NshContext getRootContext()
public void executeLine(String line, boolean storeResult, NshContext context)
public int onResult(int r,
NshContext context)
public int onResult(Throwable th, NshContext context)
public int onResult(int errorCode,
Throwable th,
NshContext context)
public int executeCommand(String[] command, NshContext context)
public void addToHistory(String[] command)
public int executePreparedCommand(String[] command, boolean considerAliases, boolean considerBuiltins, boolean considerExternal, NshContext context)
public void run()
protected String readInteractiveLine(NshContext context)
protected void printHeader(net.thevpc.nuts.io.NPrintStream out)
protected void executeHelp(NshContext context)
protected void executeVersion(NshContext context)
protected void executeInteractive(NshContext context)
protected void onQuit(NshQuitException quitException)
public int executeServiceFile(NshContext context, boolean ignoreIfNotFound)
public int executeServiceStream(NshContext context, String serviceName, InputStream stream)
public int executeScript(String text, NshContext context)
public int evalNode(NshCommandNode node, NshContext context)
public int safeEval(NshCommandNode n, NshContext context)
protected net.thevpc.nuts.text.NMsg getPromptString(NshContext context)
protected String getPromptString0(NshContext context)
public void prepareContext(NshContext context)
public NshScript parseScript(InputStream stream)
public void traceExecution(Supplier<String> msg, NshContext context)
public NshOptions getOptions()
public NshHistory getHistory()
public String getVersion()
public NshContext createContext(NshContext ctx, NshNode root, NshNode parent, NshVariables env, String serviceName, String[] args)
public void installToNuts()
Copyright © 2026 vpc open source initiative. All rights reserved.