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.
30 lines
741 B
30 lines
741 B
package com.cctv.news.command;
|
|
|
|
import com.cctv.news.view.OutputView;
|
|
|
|
public class HelpCommand implements Command {
|
|
private final OutputView view;
|
|
|
|
public HelpCommand(OutputView view) {
|
|
this.view = view;
|
|
}
|
|
|
|
@Override
|
|
public String getName() {
|
|
return "help";
|
|
}
|
|
|
|
@Override
|
|
public String getHelp() {
|
|
return "help - 显示帮助信息";
|
|
}
|
|
|
|
@Override
|
|
public void execute(String[] args) {
|
|
view.showMessage("可用命令:");
|
|
view.showMessage(" help - 显示帮助信息");
|
|
view.showMessage(" list - 显示已抓取的文章列表");
|
|
view.showMessage(" crawl - 爬取央视新闻");
|
|
view.showMessage(" exit - 退出程序");
|
|
}
|
|
}
|
|
|