-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharg_printer.c
40 lines (37 loc) · 1.31 KB
/
arg_printer.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* arg_printer.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: olgerret <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/04 17:30:58 by olgerret #+# #+# */
/* Updated: 2021/12/04 17:30:59 by olgerret ### ########.fr */
/* */
/* ************************************************************************** */
#include "./includes/ft_minishell.h"
/*
Prints all the elements in a given char
array array
*/
void ft_arg_printer(char **args)
{
int i;
int counter;
int args_count;
i = 0;
counter = 0;
if (!args)
{
printf(" NO ARGS IN THIS COMMAND!\n");
return ;
}
args_count = ft_array_len(args);
while (args[i])
{
printf(" %s( ARG %d/%d )%s |%s|\n", YELLOW_COLOR,
(counter + 1), args_count, RESET_COLOR, args[i]);
i++;
counter++;
}
}