btrfs-progs: set fixed with for printing uuids of subvolumes
authorDavid Sterba <dsterba@suse.com>
Mon, 2 Oct 2017 14:00:44 +0000 (16:00 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 6 Oct 2017 11:41:28 +0000 (13:41 +0200)
The tabular output format looks better if the empty uuids are aligned
with the other. In the list output (now default) it's not that nice but
the whole list format is not nice anyway.

Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-list.c

index 92a537f..b050bb6 100644 (file)
@@ -1340,21 +1340,21 @@ static void print_subvolume_column(struct root_info *subv,
                        strcpy(uuidparse, "-");
                else
                        uuid_unparse(subv->uuid, uuidparse);
-               printf("%s", uuidparse);
+               printf("%-36s", uuidparse);
                break;
        case BTRFS_LIST_PUUID:
                if (uuid_is_null(subv->puuid))
                        strcpy(uuidparse, "-");
                else
                        uuid_unparse(subv->puuid, uuidparse);
-               printf("%s", uuidparse);
+               printf("%-36s", uuidparse);
                break;
        case BTRFS_LIST_RUUID:
                if (uuid_is_null(subv->ruuid))
                        strcpy(uuidparse, "-");
                else
                        uuid_unparse(subv->ruuid, uuidparse);
-               printf("%s", uuidparse);
+               printf("%-36s", uuidparse);
                break;
        case BTRFS_LIST_PATH:
                BUG_ON(!subv->full_path);