From owner-freebsd-hackers@freebsd.org Thu Sep 7 07:33:43 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 618E3E0E1E5 for ; Thu, 7 Sep 2017 07:33:43 +0000 (UTC) (envelope-from by@meetlost.com) Received: from meetlost.com (freebsd.meetlost.com [IPv6:2403:2500:8000:1::962]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.meetlost.com", Issuer "mail.meetlost.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DFB536447A for ; Thu, 7 Sep 2017 07:33:42 +0000 (UTC) (envelope-from by@meetlost.com) Received: from [10.203.55.86] ([223.104.63.189]) (authenticated bits=0) by meetlost.com (8.15.2/8.15.2) with ESMTPSA id v877XFbc094282 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Sep 2017 07:33:17 GMT (envelope-from by@meetlost.com) Mime-Version: 1.0 (1.0) Subject: Re: Parse command line arguments with getopt_long() From: by X-Mailer: iPhone Mail (14G60) In-Reply-To: Date: Thu, 7 Sep 2017 15:33:30 +0800 Cc: "freebsd-hackers@freebsd.org" Message-Id: References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> To: Warner Losh Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:33:43 -0000 Ok, will do that. Thanks. by >=20 > Look at /usr/src/usr.sbin/efivar/efivar.c for an example. It's not restric= ted to integers. >=20 > Warner >=20 >> On Thu, Sep 7, 2017 at 12:49 AM, by wrote: >> Hi, >>=20 >> I am writing a program which need parse command line arguments like "--my= option somevalue", and what I found is getopt_long(). After read the man pag= e, I realize that this function can parse arguments like "--myoption=3Dsomev= alue", the problem is, the somevalue can be integer only. >>=20 >> Is there any function already there to parse command line arguments with s= tring values? >>=20 >> If not, I think I need parse argv manually. >>=20 >> by >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >=20