Commit Diff


commit - 9c5d8ecc060ea66ceddf6a38fb534a5d20b124c7
commit + bf0e646147ff63083225d5de296c849a0ed7607b
blob - 49ef289a0665d75471d727bc2a2a1b7cc9da2edd
blob + 6238bba72190c015d551b3e7f81b0c9d644e1c49
--- lsblk.8
+++ lsblk.8
@@ -15,7 +15,7 @@
 .SH NAME
 lsblk \- list block devices
 .SH SYNOPSIS
-.B lsblk [-Vlnu]
+.B lsblk [-Valnu]
 .SH DESCRIPTION
 The
 .B lsblk
@@ -25,6 +25,9 @@ utility can be used to examine block devices attached 
 .B \-V
 prints version information to stdout, then exit.
 .TP
+.B \-a
+print all fields.
+.TP
 .B \-l
 also print the label (packname) of each disk.
 .TP
blob - 7dca37ea4d6456dff08809004520e0dd4d1ae999
blob + 3b3d9c5531656b7a10905d542f166791bc46f6cd
--- lsblk.c
+++ lsblk.c
@@ -345,7 +345,7 @@ static struct my_diskinfo read_disk (const char *name)
 
 static int usage (void)
 {
-    fputs ("Usage: lsblk [-Vlnu]\n", stderr);
+    fputs ("Usage: lsblk [-Valnu]\n", stderr);
     return 1;
 }
 
@@ -361,17 +361,20 @@ int main (int argc, char *argv[])
     if (unveil (NULL, NULL) == -1)
         die ("unveil()");
 
-    while ((option = getopt (argc, argv, ":Vlnu")) != -1) {
+    while ((option = getopt (argc, argv, ":Valnu")) != -1) {
         switch (option) {
         case 'V':
             puts ("lsblk-" VERSION);
             return 0;
-        case 'n':
-            header = false;
+        case 'a':
+            fields = -1;
             break;
         case 'l':
             fields |= FIELD_LABEL;
             break;
+        case 'n':
+            header = false;
+            break;
         case 'u':
             fields |= FIELD_USED | FIELD_FREE;
             break;