blob: 1bbc80311224ccc2706c3f4da200cdc3a171ef22 [file] [log] [blame]
Denis Vlasenkobff06fe2008-10-19 17:47:31 +00001/* vi: set sw=4 ts=4: */
2/*
3 * Print UUIDs on all filesystems
4 *
5 * Copyright (C) 2008 Denys Vlasenko.
6 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02007 * Licensed under GPLv2, see file LICENSE in this source tree.
Denis Vlasenkobff06fe2008-10-19 17:47:31 +00008 */
9
Pere Orga5bc8c002011-04-11 03:29:49 +020010//usage:#define blkid_trivial_usage
Denys Vlasenko2f8ccc12011-12-06 15:09:27 +010011//usage: "[BLOCKDEV]..."
Pere Orga5bc8c002011-04-11 03:29:49 +020012//usage:#define blkid_full_usage "\n\n"
13//usage: "Print UUIDs of all filesystems"
14
Denis Vlasenkobff06fe2008-10-19 17:47:31 +000015#include "libbb.h"
16#include "volume_id.h"
17
Denis Vlasenkobff06fe2008-10-19 17:47:31 +000018int blkid_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Denys Vlasenko90615a02010-12-30 00:40:11 +010019int blkid_main(int argc UNUSED_PARAM, char **argv)
Denis Vlasenkobff06fe2008-10-19 17:47:31 +000020{
Denys Vlasenkoe8cfc3f2012-03-03 15:09:07 +010021 int scan_devices = 1;
22
Denys Vlasenko90615a02010-12-30 00:40:11 +010023 while (*++argv) {
24 /* Note: bogus device names don't cause any error messages */
25 add_to_uuid_cache(*argv);
Denys Vlasenkoe8cfc3f2012-03-03 15:09:07 +010026 scan_devices = 0;
Denys Vlasenko90615a02010-12-30 00:40:11 +010027 }
28
Denys Vlasenkoe8cfc3f2012-03-03 15:09:07 +010029 display_uuid_cache(scan_devices);
Denis Vlasenkobff06fe2008-10-19 17:47:31 +000030 return 0;
31}