Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Sep 2017 01:14:54 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        by <by@meetlost.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Parse command line arguments with getopt_long()
Message-ID:  <CANCZdfrPr2snga260oH4-4_qTFnd_3fzg9C6qn3UmELJrqNYzw@mail.gmail.com>
In-Reply-To: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com>
References:  <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@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?CANCZdfrPr2snga260oH4-4_qTFnd_3fzg9C6qn3UmELJrqNYzw>