From owner-freebsd-hackers@freebsd.org Thu Sep 7 10:09:51 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 C32ACE1554C for ; Thu, 7 Sep 2017 10:09:51 +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 1A09664ECD for ; Thu, 7 Sep 2017 10:09:50 +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 v87A9OC1095028 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 7 Sep 2017 10:09:25 GMT (envelope-from by@meetlost.com) Content-Type: text/plain; charset=us-ascii 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: <89069FBA-CA66-4D61-ABC5-6EC12DBB6798@meetlost.com> Date: Thu, 7 Sep 2017 18:09:39 +0800 Cc: "freebsd-hackers@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <40270B50-819A-4B31-9A1F-FF2424E857D6@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> <89069FBA-CA66-4D61-ABC5-6EC12DBB6798@meetlost.com> To: Warner Losh 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 10:09:51 -0000 I got it. It is on 11.1 RELEASE by >=20 > Seems can not find efivar, which version of FreeBSD you use? >=20 > I am on 10.3 RELEASE >=20 > by >=20 >>=20 >> Ok, will do that. >> Thanks. >>=20 >> by >>=20 >>>=20 >>> Look at /usr/src/usr.sbin/efivar/efivar.c for an example. It's not restr= icted 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 "--= myoption somevalue", and what I found is getopt_long(). After read the man p= age, I realize that this function can parse arguments like "--myoption=3Dsom= evalue", the problem is, the somevalue can be integer only. >>>>=20 >>>> Is there any function already there to parse command line arguments wit= h string 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.o= rg" >>>=20 >> _______________________________________________ >> 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 > _______________________________________________ > 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"=