diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/all.h | 1 | ||||
| -rw-r--r-- | include/command/builtin.h | 3 | ||||
| -rw-r--r-- | include/global.h | 2 | ||||
| -rw-r--r-- | include/path.h | 9 | ||||
| -rw-r--r-- | include/util/prompt.h | 13 |
5 files changed, 23 insertions, 5 deletions
diff --git a/include/all.h b/include/all.h index 266735b..5141e37 100644 --- a/include/all.h +++ b/include/all.h @@ -2,6 +2,7 @@ #include "command/builtin.h" #include "util/io.h" +#include "util/prompt.h" #include "util/string.h" #include "eval.h" #include "global.h" diff --git a/include/command/builtin.h b/include/command/builtin.h index 49a8e13..cd58b14 100644 --- a/include/command/builtin.h +++ b/include/command/builtin.h @@ -9,6 +9,8 @@ #include <unordered_map> #include <functional> +#include "all.h" + namespace ov4 { @@ -26,5 +28,6 @@ void jobs(char **argv); void bg(char **argv); void fg(char **argv); void exit(char **argv); +void cd(char **argv); } diff --git a/include/global.h b/include/global.h index 5ff04f3..36fe3be 100644 --- a/include/global.h +++ b/include/global.h @@ -14,4 +14,6 @@ constexpr int MAXARGS = 128; constexpr bool GLOBAL_DEBUG = true; +constexpr std::string_view name = "ccshell"; + } diff --git a/include/path.h b/include/path.h index c4ea85c..06e5459 100644 --- a/include/path.h +++ b/include/path.h @@ -11,11 +11,10 @@ namespace ov4 { -extern std::string current_dir; - -std::string find_cmd(char* s); -std::string find_cmd(std::string s); -std::string set_current_dir(std::string s); +std::string find_cmd(const char* s); +std::string find_cmd(const std::string &s); std::string path_unifier(const std::string &s); +std::string get_current_dir(); +int set_current_dir(const std::string &s); } diff --git a/include/util/prompt.h b/include/util/prompt.h new file mode 100644 index 0000000..464156a --- /dev/null +++ b/include/util/prompt.h @@ -0,0 +1,13 @@ +#pragma once + +#include <iostream> + +#include "all.h" + +namespace ov4 +{ + constexpr std::string_view prompt = "$"; + extern bool emit_prompt; + + void print_prompt(); +} |
