mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
export: handle simple cases
This commit is contained in:
parent
b92aa33c4e
commit
299e016a27
6 changed files with 96 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/27 16:21:56 by khais #+# #+# */
|
||||
/* Updated: 2025/03/31 16:20:46 by khais ### ########.fr */
|
||||
/* Updated: 2025/04/01 14:00:15 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -48,6 +48,8 @@ static t_builtin_type get_builtin(t_simple_cmd *cmd)
|
|||
return (BUILTIN_PWD);
|
||||
if (ft_strcmp("cd", word) == 0)
|
||||
return (BUILTIN_CD);
|
||||
if (ft_strcmp("export", word) == 0)
|
||||
return (BUILTIN_EXPORT);
|
||||
return (BUILTIN_INVALID);
|
||||
}
|
||||
|
||||
|
|
@ -58,6 +60,7 @@ static t_builtin_type execute_builtin(t_simple_cmd *cmd, t_minishell *app)
|
|||
[BUILTIN_INVALID] = builtin_invalid,
|
||||
[BUILTIN_PWD] = builtin_pwd,
|
||||
[BUILTIN_CD] = builtin_cd,
|
||||
[BUILTIN_EXPORT] = builtin_export,
|
||||
};
|
||||
|
||||
type = get_builtin(cmd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue