[PATCH v3 5/5] mtdinfo: consolidate help as display_help()
Brian Foster
brian.foster at maxim-ic.com
Fri Aug 12 03:06:20 EDT 2011
On Thursday 11 August 2011 18:19:40 Brian Norris wrote:
> The help message for mtdinfo is unnecessarily disjointed. It is split
> into three strings which reuse the PROGRAM_NAME string inefficiently and
> don't have a consistent style.
>
> This fixup should provide a cleaner look with aligned columns and
> easier-to-read source code.
>
> Signed-off-by: Brian Norris <computersforpeace at gmail.com>
> ---
> v3: indented help message properly
>
> ubi-utils/mtdinfo.c | 52 ++++++++++++++++++++++++++------------------------
> 1 files changed, 27 insertions(+), 25 deletions(-)
>
> diff --git a/ubi-utils/mtdinfo.c b/ubi-utils/mtdinfo.c
>[ ... ]
> +static void display_help(void)
> +{
> + printf(
> + "%1$s version %2$s - a tool to print MTD information.\n"
> + "\n"
> + "Usage: %1$s <MTD node file path> [--map | -M] [--ubi-info | -u]\n"
> + " %1$s --all [--ubi-info | -u]\n"
> + " %1$s [--help | --version]\n"
> + "\n"
> + "Options:\n"
> + "-u, --ubi-info print what would UBI layout be if it was put\n"
> + " on this MTD device\n"
> + "-M, --map print eraseblock map\n"
> + "-a, --all print information about all MTD devices\n"
> + " Note: `--all' may give less info per device\n"
> + " than, e.g., `mtdinfo /dev/mtdX'\n"
> + "-h, --help print help message\n"
> + "-V, --version print program version\n"
> + "\n"
> + "Examples:\n"
> + " %1$s /dev/mtd0 print information MTD device /dev/mtd0\n"
> + " %1$s /dev/mtd0 -u print information MTD device /dev/mtd0\n"
> + "\t\t\t\tand include UBI layout information\n"
Any reason this line, and only this line,
uses tabs (\t) for formatting whilst every
other line uses spaces? (FWIW, I prefer
spaces, but more importantly think there
should be some consistency.)
Yes, this is pedantic trivia! ;-)
cheers!
-blf-
--
Brian FOSTER
Principal MTS, Software
Maxim Integrated Products (Microcontroller BU), formerly Innova Card
Web : http://www.maxim-ic.com/
More information about the linux-mtd
mailing list