Signed-off-by: Sami Kerola <kerolasa@xxxxxx> --- sys-utils/eject.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys-utils/eject.c b/sys-utils/eject.c index 4f7d6e6..4e1d65f 100644 --- a/sys-utils/eject.c +++ b/sys-utils/eject.c @@ -202,12 +202,7 @@ static void parse_args(struct eject_control *ctl, int argc, char **argv) switch (c) { case 'a': ctl->a_option = 1; - if (!strcmp(optarg, "0") || !strcmp(optarg, "off")) - ctl->a_arg = 0; - else if (!strcmp(optarg, "1") || !strcmp(optarg, "on")) - ctl->a_arg = 1; - else - errx(EXIT_FAILURE, _("invalid argument to --auto/-a option")); + ctl->a_arg = parse_switch(optarg, "on", "off"); break; case 'c': ctl->c_option = 1; @@ -231,12 +226,7 @@ static void parse_args(struct eject_control *ctl, int argc, char **argv) break; case 'i': ctl->i_option = 1; - if (!strcmp(optarg, "0") || !strcmp(optarg, "off")) - ctl->i_arg = 0; - else if (!strcmp(optarg, "1") || !strcmp(optarg, "on")) - ctl->i_arg = 1; - else - errx(EXIT_FAILURE, _("invalid argument to --manualeject/-i option")); + ctl->i_arg = parse_switch(optarg, "on", "off"); break; case 'm': ctl->m_option = 1; -- 2.3.0 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html