aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/run/builtin.rs17
-rw-r--r--src/run/mod.rs1
2 files changed, 18 insertions, 0 deletions
diff --git a/src/run/builtin.rs b/src/run/builtin.rs
index e715bd7..26f90ad 100644
--- a/src/run/builtin.rs
+++ b/src/run/builtin.rs
@@ -160,3 +160,20 @@ impl Builtin for builtins {
writeln!(stdout)
}
}
+
+pub struct history;
+impl Builtin for history {
+ fn name(&self) -> &str {
+ "history"
+ }
+
+ fn io(
+ &self,
+ _args: &[BString],
+ _stdin: &mut dyn Read,
+ stdout: &mut dyn Write,
+ ) -> std::io::Result<()> {
+ // TODO: add location & time to history to allow better querying
+ todo!("need session")
+ }
+}
diff --git a/src/run/mod.rs b/src/run/mod.rs
index e97c377..5cc8149 100644
--- a/src/run/mod.rs
+++ b/src/run/mod.rs
@@ -178,6 +178,7 @@ const BUILTINS: &[&'static dyn Builtin] = &[
&builtin::from,
&builtin::builtins,
&builtin::_type,
+ &builtin::history,
];
pub struct CommandDispatch {