X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 782DBDC0096 for ; Wed, 3 Jul 2013 14:09:14 +0000 (UTC) Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 0BF4220C38; Wed, 3 Jul 2013 10:09:10 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute3.internal (MEProxy); Wed, 03 Jul 2013 10:09:11 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=QrraxKXBB6bjS6DybLrzepvm1Rc=; b=b501SuJJ9xv3gRFic15G8cP5fvMq 1kQCDYEmFej5M1fYolPrh7P5IQkkrOqMc21kjqeU+1h1bHhuqhj/9fc3MGwR3Y75 kboLMZLpXfnY1oQojeCJNJDaOji3jNn+iKWHOHSktwb3zQizbLlNeA++EXTurkao /n6sFDkB6wvDh+8= X-Sasl-enc: INj2/qcKh4p58QhGv9M6mnPrs38ielyS3utVzS0X+c7f 1372860550 Received: from localhost (unknown [69.86.161.244]) by mail.messagingengine.com (Postfix) with ESMTPA id 70B486802BD; Wed, 3 Jul 2013 10:09:10 -0400 (EDT) Date: Wed, 3 Jul 2013 10:09:10 -0400 From: Dubiousjim To: Natanael Copa Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH 3/4] update-conf: accept long options Message-ID: <20130703140910.GE1550@zen> Mail-Followup-To: Natanael Copa , alpine-devel@lists.alpinelinux.org References: <6d0295ddc265976445cb2d46c6194db304e92386.1372713126.git.dubiousjim@gmail.com> <20130703153033.5230023e@ncopa-desktop.alpinelinux.org> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130703153033.5230023e@ncopa-desktop.alpinelinux.org> User-Agent: Mutt/1.5.21 (2010-09-15) On Wed, Jul 03, 2013 at 03:30:33PM +0200, Natanael Copa wrote: > On Mon, 1 Jul 2013 17:14:16 -0400 > Dubiousjim wrote: > > -while getopts "alih" opt ; do > > - case "$opt" in > > - a) aflag="-a" ;; > > - i) iflag="-i" ;; > > - l) lflag="-l" ;; > > - h|*) usage;; > > - esac > > +args=`getopt -o ailh --long all,initd,list,help -n "$PROGRAM" -- "$@"` > > I don't think this is posix shell compatible. > > We already use various extensions like 'local' and shell replace > expansion ${var/search/replace} so we already depend on an extended shell. > > I think this is ok for now, but we should be aware of that this is > moving away from posix shell compat. > > Is long options worth it? I've got a bunch of patches for the abuild package too that I'm cleaning up, including long options for many of the small scripts. I'm pretty sure you're right that POSIX doesn't require any getopt shell command or utility. So this is extra-POSIX. BusyBox (as we configure it) provides getopt as an external utility, so in our case we do go beyond Posix but we're not thereby requiring an extra-POSIX *shell*. Perhaps Bash implements getopt as an internal shell command, I don't remember. > I also made a posix shell implementation for parsing options for lxc > templates which we could use instead. Where is that? -- Dubiousjim dubiousjim@gmail.com --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---