From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.77) (envelope-from ) id 1SraWt-0002oj-B2 for garchives@archives.gentoo.org; Wed, 18 Jul 2012 20:07:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4CED6E0716; Wed, 18 Jul 2012 20:07:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3021BE070C for ; Wed, 18 Jul 2012 20:06:06 +0000 (UTC) Received: from pomiocik.lan (77-255-8-86.adsl.inetia.pl [77.255.8.86]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id A1B971B4056; Wed, 18 Jul 2012 20:06:04 +0000 (UTC) Date: Wed, 18 Jul 2012 22:06:20 +0200 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= To: gentoo-dev@lists.gentoo.org Cc: mikemol@gmail.com Subject: Re: [gentoo-dev] rfc: openrc init scripts taking command line arguments Message-ID: <20120718220620.19055cf6@pomiocik.lan> In-Reply-To: References: <20120718194152.GA20903@linux1> <20120718194949.30231.qmail@stuge.se> Organization: Gentoo X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.11; x86_64-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA256; boundary="Sig_/G1YX5SokaDkOyp3r_6tm=Sk"; protocol="application/pgp-signature" X-Archives-Salt: 0034fb2f-64ed-4f07-8c5a-b5f061f236e0 X-Archives-Hash: e5bd38e5308db0433bd5f9999b559dd3 --Sig_/G1YX5SokaDkOyp3r_6tm=Sk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 18 Jul 2012 15:58:18 -0400 Michael Mol wrote: > On Wed, Jul 18, 2012 at 3:49 PM, Peter Stuge wrote: > > William Hubbs wrote: > >> /etc/init.d/foo stop start > >> > >> would no longer work the way you might expect because there would > >> be no way to tell whether start is a command or an argument to > >> stop. > >> > >> What are your thoughts about this change? > > > > /etc/init.d/foo stop start > > > > along with all other commands can work like before. > > > > /etc/init.d/foo stop -- start > > > > can pass start as an argument to the stop command. >=20 > I like this approach, because its use of -- continues expected > commandline parsing behaviors from other commands, making it > intuitive. No, it's not intuitive. It's rather counter-intuitive. GNU command line parsers use '--' to separate options from random arguments. It's '--' because options start with '-'. For arguments starting with any other character, GNU option parsers treat them equally before and after '--'. And yes, some tools actually use '--' to separate arguments to the tool itself from arguments which are passed to some other tool. This is not very intuitive as well, and I really prefer having '--subtool-one-arguments "--foo --bar"' instead, with embedded splitting logic. Of course, this is harder to implement. --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/G1YX5SokaDkOyp3r_6tm=Sk Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iJwEAQEIAAYFAlAHFz0ACgkQfXuS5UK5QB39VwP/SKzIS0RMj5q1CqmGv/l3HQKt RmUbEwpXoFY2jOVDGlwkJEfGS4Yv51/rmJO6oqH38jlHnHtpzFBInj+eJHmkECtY Rtq0FceygG6aw/KSXBMWroav33g0Axs2bGlTsoxM/63M5veH0rZC21Oq0jdsUX7c 8eBezR2YdzxBeP+Q0KY= =Rd+g -----END PGP SIGNATURE----- --Sig_/G1YX5SokaDkOyp3r_6tm=Sk--