int my_options(t_options *option, char **av, int ac, char **env) { int i; int j; i = 1; init_option(option); option->home = my_getpwd(env); while (i < ac) { j = 1; if (av[i][0] == '.') return (i); while (av[i][j] != '\0') { if (av[i][0] != '-') return (i); my_check_option(av[i][j], option); ++j; } if (j == 1) my_error_report(4); ++i; } return (-1); }
int prompt(char **env) { char *user; char *pwd; user = my_getuser(env); pwd = my_getpwd(env); if (user != NULL || pwd != NULL) { my_putstr(RED"("); if (user) my_putstr(user); if (pwd) { my_putstr("@"CYAN); my_putstr(pwd); } my_putstr(RED")"); } my_putstr(RED"->"DEFAULT); return (EXIT_SUCCESS); }