dd: code shrink
[oweals/busybox.git] / util-linux / blkid.c
index ec699d16750f3b13e520bd823835fc682bc01f6d..1bbc80311224ccc2706c3f4da200cdc3a171ef22 100644 (file)
@@ -4,15 +4,28 @@
  *
  * Copyright (C) 2008 Denys Vlasenko.
  *
- * Licensed under GPLv2, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2, see file LICENSE in this source tree.
  */
 
+//usage:#define blkid_trivial_usage
+//usage:       "[BLOCKDEV]..."
+//usage:#define blkid_full_usage "\n\n"
+//usage:       "Print UUIDs of all filesystems"
+
 #include "libbb.h"
 #include "volume_id.h"
 
 int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int blkid_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
+int blkid_main(int argc UNUSED_PARAM, char **argv)
 {
-       display_uuid_cache();
+       int scan_devices = 1;
+
+       while (*++argv) {
+               /* Note: bogus device names don't cause any error messages */
+               add_to_uuid_cache(*argv);
+               scan_devices = 0;
+       }
+
+       display_uuid_cache(scan_devices);
        return 0;
 }