Context context = new Context();
context.set("SCOPE", "*");
context.set(SessionProperties.COMPLETION_MODE, "subshell");
CommandSessionHolder.setSession(context.getSession());
context.addCommand("*", new SimpleSubShell("foo"), "foo");
context.addCommand("*", new SimpleCommand(ExitAction.class), "exit");
context.addCommand("foo", new SimpleCommand(MyAction.class), "my-action");
context.addCommand("foo", new SimpleCommand(MyActionTwoArguments.class), "one-action");
context.addCommand("bar", new SimpleCommand(MyAction.class), "one-action");
context.addCommand("bar", new SimpleCommand(MyActionTwoArguments.class), "another");