Print help when inputs don't make sense
authorLukas Jiriste <ljiriste@student.42prague.com>
Thu, 26 Sep 2024 09:00:46 +0000 (11:00 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Thu, 26 Sep 2024 09:14:11 +0000 (11:14 +0200)
philo/main.c

index c736ff6a0291bbe6dde8b75442b510c25df20b0e..1f9e9cb324e6627fe01ee819be6dda26d704a2c2 100644 (file)
@@ -121,6 +121,8 @@ int main(int argc, char **argv)
 
        if (parse_input(&diner.setting, argc, argv))
        {
+               printf("The usage is:\n\tphilo PHILO_COUNT TIME_TO_DIE "
+                       "TIME_TO_EAT TIME_TO_SLEEP [NUMBER_TO_BE_WELL_FED]\n");
                return (1);
        }
        if (init(&diner, &threads))