CLI: Allow running a single command non-interactively
Added the possibility to pass to cli.jar a command, which it runs instead of taking commands interactively. Note that the initialization script is run before the given command. After this patch, scripts/run.py -e "java.so -jar /java/cli.jar" Continues to run the interactive command line editor loop, as before. But additionally, one can do: scripts/run.py -e "java.so -jar /java/cli.jar ls" To run just the command "ls" and exit - exactly as if the user would type this command on the command line and exit the VM. The given command can be, of course, much longer. For example to run Jetty after the CLI's normal initialization script, the following monster can be used: scripts/run.py -n -e "java.so -jar /java/cli.jar java -classpath /jetty/* org.eclipse.jetty.xml.XmlConfiguration /jetty/jetty.xml" (Funny how a single command should say "java" 3 times and "jetty" 4 times :-))
Loading
Please register or sign in to comment