All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jvirtanen.philadelphia.client.command.ExitCommand Maven / Gradle / Ivy

The newest version!
package org.jvirtanen.philadelphia.client.command;

import java.util.Scanner;
import org.jvirtanen.philadelphia.client.TerminalClient;

class ExitCommand implements Command {

    @Override
    public void execute(TerminalClient client, Scanner arguments) throws CommandException {
        if (arguments.hasNext())
            throw new CommandException();

        client.close();
    }

    @Override
    public String getName() {
        return "exit";
    }

    @Override
    public String getDescription() {
        return "Exit the client";
    }

    @Override
    public String getUsage() {
        return "exit";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy