Skip to content

FEATURE: Allowing other methods to work alongside __invoke() #2

@b-hayes

Description

@b-hayes

If the subject class implements __invoke all other methods are ignored.
It would be nice if invoke was only used if the first parameter doesn't match a class method, defaulting to invoke.
This goes against one of my main CLI scripting principles but would be handy in some cases.

eg.

//test command
public funciton _invoke()//returns "a default value"
public funciton alternate()//returns "something else"

and usage would be:

$ test
a default output value
$ test alternate
something else

and using --help would still list the other commands available while somehow indicating that the commands are now optional and something else will happen if no command is provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions