diff options
author | Karel Zak | 2011-05-10 12:06:39 +0200 |
---|---|---|
committer | Karel Zak | 2011-05-10 12:06:39 +0200 |
commit | b152e3595cfa0046f374a555066b654692a4c8ba (patch) | |
tree | 0e1c91c17afe2421c285cd0bf5ef6dbe42ba8e35 /misc-utils/findmnt.c | |
parent | partx: add --pairs to output in key="value" format (diff) | |
download | kernel-qcow2-util-linux-b152e3595cfa0046f374a555066b654692a4c8ba.tar.gz kernel-qcow2-util-linux-b152e3595cfa0046f374a555066b654692a4c8ba.tar.xz kernel-qcow2-util-linux-b152e3595cfa0046f374a555066b654692a4c8ba.zip |
findmnt: add columns description to the --help output
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/findmnt.c')
-rw-r--r-- | misc-utils/findmnt.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 4b5e47d60..0df10a8a4 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -75,23 +75,24 @@ struct colinfo { const char *name; /* header */ double whint; /* width hint (N < 1 is in percent of termwidth) */ int flags; /* tt flags */ + const char *help; /* column description */ const char *match; /* pattern for match_func() */ }; /* columns descriptions (don't use const, this is writable) */ static struct colinfo infos[FINDMNT_NCOLUMNS] = { - [COL_SOURCE] = { "SOURCE", 0.25 }, - [COL_TARGET] = { "TARGET", 0.30, TT_FL_TREE }, - [COL_FSTYPE] = { "FSTYPE", 0.10, TT_FL_TRUNC }, - [COL_OPTIONS] = { "OPTIONS", 0.10, TT_FL_TRUNC }, - [COL_VFS_OPTIONS] = { "VFS-OPTIONS", 0.20, TT_FL_TRUNC }, - [COL_FS_OPTIONS] = { "FS-OPTIONS", 0.10, TT_FL_TRUNC }, - [COL_LABEL] = { "LABEL", 0.10 }, - [COL_UUID] = { "UUID", 36 }, - [COL_MAJMIN] = { "MAJ:MIN", 6 }, - [COL_ACTION] = { "ACTION", 10, TT_FL_STRICTWIDTH }, - [COL_OLD_OPTIONS] = { "OLD-OPTIONS", 0.10, TT_FL_TRUNC }, - [COL_OLD_TARGET] = { "OLD-TARGET", 0.30 }, + [COL_SOURCE] = { "SOURCE", 0.25, 0, N_("source device") }, + [COL_TARGET] = { "TARGET", 0.30, TT_FL_TREE, N_("mountpoint") }, + [COL_FSTYPE] = { "FSTYPE", 0.10, TT_FL_TRUNC, N_("filesystem type") }, + [COL_OPTIONS] = { "OPTIONS", 0.10, TT_FL_TRUNC, N_("all mount options") }, + [COL_VFS_OPTIONS] = { "VFS-OPTIONS", 0.20, TT_FL_TRUNC, N_("VFS specific mount options") }, + [COL_FS_OPTIONS] = { "FS-OPTIONS", 0.10, TT_FL_TRUNC, N_("FS specific mount options") }, + [COL_LABEL] = { "LABEL", 0.10, 0, N_("filesystem label") }, + [COL_UUID] = { "UUID", 36, 0, N_("filesystem UUID") }, + [COL_MAJMIN] = { "MAJ:MIN", 6, 0, N_("major:minor device number") }, + [COL_ACTION] = { "ACTION", 10, TT_FL_STRICTWIDTH, N_("action detected by --poll") }, + [COL_OLD_OPTIONS] = { "OLD-OPTIONS", 0.10, TT_FL_TRUNC, N_("old mount options saved by --poll") }, + [COL_OLD_TARGET] = { "OLD-TARGET", 0.30, 0, N_("old mountpoint saved by --poll") }, }; /* global flags */ @@ -799,13 +800,9 @@ static void __attribute__((__noreturn__)) usage(FILE *out) fprintf(out, _("\nAvailable columns:\n")); - for (i = 0; i < FINDMNT_NCOLUMNS; i++) { + for (i = 0; i < FINDMNT_NCOLUMNS; i++) + fprintf(out, " %11s %s\n", infos[i].name, _(infos[i].help)); - fprintf(out, " %-12s", infos[i].name); - if (i && !((i+1) % 3)) - fputc('\n', out); - } - fputc('\n', out); fprintf(out, _("\nFor more information see findmnt(1).\n")); |