diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index c9015aca5..c85ff5087 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -5,7 +5,7 @@ Version 1.02.26 - Make dm_hash_iter safe against deletion. Accept a NULL pointer to dm_free silently. Add tables_loaded, readonly and suspended columns to reports. - Add --prefixes to dmsetup. + Add --fieldprefixes to dmsetup. Add field name prefix option to reporting functions. Calculate string size within dm_pool_grow_object. diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 85451a0fc..fdc52e33c 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -114,13 +114,13 @@ enum { MAJOR_ARG, MINOR_ARG, MODE_ARG, + NAMEPREFIXES_ARG, NOFLUSH_ARG, NOHEADINGS_ARG, NOLOCKFS_ARG, NOOPENCOUNT_ARG, NOTABLE_ARG, OPTIONS_ARG, - PREFIXES_ARG, READAHEAD_ARG, SEPARATOR_ARG, SHOWKEYS_ARG, @@ -1990,7 +1990,7 @@ static int _report_init(struct command *c) if (_switches[UNBUFFERED_ARG]) buffered = 0; - if (_switches[PREFIXES_ARG]) { + if (_switches[NAMEPREFIXES_ARG]) { aligned = 0; field_prefixes = 1; } @@ -2119,7 +2119,7 @@ static void _usage(FILE *out) " [-r|--readonly] [--noopencount] [--nolockfs]\n" " [--readahead [+]|auto|none]\n" " [-c|-C|--columns] [-o ] [-O|--sort ]\n" - " [--noheadings] [--prefixes] [--separator ]\n\n"); + " [--nameprefixes] [--noheadings] [--separator ]\n\n"); for (i = 0; _commands[i].name; i++) fprintf(out, "\t%s %s\n", _commands[i].name, _commands[i].help); fprintf(out, "\n may be device name or -u or " @@ -2475,13 +2475,13 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir) {"major", 1, &ind, MAJOR_ARG}, {"minor", 1, &ind, MINOR_ARG}, {"mode", 1, &ind, MODE_ARG}, + {"nameprefixes", 0, &ind, NAMEPREFIXES_ARG}, {"noflush", 0, &ind, NOFLUSH_ARG}, {"noheadings", 0, &ind, NOHEADINGS_ARG}, {"nolockfs", 0, &ind, NOLOCKFS_ARG}, {"noopencount", 0, &ind, NOOPENCOUNT_ARG}, {"notable", 0, &ind, NOTABLE_ARG}, {"options", 1, &ind, OPTIONS_ARG}, - {"prefixes", 0, &ind, PREFIXES_ARG}, {"readahead", 1, &ind, READAHEAD_ARG}, {"separator", 1, &ind, SEPARATOR_ARG}, {"showkeys", 0, &ind, SHOWKEYS_ARG}, @@ -2608,6 +2608,8 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir) _switches[TARGET_ARG]++; _target = optarg; } + if ((ind == NAMEPREFIXES_ARG)) + _switches[NAMEPREFIXES_ARG]++; if ((ind == NOFLUSH_ARG)) _switches[NOFLUSH_ARG]++; if ((ind == NOHEADINGS_ARG)) @@ -2616,8 +2618,6 @@ static int _process_switches(int *argc, char ***argv, const char *dev_dir) _switches[NOLOCKFS_ARG]++; if ((ind == NOOPENCOUNT_ARG)) _switches[NOOPENCOUNT_ARG]++; - if ((ind == PREFIXES_ARG)) - _switches[PREFIXES_ARG]++; if ((ind == READAHEAD_ARG)) { _switches[READAHEAD_ARG]++; if (!strcasecmp(optarg, "auto"))