static const struct fdisk_column bsd_columns[] =
{
{ FDISK_COL_DEVICE, N_("Slice"), 1, 0 },
- { FDISK_COL_START, N_("Start"), 9, TT_FL_RIGHT },
- { FDISK_COL_END, N_("End"), 9, TT_FL_RIGHT },
- { FDISK_COL_SIZE, N_("Size"), 9, TT_FL_RIGHT },
+ { FDISK_COL_START, N_("Start"), 5, TT_FL_RIGHT },
+ { FDISK_COL_END, N_("End"), 5, TT_FL_RIGHT },
+ { FDISK_COL_SIZE, N_("Size"), 5, TT_FL_RIGHT },
+ { FDISK_COL_SECTORS, N_("Sectors"), 5, TT_FL_RIGHT },
+ { FDISK_COL_CYLINDERS, N_("Cylinders"), 5, TT_FL_RIGHT },
{ FDISK_COL_TYPE, N_("Type"), 8, 0 },
{ FDISK_COL_FSIZE, N_("Fsize"), 5, TT_FL_RIGHT },
{ FDISK_COL_BSIZE, N_("Bsize"), 5, TT_FL_RIGHT },
{ FDISK_COL_START, N_("Start"), 5, TT_FL_RIGHT },
{ FDISK_COL_END, N_("End"), 5, TT_FL_RIGHT },
{ FDISK_COL_SECTORS, N_("Sectors"), 5, TT_FL_RIGHT },
+ { FDISK_COL_CYLINDERS, N_("Cylinders"), 5, TT_FL_RIGHT },
{ FDISK_COL_SIZE, N_("Size"), 5, TT_FL_RIGHT, FDISK_COLFL_EYECANDY },
{ FDISK_COL_TYPEID, N_("Id"), 2, TT_FL_RIGHT },
{ FDISK_COL_TYPE, N_("Type"), 0.1, TT_FL_TRUNC },
{ FDISK_COL_START, N_("Start"), 5, TT_FL_RIGHT },
{ FDISK_COL_END, N_("End"), 5, TT_FL_RIGHT },
{ FDISK_COL_SECTORS, N_("Sectors"), 5, TT_FL_RIGHT },
+ { FDISK_COL_CYLINDERS, N_("Cylinders"), 5, TT_FL_RIGHT },
{ FDISK_COL_SIZE, N_("Size"), 5, TT_FL_RIGHT, FDISK_COLFL_EYECANDY },
{ FDISK_COL_TYPE, N_("Type"), 0.1, TT_FL_TRUNC, FDISK_COLFL_EYECANDY },
/* expert */
if (!c)
return -ENOMEM;
for (n = 0, i = 0; i < cxt->label->ncolumns; i++) {
+ int id = cxt->label->columns[i].id;
+
if (!all &&
((fdisk_context_display_details(cxt) &&
(cxt->label->columns[i].flags & FDISK_COLFL_EYECANDY))
|| (!fdisk_context_display_details(cxt) &&
- (cxt->label->columns[i].flags & FDISK_COLFL_DETAIL))))
+ (cxt->label->columns[i].flags & FDISK_COLFL_DETAIL))
+ || (id == FDISK_COL_SECTORS &&
+ fdisk_context_use_cylinders(cxt))
+ || (id == FDISK_COL_CYLINDERS &&
+ !fdisk_context_use_cylinders(cxt))))
continue;
- c[n++] = cxt->label->columns[i].id;
+
+ c[n++] = id;
}
if (cols)
*cols = c;
{ FDISK_COL_START, N_("Start"), 5, TT_FL_RIGHT },
{ FDISK_COL_END, N_("End"), 5, TT_FL_RIGHT },
{ FDISK_COL_SECTORS, N_("Sectors"), 5, TT_FL_RIGHT },
+ { FDISK_COL_CYLINDERS, N_("Cylinders"), 5, TT_FL_RIGHT },
{ FDISK_COL_SIZE, N_("Size"), 5, TT_FL_RIGHT, FDISK_COLFL_EYECANDY },
{ FDISK_COL_TYPEID, N_("Id"), 2, TT_FL_RIGHT },
{ FDISK_COL_TYPE, N_("Type"), 0.1, TT_FL_TRUNC, FDISK_COLFL_EYECANDY },
{ FDISK_COL_START, N_("Start"), 5, TT_FL_RIGHT },
{ FDISK_COL_END, N_("End"), 5, TT_FL_RIGHT },
{ FDISK_COL_SECTORS, N_("Sectors"), 5, TT_FL_RIGHT },
+ { FDISK_COL_CYLINDERS, N_("Cylinders"), 5, TT_FL_RIGHT },
{ FDISK_COL_SIZE, N_("Size"), 5, TT_FL_RIGHT },
{ FDISK_COL_TYPEID, N_("Id"), 2, TT_FL_RIGHT },
{ FDISK_COL_TYPE, N_("Type"), 0.1, TT_FL_TRUNC },
/* define columns */
for (j = 0; j < ncols; j++) {
col = fdisk_label_get_column(cxt->label, cols[j]);
- if (!col)
- continue;
- tt_define_column(tt,
- col->id == FDISK_COL_SECTORS &&
- fdisk_context_use_cylinders(cxt) ?
- _("Cylinders") : col->name,
- col->width, col->tt_flags);
+ if (col)
+ tt_define_column(tt, col->name, col->width, col->tt_flags);
}
fdisk_reset_iter(&itr, FDISK_ITER_FORWARD);