You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
550 B
27 lines
550 B
package com.cctv.news.command;
|
|
|
|
import com.cctv.news.view.OutputView;
|
|
|
|
public class ExitCommand implements Command {
|
|
private final OutputView view;
|
|
|
|
public ExitCommand(OutputView view) {
|
|
this.view = view;
|
|
}
|
|
|
|
@Override
|
|
public String getName() {
|
|
return "exit";
|
|
}
|
|
|
|
@Override
|
|
public String getHelp() {
|
|
return "exit - 退出程序";
|
|
}
|
|
|
|
@Override
|
|
public void execute(String[] args) {
|
|
view.showMessage("感谢使用央视新闻爬虫,再见!");
|
|
System.exit(0);
|
|
}
|
|
}
|
|
|