From owner-freebsd-hackers@freebsd.org Thu Sep 7 06:49:59 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 66197E0B896 for ; Thu, 7 Sep 2017 06:49:59 +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 BF96D7EF2D for ; Thu, 7 Sep 2017 06:49:58 +0000 (UTC) (envelope-from by@meetlost.com) Received: from [192.168.59.242] ([61.141.64.170]) (authenticated bits=0) by meetlost.com (8.15.2/8.15.2) with ESMTPSA id v876nX2b094038 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 7 Sep 2017 06:49:34 GMT (envelope-from by@meetlost.com) From: by Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Thu, 7 Sep 2017 14:49:54 +0800 Subject: Parse command line arguments with getopt_long() Message-Id: <373D1051-950A-41B1-BB33-55540A1E393A@meetlost.com> To: freebsd-hackers@freebsd.org X-Mailer: iPhone Mail (14G60) 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 06:49:59 -0000 Hi, I am writing a program which need parse command line arguments like "--myopt= ion somevalue", and what I found is getopt_long(). After read the man page, I= realize that this function can parse arguments like "--myoption=3Dsomevalue= ", the problem is, the somevalue can be integer only. Is there any function already there to parse command line arguments with str= ing values? If not, I think I need parse argv manually. by=