diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.h | 2 | ||||
| -rw-r--r-- | src/main.c | 2 | ||||
| -rw-r--r-- | src/stages.h | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/config.h b/src/config.h index 31e8fa1..c1c8de2 100644 --- a/src/config.h +++ b/src/config.h @@ -1,3 +1,3 @@ #pragma once -static const char* rcfile = "scratch/.yrc"; +static const char* RCFILENAME= "scratch/.yrc"; @@ -4,6 +4,7 @@ #include <readline/history.h> #include <string.h> +#include "config.h" #include "syntax.h" #include "stages.h" #include "utils.h" @@ -18,6 +19,7 @@ void execute_line(char *line, ShellState *shstate) { int main() { ShellState shstate = {.shell_vars = make_KeyValMap(256), .aliases = make_KeyValMap(256)}; + source_script(RCFILENAME, &shstate); char* line; while (1) { line = readline("$ "); diff --git a/src/stages.h b/src/stages.h index 2f90a26..e731533 100644 --- a/src/stages.h +++ b/src/stages.h @@ -6,5 +6,5 @@ Ast lex(char* input); PipelineTree process_ast(Ast ast, ShellState* shstate); void execute_pipeline_tree(PipelineTree pltree, ShellState* shstate); -//void source_script(char* fname, ShellState* shstate); +void source_script(char* fname, ShellState* shstate); void execute_line(char* line, ShellState* shstate); |
