2025-03-11 15:59:59 +01:00
|
|
|
/* ************************************************************************** */
|
|
|
|
|
/* */
|
|
|
|
|
/* ::: :::::::: */
|
2025-03-18 14:55:58 +01:00
|
|
|
/* parse_cmdlist.c :+: :+: :+: */
|
2025-03-11 15:59:59 +01:00
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
|
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
|
/* Created: 2025/03/11 15:54:43 by khais #+# #+# */
|
2025-03-18 14:55:58 +01:00
|
|
|
/* Updated: 2025/03/18 15:05:39 by khais ### ########.fr */
|
2025-03-11 15:59:59 +01:00
|
|
|
/* */
|
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
2025-03-18 14:55:58 +01:00
|
|
|
#include "../src/parser/cmdlist/cmdlist.h"
|
2025-03-11 15:59:59 +01:00
|
|
|
#include "../src/parser/wordsplit/wordsplit.h"
|
|
|
|
|
#include "libft.h"
|
|
|
|
|
#include "unistd.h"
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
2025-03-18 14:55:58 +01:00
|
|
|
t_cmdlist *parse_cmdlist(char *input)
|
2025-03-11 15:59:59 +01:00
|
|
|
{
|
|
|
|
|
ft_dprintf(STDERR_FILENO, "Now checking command list with input [%s]\n", input);
|
|
|
|
|
t_wordlist *words = minishell_wordsplit(input);
|
|
|
|
|
t_cmdlist *cmd = cmdlist_from_wordlist(words);
|
|
|
|
|
wordlist_destroy(words);
|
|
|
|
|
return (cmd);
|
|
|
|
|
}
|