mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
cmdlist debug: tree debug printing (STUB)
This commit is contained in:
parent
131ba36d93
commit
47a61699ab
2 changed files with 21 additions and 4 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/03/11 15:18:02 by khais #+# #+# */
|
/* Created: 2025/03/11 15:18:02 by khais #+# #+# */
|
||||||
/* Updated: 2025/03/18 12:32:12 by khais ### ########.fr */
|
/* Updated: 2025/03/18 12:37:51 by khais ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -46,7 +46,6 @@ void cmdgroup_debug(t_cmdgroup *cmd, t_buffer **indent, bool is_last)
|
||||||
*indent = ft_buffer_push_buf(*indent, VERTICAL, TREEDRAW_LENGTH);
|
*indent = ft_buffer_push_buf(*indent, VERTICAL, TREEDRAW_LENGTH);
|
||||||
}
|
}
|
||||||
ft_printf("%s\n", "t_cmdgroup");
|
ft_printf("%s\n", "t_cmdgroup");
|
||||||
(void)cmd;
|
cmdlist_debug(&cmd->item, indent, false);
|
||||||
/* cmdlist_debug(cmd->item, indent, false); */
|
|
||||||
/* redirection_list_debug(cmd->redirections, indent, true); */
|
/* redirection_list_debug(cmd->redirections, indent, true); */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@
|
||||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/02/24 17:49:46 by khais #+# #+# */
|
/* Created: 2025/02/24 17:49:46 by khais #+# #+# */
|
||||||
/* Updated: 2025/03/18 15:02:38 by khais ### ########.fr */
|
/* Updated: 2025/03/18 15:08:30 by khais ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "cmdlist.h"
|
#include "cmdlist.h"
|
||||||
|
#include "../../treedrawing.h"
|
||||||
#include "cmdlist_item.h"
|
#include "cmdlist_item.h"
|
||||||
#include "cmdlist_builder.h"
|
#include "cmdlist_builder.h"
|
||||||
#include "cmdlist_item_type.h"
|
#include "cmdlist_item_type.h"
|
||||||
|
|
@ -116,3 +117,20 @@ void cmdlist_destroy(t_cmdlist *cmd)
|
||||||
free(cmd->operators);
|
free(cmd->operators);
|
||||||
free(cmd);
|
free(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmdlist_debug(t_cmdlist *cmd, t_buffer **indent, bool is_last)
|
||||||
|
{
|
||||||
|
ft_printf("%s", (*indent)->buffer);
|
||||||
|
if (is_last)
|
||||||
|
{
|
||||||
|
ft_printf("%s", CORNER);
|
||||||
|
*indent = ft_buffer_push_buf(*indent, SPACE, TREEDRAW_LENGTH);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ft_printf("%s", CROSS);
|
||||||
|
*indent = ft_buffer_push_buf(*indent, VERTICAL, TREEDRAW_LENGTH);
|
||||||
|
}
|
||||||
|
ft_printf("%s\n", "t_cmdlist");
|
||||||
|
(void)cmd; // TODO
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue