From owner-freebsd-hackers@freebsd.org Thu Sep 7 10:57:31 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 38624E178D5 for ; Thu, 7 Sep 2017 10:57:31 +0000 (UTC) (envelope-from ablacktshirt@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0456F948 for ; Thu, 7 Sep 2017 10:57:30 +0000 (UTC) (envelope-from ablacktshirt@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id r10so1402127wmf.1 for ; Thu, 07 Sep 2017 03:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ts9iMZTR8mXwZJvWpRBDSc6In6qFPe1ZpwW90ZL1xwY=; b=ZCkX2my+hITbqJjMCbUnCfKkUIhi8pEdswk86vC4ZXP+deCVeBvMCmFpbRAvxcO/cO G8Vv3PtaHjyAvIAeK7LAXACFoov6g6vJVXB4ST7M5PlPW4le1Wxx+ebZk3ruBl6VBy+H VbIVIUPBKba7uu+OwBvMBZAjNBdo8OaeLRntmhiQ1IoyB/KIGLOowBZYOtiC4/NhCpuq x44zxpn1b+olV6yxyDXBV2wD4Lb1Jk8ZVLADK1To9TF43cmZaIS8g4d4+di30nMlzXob wA007lUVZpQyr9oy2BUTWBdaT17lyZVo6tQlXk+WqsUIkbx4Lm8MwlsDaYN031uPI81E TeAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ts9iMZTR8mXwZJvWpRBDSc6In6qFPe1ZpwW90ZL1xwY=; b=duLT9uQzAT64v8aOcqU3dwmtYBcM2jpQlyLm6Ff1Irgdb539HVisDvnpLjwPhu1iWJ pOYDD7eYC2da91AdEHAVAN7o2IrtiGj6tSwB6FmuqHlnDL3YEFOlh9Deo+K+QryYzVn1 jRElozmLJOoVdV9yTKSNkzOn+bjruTNPlA/Yut28uMx/NeTFRfGotqlp7C47q13hBCC7 xoqoV6tFYpwu/daS+kw1JlsDEOsH8cDdp08aeYWfCqcw3RXW7piIGcScthPT/CDlpcEz 2m1IWC2t/k2Nz5u8ZLlWoFLlvrzJ0qF+YvZOILvCtHMfk7WYMVOOvTo6XWXFwcb5851y 1ZLw== X-Gm-Message-State: AHPjjUg/wzAB3k/nRooH2tRs5j2daQ3+5yKwBaTUtyp+1W/sCiDJg0Xd h8eQGxDYsnDohKDFZYtthJ1Z7xV38Q== X-Google-Smtp-Source: ADKCNb5S9OKZej22oh3Mp6T2SPZ5tNFKYVgCoa6H0rwLEdVkouzGhWRzN8Vsxql2UsHgTwQsUYmoyDCUlgzMUggCy38= X-Received: by 10.80.164.163 with SMTP id w32mr2220481edb.63.1504781848648; Thu, 07 Sep 2017 03:57:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.216.197 with HTTP; Thu, 7 Sep 2017 03:57:28 -0700 (PDT) In-Reply-To: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> References: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> From: Yubin Ruan Date: Thu, 7 Sep 2017 18:57:28 +0800 Message-ID: Subject: Re: Parse command line arguments with getopt_long() To: by Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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:57:31 -0000 2017-09-07 14:49 GMT+08:00 by : > Hi, > > 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 pa= ge, I realize that this function can parse arguments like "--myoption=3Dsom= evalue", 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. Will "gflags" be OK? Yubin