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.
28 lines
861 B
28 lines
861 B
package com.example.datacollect.w9.command;
|
|
|
|
import com.example.datacollect.w9.model.Article;
|
|
import com.example.datacollect.w9.view.ConsoleView;
|
|
import java.util.List;
|
|
|
|
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, List<Article> articles) {
|
|
view.printInfo("=== 可用命令 ===");
|
|
System.out.println("help 显示帮助");
|
|
System.out.println("list 列出所有文章");
|
|
System.out.println("crawl <url> 爬取文章(或简写 c <url>)");
|
|
System.out.println("history 查看命令历史");
|
|
System.out.println("exit 退出程序");
|
|
}
|
|
}
|