Gentoo Archives: gentoo-dev

From: Michael Mol <mikemol@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] rfc: openrc init scripts taking command line arguments
Date: Wed, 18 Jul 2012 20:09:05
Message-Id: CA+czFiCmAK-vDO418Nr+K+cnYxxGRDpCB=V+hLQjZRRMq9baMQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] rfc: openrc init scripts taking command line arguments by Peter Stuge
1 On Wed, Jul 18, 2012 at 3:49 PM, Peter Stuge <peter@×××××.se> wrote:
2 > William Hubbs wrote:
3 >> /etc/init.d/foo stop start
4 >>
5 >> would no longer work the way you might expect because there would be no
6 >> way to tell whether start is a command or an argument to stop.
7 >>
8 >> What are your thoughts about this change?
9 >
10 > /etc/init.d/foo stop start
11 >
12 > along with all other commands can work like before.
13 >
14 > /etc/init.d/foo stop -- start
15 >
16 > can pass start as an argument to the stop command.
17
18 I like this approach, because its use of -- continues expected
19 commandline parsing behaviors from other commands, making it
20 intuitive.
21
22 I.e.
23
24 touch -- -an-ugly-filename
25 ls -l -- -an-ugly-filename
26 rm -- -an-ugly-filename
27
28 --
29 :wq

Replies