@@ -224,6 +224,17 @@ public void run() {
224224 }
225225 }
226226
227+ private static class ReplSystemRegistry extends SystemRegistryImpl {
228+ public ReplSystemRegistry (Parser parser , Terminal terminal , Supplier <Path > workDir , ConfigurationPath configPath ) {
229+ super (parser , terminal , workDir , configPath );
230+ }
231+
232+ @ Override
233+ public boolean isCommandOrScript (String command ) {
234+ return command .startsWith ("!" ) || super .isCommandOrScript (command );
235+ }
236+ }
237+
227238 public static void main (String [] args ) {
228239 try {
229240 Supplier <Path > workDir = () -> Paths .get (System .getProperty ("user.dir" ));
@@ -264,7 +275,7 @@ public static void main(String[] args) {
264275 , workDir , configPath );
265276 Builtins builtins = new Builtins (workDir , configPath , (String fun )-> new ConsoleEngine .WidgetCreator (consoleEngine , fun ));
266277 MyCommands myCommands = new MyCommands (workDir );
267- SystemRegistryImpl systemRegistry = new SystemRegistryImpl (parser , terminal , workDir , configPath );
278+ ReplSystemRegistry systemRegistry = new ReplSystemRegistry (parser , terminal , workDir , configPath );
268279 systemRegistry .register ("groovy" , new GroovyCommand (scriptEngine , printer ));
269280 systemRegistry .setCommandRegistries (consoleEngine , builtins , myCommands );
270281 systemRegistry .addCompleter (scriptEngine .getScriptCompleter ());
0 commit comments