tree debug: implement rest of tree debug

This is a big commit, sorry!
This commit is contained in:
Khaïs COLIN 2025-03-19 12:08:53 +01:00
parent 76b2b8ec7f
commit 1f03cbbedb
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
16 changed files with 190 additions and 159 deletions

View file

@ -6,12 +6,14 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/21 12:30:07 by khais #+# #+# */
/* Updated: 2025/02/21 12:51:07 by khais ### ########.fr */
/* Updated: 2025/03/19 14:28:36 by khais ### ########.fr */
/* */
/* ************************************************************************** */
#include "simple_cmd.h"
#include "libft.h"
#include "../../treedrawing.h"
#include "../../postprocess/redirections/redirection_list.h"
/*
** parse a wordlist and yield a simple command.
@ -36,3 +38,17 @@ void simple_cmd_destroy(t_simple_cmd *cmd)
wordlist_destroy(cmd->words);
free(cmd);
}
void simple_cmd_debug(t_simple_cmd *cmd, t_buffer *leader, bool is_last)
{
if (cmd == NULL)
return ;
indent(leader, is_last);
ft_printf("%s\n", "t_simple_cmd");
indent(leader, false);
ft_printf("words = ");
wordlist_debug(cmd->words);
dedent(leader, false);
redir_list_debug(cmd->redirections, leader, true);
dedent(leader, is_last);
}