Parse command line arguments with getopt_long()

by by at meetlost.com
Thu Sep 7 08:50:23 UTC 2017


Seems can not find efivar, which version of FreeBSD you use?

I am on 10.3 RELEASE

by

> 
> Ok, will do that.
> Thanks.
> 
> by
> 
>> 
>> Look at /usr/src/usr.sbin/efivar/efivar.c for an example. It's not restricted to integers.
>> 
>> Warner
>> 
>>> On Thu, Sep 7, 2017 at 12:49 AM, by <by at meetlost.com> wrote:
>>> Hi,
>>> 
>>> 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 page, I realize that this function can parse arguments like "--myoption=somevalue", the problem is, the somevalue can be integer only.
>>> 
>>> Is there any function already there to parse command line arguments with string values?
>>> 
>>> If not, I think I need parse argv manually.
>>> 
>>> by
>>> _______________________________________________
>>> freebsd-hackers at freebsd.org mailing list
>>> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>> 
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"



More information about the freebsd-hackers mailing list