Skip to content

Commit bfb6c54

Browse files
committed
nilfs-{clean,resize}: fix duplicate option error output
These commands overlap the error messages output by getopt() or getopt_long() and the error messages output by themselves when invalid command line options are specified. Fix this issue by removing the own error message and printing the usage instructions instead. Signed-off-by: Ryusuke Konishi <[email protected]>
1 parent 26e6e7c commit bfb6c54

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sbin/nilfs-clean/nilfs-clean.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static void nilfs_clean_parse_options(int argc, char *argv[])
508508
show_version_only = 1;
509509
break;
510510
default:
511-
myprintf(_("Error: invalid option -- %c\n"), optopt);
511+
nilfs_clean_usage();
512512
exit(EXIT_FAILURE);
513513
}
514514
}

sbin/nilfs-resize/nilfs-resize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ static void nilfs_resize_parse_options(int argc, char *argv[])
16891689
show_version_only = 1;
16901690
break;
16911691
default:
1692-
errx("invalid option -- %c", optopt);
1692+
nilfs_resize_usage();
16931693
exit(EXIT_FAILURE);
16941694
}
16951695
}

0 commit comments

Comments
 (0)