Gentoo Archives: gentoo-dev

From: William Hubbs <williamh@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] rfc: openrc init scripts taking command line arguments
Date: Wed, 18 Jul 2012 20:12:10
Message-Id: 20120718200955.GA21093@linux1
In Reply to: Re: [gentoo-dev] rfc: openrc init scripts taking command line arguments by Michael Mol
1 On Wed, Jul 18, 2012 at 03:58:18PM -0400, Michael Mol wrote:
2 > On Wed, Jul 18, 2012 at 3:49 PM, Peter Stuge <peter@×××××.se> wrote:
3 > > William Hubbs wrote:
4 > >> /etc/init.d/foo stop start
5 > >>
6 > >> would no longer work the way you might expect because there would be no
7 > >> way to tell whether start is a command or an argument to stop.
8 > >>
9 > >> What are your thoughts about this change?
10 > >
11 > > /etc/init.d/foo stop start
12 > >
13 > > along with all other commands can work like before.
14 > >
15 > > /etc/init.d/foo stop -- start
16 > >
17 > > can pass start as an argument to the stop command.
18 >
19 > I like this approach, because its use of -- continues expected
20 > commandline parsing behaviors from other commands, making it
21 > intuitive.
22 >
23 > I.e.
24 >
25 > touch -- -an-ugly-filename
26 > ls -l -- -an-ugly-filename
27 > rm -- -an-ugly-filename
28
29 Theis still breaks backward compatibility though, e.g.
30
31 /etc/init.d/foo command1 -- arg1 arg2 command2
32
33 has issues.
34
35 The other approach, which is on the bug, still has this issue, e.g.
36
37 /etc/init.d/foo command1 arg1 arg2 command2 arg3 arg4 command3 arg5
38
39 gets pretty ugly pretty quick. which arguments go with which commands is
40 subject to interpretation.
41
42 William

Replies