The longindex argument of getopt_long() is optional
and tied to the unused local variable option_index.
Remove it to shorten the four longest functions
and make the code neater.
Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Reviewed-by: Tomas Glozar <tglozar@redhat.com>
Link: https://lore.kernel.org/r/20251002123553.389467-2-costa.shul@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
{0, 0, 0, 0}
};
- /* getopt_long stores the option index here. */
- int option_index = 0;
-
c = getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:p:P:r:s:S:t::T:01234:5:6:7:",
- long_options, &option_index);
+ long_options, NULL);
/* detect the end of the options. */
if (c == -1)
{0, 0, 0, 0}
};
- /* getopt_long stores the option index here. */
- int option_index = 0;
-
c = getopt_long(argc, argv, "a:c:C::d:De:hH:p:P:qr:s:S:t::T:0:1:2:3:",
- long_options, &option_index);
+ long_options, NULL);
/* Detect the end of the options. */
if (c == -1)
{0, 0, 0, 0}
};
- /* getopt_long stores the option index here. */
- int option_index = 0;
-
c = getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:i:knp:P:s:t::T:uU0123456:7:8:9\1\2:\3:",
- long_options, &option_index);
+ long_options, NULL);
/* detect the end of the options. */
if (c == -1)
{0, 0, 0, 0}
};
- /* getopt_long stores the option index here. */
- int option_index = 0;
-
c = getopt_long(argc, argv, "a:c:C::d:De:hH:i:knp:P:qs:t::T:uU0:1:2:345:6:7:",
- long_options, &option_index);
+ long_options, NULL);
/* detect the end of the options. */
if (c == -1)