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
887 B
27 lines
887 B
package com.example.datacollect.command;
|
|
|
|
import com.example.datacollect.repository.ArticleRepository;
|
|
import com.example.datacollect.view.ConsoleView;
|
|
|
|
public class HelpCommand implements Command {
|
|
private final ConsoleView view;
|
|
|
|
public HelpCommand(ConsoleView view) {
|
|
this.view = view;
|
|
}
|
|
|
|
@Override
|
|
public String getName() {
|
|
return "help";
|
|
}
|
|
|
|
@Override
|
|
public void execute(String[] args, ArticleRepository repository) {
|
|
view.printInfo("可用命令:");
|
|
view.printInfo(" crawl <url> - 爬取指定URL的文章并保存");
|
|
view.printInfo(" analyze <url> - 分析指定URL(不保存数据)");
|
|
view.printInfo(" list - 列出已保存的文章");
|
|
view.printInfo(" help - 显示此帮助信息");
|
|
view.printInfo(" exit - 退出程序");
|
|
}
|
|
}
|