From: Lukas Jiriste Date: Fri, 26 Apr 2024 06:52:49 +0000 (+0200) Subject: Make help show when no fractal not specified X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=810b1f268fae64511b0f2b21de0d6d6cc170270c;p=42%2Ffract-ol.git Make help show when no fractal not specified As per the subject fractol should should behave as follows: "If no parameter is provided, or if the parameter is invalid, the program displays a list of available parameters and exits properly." --- diff --git a/src/main.c b/src/main.c index d083ea5..8825b3f 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/10/27 14:29:26 by ljiriste #+# #+# */ -/* Updated: 2024/04/25 15:45:14 by ljiriste ### ########.fr */ +/* Updated: 2024/04/26 08:52:24 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -216,7 +216,7 @@ void set_default(t_session *s) s->img.height = 1011; s->img.undersample_max = 5; s->set.detail = 1000; - s->view.fractal = mandelbrot; + s->view.fractal = NULL; s->view.palette = tri_color; s->view.color_shift_speed = -0.001; s->set.color_stability = 100; @@ -314,6 +314,8 @@ int parse_args(int argc, char **argv, t_session *s) return (1); ++i; } + if (!s->view.fractal) + return (1); init_view(s); return (0); } @@ -321,27 +323,27 @@ int parse_args(int argc, char **argv, t_session *s) static const char *help_str = "This is the help for fractol by Lukáš Jiřiště\n" "You can call the program as follows:\n\n" - "fractol [option value]\n" + "fractol -f [