On Wed, 18 Jul 2012 15:58:18 -0400 Michael Mol <mike...@gmail.com> wrote:
> On Wed, Jul 18, 2012 at 3:49 PM, Peter Stuge <pe...@stuge.se> 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. > > 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. -- Best regards, Michał Górny
signature.asc
Description: PGP signature