Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2018 20:45:35 +0000 (UTC)
From:      Piotr Pawel Stefaniak <pstef@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334495 - head/usr.bin/indent
Message-ID:  <201806012045.w51KjZk9040208@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pstef
Date: Fri Jun  1 20:45:35 2018
New Revision: 334495
URL: https://svnweb.freebsd.org/changeset/base/334495

Log:
  indent(1): improve an error message
  
  When producing a "[...] requires a parameter" error, provide the recognized
  name of the option instead of argument provided.

Modified:
  head/usr.bin/indent/args.c

Modified: head/usr.bin/indent/args.c
==============================================================================
--- head/usr.bin/indent/args.c	Fri Jun  1 19:58:19 2018	(r334494)
+++ head/usr.bin/indent/args.c	Fri Jun  1 20:45:35 2018	(r334495)
@@ -325,7 +325,7 @@ found:
     case PRO_INT:
 	if (!isdigit(*param_start)) {
     need_param:
-	    errx(1, "%s: ``%s'' requires a parameter", option_source, arg - 1);
+	    errx(1, "%s: ``%s'' requires a parameter", option_source, p->p_name);
 	}
 	*p->p_obj = atoi(param_start);
 	break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806012045.w51KjZk9040208>