aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-12-02 11:29:39 +0100
committerClifford Wolf <clifford@clifford.at>2013-12-02 11:29:39 +0100
commit905eac04f1a16fcc54c92be87242a8a1e8922126 (patch)
tree5d76952277c0ab65e492f55378ec2243d148cdce /kernel
parent97efc2ed5f5012ce2ee42a3abe2de3863e8259a6 (diff)
downloadyosys-905eac04f1a16fcc54c92be87242a8a1e8922126.tar.gz
yosys-905eac04f1a16fcc54c92be87242a8a1e8922126.tar.bz2
yosys-905eac04f1a16fcc54c92be87242a8a1e8922126.zip
Added "history" command
Diffstat (limited to 'kernel')
-rw-r--r--kernel/driver.cc18
1 files changed, 18 insertions, 0 deletions
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<std::string> 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() {