Package restx.shell

Examples of restx.shell.ShellCommandRunner


                    return Optional.absent();
                }

                final String to = args.get(1);

                return Optional.of(new ShellCommandRunner() {
                    @Override
                    public void run(RestxShell shell) throws Exception {
                        shell.cd(shell.currentLocation().resolve(to));
                    }
                });
View Full Code Here


    @Provides public ShellCommand pwd() {
        return new StdShellCommand(ImmutableList.of("pwd"), "print current directory") {
            @Override
            protected Optional<? extends ShellCommandRunner> doMatch(String line) {
                return Optional.of(new ShellCommandRunner() {
                    @Override
                    public void run(RestxShell shell) throws Exception {
                        shell.println(shell.currentLocation().toAbsolutePath().toString());
                    }
                });
View Full Code Here

    @Provides public ShellCommand ls() {
        return new StdShellCommand(ImmutableList.of("ls"), "print current directory content") {
            @Override
            protected Optional<? extends ShellCommandRunner> doMatch(String line) {
                return Optional.of(new ShellCommandRunner() {
                    @Override
                    public void run(RestxShell shell) throws Exception {
                        File currentDir = shell.currentLocation().toFile();
                        if (currentDir != null) {
                            if (currentDir.isDirectory()) {
View Full Code Here

        super(ImmutableList.of("exit", "quit"), "exits the shell");
    }

    @Override
    protected Optional<? extends ShellCommandRunner> doMatch(String line) {
        return Optional.of(new ShellCommandRunner() {
            @Override
            public void run(RestxShell shell) throws IOException {
                throw new RestxShell.ExitShell();
            }
        });
View Full Code Here

    @Override
    protected Optional<? extends ShellCommandRunner> doMatch(String line) {
        final List<String> args = splitArgs(line);
        if (args.size() > 1) {
            return Optional.of(new ShellCommandRunner() {
                @Override
                public void run(RestxShell shell) throws IOException {
                    man(shell, args.get(1));
                }
            });
        } else {
            return Optional.of(new ShellCommandRunner() {
                @Override
                public void run(RestxShell shell) throws IOException {
                    for (ShellCommand command : commands) {
                        command.help(shell);
                    }
View Full Code Here

TOP

Related Classes of restx.shell.ShellCommandRunner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.