Skip to content

[META] Avoid side-effects during option parsing #800

Open
@N-R-K

Description

@N-R-K

Currently a lot of the tools perform side-effects during option parsing. Ideally, it should simply set the options and later code would act on it.

One major problem of the current approach is that --user flag behaves unreliably depending on the order. E.g rc-status --user [...] behaves one way and rc-status [...] --user behaves another.

Another issue is that some options will stop doing further processing which hinders the ability to report incorrect or excess arguments.

E.g a user may enter rc-status --crashed default in order to see all the crashed services in the default runlevel. --crashed actually just ignores any further arguments, even bogus ones like rc-status --crashed --lol will "work".

I've given some rc-status examples since that's what I was working on while I noticed this issue but the issue affects other tools too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions