From: Clifford Wolf Date: Mon, 2 Dec 2013 10:29:39 +0000 (+0100) Subject: Added "history" command X-Git-Tag: yosys-0.2.0~273 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=905eac04f1a16fcc54c92be87242a8a1e8922126;p=yosys.git Added "history" command --- diff --git a/kernel/driver.cc b/kernel/driver.cc index 6aa54bfb8..ce38f59e8 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -303,6 +303,24 @@ struct ShellPass : public Pass { } } ShellPass; +struct HistoryPass : public Pass { + HistoryPass() : Pass("history", "show last interactive commands") { } + virtual void help() { + log("\n"); + log(" history\n"); + log("\n"); + log("This command prints all commands in the shell history buffer. This are\n"); + log("all commands executed in an interactive session, but not the commands\n"); + log("from executed scripts.\n"); + log("\n"); + } + virtual void execute(std::vector args, RTLIL::Design *design) { + extra_args(args, 1, design, false); + for(HIST_ENTRY **list = history_list(); *list != NULL; list++) + log("%s\n", (*list)->line); + } +} HistoryPass; + struct ScriptPass : public Pass { ScriptPass() : Pass("script", "execute commands from script file") { } virtual void help() {