Package net.thevpc.naru.ext.tools.sh
Class NaruSystemDirective
java.lang.Object
net.thevpc.naru.api.registry.NaruDirectiveBase
net.thevpc.naru.ext.tools.sh.NaruSystemDirective
- All Implemented Interfaces:
NaruDirective
Runs a shell command whose text is the raw directive argument (no NCmdLine
quoting). By default it captures the output, records everything in the
model-visible history and publishes the exit code as the task env var
lastExitCode (so script control-flow like /while can loop until a
command succeeds). The option --save <var> additionally stores the
trimmed captured output into the task env var var, so a script can
compare it directly (/if calc42 == "42") without a shell pipe.
Prefix the command with --no-grab to run it with
the terminal's stdin/stdout attached instead (e.g. an interactive editor like
vim): output is then not captured (lastExitCode is still published).-
Nested Class Summary
Nested classes/interfaces inherited from class net.thevpc.naru.api.registry.NaruDirectiveBase
NaruDirectiveBase.AbstractSubCommand, NaruDirectiveBase.SubCommand, NaruDirectiveBase.SubCommandHelp -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class net.thevpc.naru.api.registry.NaruDirectiveBase
addCandidates, execute, executeHelp, getAliases, getDescription, group, name, noCommand, noCommand, register, resolveCandidates, subCommand
-
Constructor Details
-
NaruSystemDirective
public NaruSystemDirective()
-