Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: ttsubo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/03 12:50:38 by ttsubo #+# #+# */
/* Updated: 2025/04/25 18:16:36 by ttsubo ### ########.fr */
/* Updated: 2025/04/27 16:28:37 by ttsubo ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -36,6 +36,4 @@
# include <stdlib.h>
# include <unistd.h>

t_cmd *parse_command_line(char *line);

#endif
25 changes: 0 additions & 25 deletions src/debug.c

This file was deleted.

31 changes: 2 additions & 29 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,6 @@

#include "main.h"

/**
* @brief [debug] show cmds. Delete later
*
* @param tokens
*/
static void _dbg_show_cmd(t_cmd **cmds)
{
size_t cmd_i;
size_t arg_i;

cmd_i = 0;
printf("DEBUG: show cmds\n");
while (cmds[cmd_i])
{
arg_i = 0;
printf("cmd[%zu]\n", cmd_i);
printf("\tcmd->type=%d\n", cmds[cmd_i]->type);
printf("\tcmd->argc=%d\n", cmds[cmd_i]->argc);
printf("\tcmd->argv=[");
while (cmds[cmd_i]->argv[arg_i])
printf("%s,", cmds[cmd_i]->argv[arg_i++]);
printf("NULL]\n");
cmd_i++;
}
}

static void _free_tokens(char **tokens)
{
int i;
Expand All @@ -59,8 +33,8 @@ static void destroy_minish(t_minish *minish)
}

/**
* @brief I used the bool type because it seems to be available.
* @param program_nam
* @brief I used bool type since it seems to be available.
* @param program_name
* @param minish
* @return true
* @return false
Expand All @@ -87,7 +61,6 @@ static bool prompt(char *program_name, t_minish *minish, int *status)
}
if (cmds[0]->argc > 0)
*status = invoke_commands(cmds[0], minish);
_dbg_show_cmd(cmds);
_free_tokens(tokens);
free_cmds(cmds, cmds_len(cmds));
free(line);
Expand Down