Skip to content

Add method that would accept the new Option object, e.g. add(Option $option) #3

Description

@spaze

I like the new add* methods added in 1.9! :-) I'd like to use them, but I'd like to have a method that would accept the Option object.

My app has a few scripts and those scripts use command line params which are flags sometimes, sometimes a position argument which sometimes is a path (so I'd like to normalize it with the normalizer option) and so I thought that I'd make my classes return just array of Options that I'd pass directly to the Parser, otherwise I'd need to use another structure just to pass the options from one class to another to only pass them to the Parser which would create Option objects anyway.

Right now I return array of strings or array of option => value, and then I make a string by imploding the array, only for the Parser to parse it again. I'd like to make it more straightforward.

I can try and create a PR if you think this makes sense to add the method :-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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