Date: Thu, 7 Sep 2017 18:09:39 +0800 From: by <by@meetlost.com> To: Warner Losh <imp@bsdimp.com> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: Parse command line arguments with getopt_long() Message-ID: <40270B50-819A-4B31-9A1F-FF2424E857D6@meetlost.com> In-Reply-To: <89069FBA-CA66-4D61-ABC5-6EC12DBB6798@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> <CANCZdfrPr2snga260oH4-4_qTFnd_3fzg9C6qn3UmELJrqNYzw@mail.gmail.com> <F446534E-E00C-482E-8A4E-7FF60FE4E0FC@meetlost.com> <89069FBA-CA66-4D61-ABC5-6EC12DBB6798@meetlost.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <by@meetlost.com> 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"=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40270B50-819A-4B31-9A1F-FF2424E857D6>
