From 58a4c595a6cce22f39899e0ae7b55b9e2d07f3b2 Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Wed, 12 Jul 2017 09:56:44 -0400 Subject: [PATCH] LU-5170 lfs: Standardize error messages in lfs_mv() Error messages in lfs_mv() are updated to a standard format. Messages are prefixed with the name of the utility and the command that caused the error. User-provided values are delimited with single quotes. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: Id3d276024a2dcd1ca9169123f9d9193a846d7c85 Reviewed-on: https://review.whamcloud.com/28239 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez --- lustre/utils/lfs.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index e05b3fb..5d18285 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -5000,8 +5000,8 @@ static int lfs_mv(int argc, char **argv) case 'm': param.fp_mdt_index = strtoul(optarg, &end, 0); if (*end != '\0') { - fprintf(stderr, "%s: invalid MDT index'%s'\n", - argv[0], optarg); + fprintf(stderr, "%s mv: bad MDT index '%s'\n", + progname, optarg); return CMD_HELP; } break; @@ -5009,27 +5009,28 @@ static int lfs_mv(int argc, char **argv) param.fp_verbose = VERBOSE_DETAIL; break; default: - fprintf(stderr, "error: %s: unrecognized option '%s'\n", - argv[0], argv[optind - 1]); + fprintf(stderr, "%s mv: unrecognized option '%s'\n", + progname, argv[optind - 1]); return CMD_HELP; } } if (param.fp_mdt_index == -1) { - fprintf(stderr, "%s: MDT index must be specified\n", argv[0]); + fprintf(stderr, "%s mv: MDT index must be specified\n", + progname); return CMD_HELP; } if (optind >= argc) { - fprintf(stderr, "%s: missing operand path\n", argv[0]); + fprintf(stderr, "%s mv: DIR must be specified\n", progname); return CMD_HELP; } param.fp_migrate = 1; rc = llapi_migrate_mdt(argv[optind], ¶m); if (rc != 0) - fprintf(stderr, "%s: cannot migrate '%s' to MDT%04x: %s\n", - argv[0], argv[optind], param.fp_mdt_index, + fprintf(stderr, "%s mv: cannot migrate '%s' to MDT%04x: %s\n", + progname, argv[optind], param.fp_mdt_index, strerror(-rc)); return rc; } -- 1.8.3.1