mirror of
https://github.com/sheumann/hush.git
synced 2025-02-28 20:31:33 +00:00
better check usage with options, correct show problem error message, indent
This commit is contained in:
parent
083d3f49c2
commit
54cb5c6af3
@ -45,11 +45,9 @@ extern int umount_main(int argc, char **argv)
|
||||
struct mtab_list *next;
|
||||
} *mtl, *m;
|
||||
|
||||
if(argc < 2) bb_show_usage();
|
||||
|
||||
/* Parse any options */
|
||||
|
||||
opt = bb_getopt_ulflags (argc, argv, "flaDnrv");
|
||||
opt = bb_getopt_ulflags (argc, argv, OPTION_STRING);
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
@ -76,7 +74,10 @@ extern int umount_main(int argc, char **argv)
|
||||
|
||||
/* If we're umounting all, then m points to the start of the list and
|
||||
* the argument list should be empty (which will match all). */
|
||||
if(!(opt & OPT_ALL)) m=0;
|
||||
if(!(opt & OPT_ALL)) {
|
||||
m=0;
|
||||
if(argc <= 0) bb_show_usage();
|
||||
}
|
||||
|
||||
// Loop through everything we're supposed to umount, and do so.
|
||||
for(;;) {
|
||||
@ -124,7 +125,7 @@ extern int umount_main(int argc, char **argv)
|
||||
if(ENABLE_FEATURE_MTAB_SUPPORT && !(opt & OPT_NO_MTAB) && m)
|
||||
erase_mtab(m->dir);
|
||||
status = EXIT_FAILURE;
|
||||
bb_perror_msg("Couldn't umount %s\n", path);
|
||||
bb_perror_msg("Couldn't umount %s", path);
|
||||
}
|
||||
// Find next matching mtab entry for -a or umount /dev
|
||||
while(m && (m = m->next))
|
||||
|
Loading…
x
Reference in New Issue
Block a user