From 1d06aed250ae2aee0f8410627f3cc963034fbf62 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 19 Mar 2019 13:06:03 +0100 Subject: [PATCH] mxqsub.c: Enforce usage of an unit, and explain it Since the default is described as '2G', a user can be mislead to think gigabytes are the default unit (reasonable in 2019, or). P.S. IMHO using these 'mimi-bytes' doesn't make it easier. --- mxqsub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mxqsub.c b/mxqsub.c index 07322e61..9e3c2dff 100644 --- a/mxqsub.c +++ b/mxqsub.c @@ -72,9 +72,8 @@ static void print_usage(void) " -j, --threads=NUMBER set number of threads (default: 1)\n" " -m, --memory=SIZE set amount of memory (default: 2G)\n" "\n" - " [SIZE] may be suffixed with a combination of T, G and M\n" - " to specify tebibytes, gibibytes and mebibytes.\n" - " Defaults to mebibytes if no suffix is set.\n" + " [SIZE] To specify megabytes, gigabytes or terrabytes,\n" + " size must be suffixed with a unit (M, G or T).\n" "\n" " -t, --runtime=TIME set runtime (default: 15m)\n" "\n" @@ -846,6 +845,9 @@ int main(int argc, char *argv[]) exit(EX_CONFIG); } arg_memory = bytes/1024/1024; + } else { + mx_log_crit("--memory '%s': Size must have a unit (M, G, T).", optctl.optarg); + exit(EX_CONFIG); } break;