int main(int argc, char **argv) { if (argc == 1 || argv[0]) ft_list_dir(); if (argc > 1) ft_list_dir_a(); return (0); }
void printdir(char **files, char **dir, t_ls_options *opts, int i) { char **ret; if (*files || dir[1] != NULL || opts->files_nbr > 1) { ft_putstr(dir[i]); ft_putendl(":"); } ret = ft_list_dir(dir[i]); if (ret) { opt_sort(opts, dir[i], ret); ft_display_tab(dir[i], ret, opts, 1); if (dir[i + 1] != NULL) ft_putchar('\n'); } }