From c73a449482c0be9a17580bd4e47a5f589cc09992 Mon Sep 17 00:00:00 2001
From: Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de>
Date: Tue, 24 Nov 2009 11:00:49 +1100
Subject: [PATCH] pgrep: distinguish between invalid commandline parameters and
 '-?'

A patch from Debian.

Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=413383
Backported-by: Sami Kerola <kerolasa@iki.fi>
---
 pgrep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pgrep.c b/pgrep.c
index 7a2ffb80..c8cd0cac 100644
--- a/pgrep.c
+++ b/pgrep.c
@@ -684,7 +684,7 @@ static void parse_opts (int argc, char **argv)
 //		case 'z':   // Solaris: match by zone ID
 //			break;
 		case '?':
-			usage (opt);
+			usage (optopt ? optopt : opt);
 			break;
 		}
 	}