[arch-projects] [INITSCRIPTS][PATCH 4/4] rc.d: list [started|stopped|auto|noauto|daemon]

Tom Gundersen teg at jklm.no
Tue Aug 23 06:44:08 EDT 2011


On Tue, Aug 23, 2011 at 12:19 PM, Lukas Fleischer
<archlinux at cryptocrack.de> wrote:
> On Tue, Aug 23, 2011 at 11:05:56AM +0200, Sebastien Luttringer wrote:
>>  e.g: $name list
>> -     $name list started
>> -     $name help
>> +     $name list sshd gpm
>> +     $name list started #all started daemons
>> +     $name list /started #daemon nammed started
>
> Eeeeew. Don't do that.. Please! Three suggestions:
>
> * Just be okay with "started" being ambiguous. There probably won't be
>  any daemon called {started,stopped,auto,noauto} in the next 100 years.
>  This is all about doing it "right". If Tom and you are fine with
>  ambiguity, keep the way you did it in the first submission.

Ambiguity is not ok.

> * Do what I suggested in my first reply to the first version of this
>  patch and introduce a separate keyword.

That seems perfectly reasonable.

> * Use some separator like "--" to specify that there won't be any
>  further commands. `rc.d list started` will list all started daemons.
>  `rc.d list -- started auto` will list daemons called "started" and
>  "auto".

This was my first thought as well, though I think a separate keyword
would be nicer.

> ... but for the sake of god, please don't use "/" as some weird kind of
> escape character.

Yeah, that is a bit too non-standard.

I think my preferred solution would be to prefix all keywords with
"--". This would also allow you to use keywords in other actions
without weirdness ("rc.d start --stopped" would be nice, but "rc.d
start daemons sshd"/"rc.d start -- sshd" would be horrible).

I suggest the grammar to be something along the lines of:

$name list [--started|--stopped|--auto|--noauto|<daemon>...<daemon>]

(or whatever the syntax is for an arbitrary list of daemons).

Cheers,

Tom


More information about the arch-projects mailing list