Gentoo Archives: gentoo-dev

From: Fabian Groffen <grobian@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:09:21
Message-Id: 20120718200750.GZ49719@gentoo.org
In Reply to: Re: [gentoo-dev] rfc: openrc init scripts taking command line arguments by Michael Mol
1 On 18-07-2012 15:58:18 -0400, Michael Mol wrote:
2 > > along with all other commands can work like before.
3 > >
4 > > /etc/init.d/foo stop -- start
5 > >
6 > > can pass start as an argument to the stop command.
7 >
8 > I like this approach, because its use of -- continues expected
9 > commandline parsing behaviors from other commands, making it
10 > intuitive.
11 >
12 > I.e.
13 >
14 > touch -- -an-ugly-filename
15 > ls -l -- -an-ugly-filename
16 > rm -- -an-ugly-filename
17
18 yeah, but it means something like "don't treat the '-' as anything
19 special any more", so if you don't have something starting with -, you
20 don't need --. Hence, following your "expected" behaviour argument,
21
22 /etc/init.d/foo stop start
23
24 would do the same as
25
26 /etc/init.d/foo stop -- start
27
28 or
29
30 /etc/init.d/foo -- stop start
31
32
33 Perhaps, one better makes it explicit, inspired by gdb
34
35 /etc/init.d/foo stop --args aggressive-kill=yes
36 (and when using --args, I'd probably disallow using multiple commands to
37 keep it clear what's going on)
38
39
40 Fabian
41
42 --
43 Fabian Groffen
44 Gentoo on a different level

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-dev] Re: rfc: openrc init scripts taking command line arguments Duncan <1i5t5.duncan@×××.net>