export: handle simple cases

This commit is contained in:
Khaïs COLIN 2025-04-01 13:53:53 +02:00
parent b92aa33c4e
commit 299e016a27
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
6 changed files with 96 additions and 3 deletions

View file

@ -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);