diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-11 18:07:48 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-11 18:07:48 +0200 |
commit | 32fb33b2dea95c00dc37efd14d34c799b23d09cf (patch) | |
tree | 0c4ad12af2a00f029aadf2ee50767e621be8ae03 | |
parent | alias utils prepared (diff) | |
download | 42-minishell-32fb33b2dea95c00dc37efd14d34c799b23d09cf.tar.gz 42-minishell-32fb33b2dea95c00dc37efd14d34c799b23d09cf.tar.bz2 42-minishell-32fb33b2dea95c00dc37efd14d34c799b23d09cf.tar.xz 42-minishell-32fb33b2dea95c00dc37efd14d34c799b23d09cf.tar.zst 42-minishell-32fb33b2dea95c00dc37efd14d34c799b23d09cf.zip |
In progress
-rw-r--r-- | src/b_alias.c | 19 | ||||
-rw-r--r-- | src/b_alias.h | 1 | ||||
-rw-r--r-- | src/e_builtins.c | 3 | ||||
-rw-r--r-- | src/m_loop.c | 1 |
4 files changed, 23 insertions, 1 deletions
diff --git a/src/b_alias.c b/src/b_alias.c index 6848b68..3b70a02 100644 --- a/src/b_alias.c +++ b/src/b_alias.c @@ -13,10 +13,29 @@ #include <stdint.h> #include "s_struct.h" +#include "u_utils.h" + +static void + b_print_alias_list(t_msh *msh) +{ + (void)msh; +} uint8_t b_alias(char *args[], t_msh *msh) { + const uint64_t argc = u_builtins_get_argc((const char**)args); + + if (argc == 0) + { + b_print_alias_list(msh); + } + return (0); +} + +uint8_t + b_alias_mute(char *args[], t_msh *msh) +{ (void)args; (void)msh; return (0); diff --git a/src/b_alias.h b/src/b_alias.h index a4aa1d8..2c80ffc 100644 --- a/src/b_alias.h +++ b/src/b_alias.h @@ -18,5 +18,6 @@ #include "s_struct.h" uint8_t b_alias(char *args[], t_msh *msh); +uint8_t b_alias_mute(char *args[], t_msh *msh); #endif diff --git a/src/e_builtins.c b/src/e_builtins.c index f4b363b..fb7b0ba 100644 --- a/src/e_builtins.c +++ b/src/e_builtins.c @@ -16,6 +16,7 @@ #include <stdint.h> #include <unistd.h> +#include "b_builtins.h" #include "b_export_next.h" #include "b_export_mute.h" #include "m_loop.h" @@ -76,6 +77,8 @@ static void b_export_mute(ptr->argv + 1, msh); else if (bu_id == FT_ID_UNSET) msh->bu_ptr[bu_id](ptr->argv + 1, msh); + else if (bu_id == FT_ID_ALIAS) + b_alias_mute(ptr->argv + 1, msh); else if (bu_id == FT_ID_EXIT) { if (msh->fd == STDIN_FILENO) diff --git a/src/m_loop.c b/src/m_loop.c index bd4fb1c..50357eb 100644 --- a/src/m_loop.c +++ b/src/m_loop.c @@ -26,7 +26,6 @@ #include "s_lpipes.h" #include "s_line.h" #include "u_vars.h" -#include "u_alias.h" static void m_parse_and_run_line(char line[], t_msh *msh) |