summaryrefslogtreecommitdiff
path: root/commands/src/path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'commands/src/path.rs')
-rw-r--r--commands/src/path.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/commands/src/path.rs b/commands/src/path.rs
new file mode 100644
index 0000000..5ba0a9e
--- /dev/null
+++ b/commands/src/path.rs
@@ -0,0 +1,14 @@
+use alloc::format;
+use toolkit::Toolkit;
+use toolkit::error::*;
+use crate::parser::Command;
+
+pub fn run(mut tk: &mut Toolkit, command: Command) {
+ if command.names.len() == 1 {
+ tk.println(&format!("{}\n", tk.resolve_path(&command.names[0])));
+ } else if command.names.len() == 0 {
+ display_error(&mut tk, Error::E03);
+ } else if command.names.len() > 1 {
+ display_error(&mut tk, Error::E08);
+ }
+} \ No newline at end of file