Skip to content

Check if argument defined via Argument object #148

@TimothyBJacobs

Description

@TimothyBJacobs

I'm trying to check if an argument is defined. I need to distinguish between the default value, which is valid to be passed manually, and the argument not being defined at all.

I'm aware of the Manager::defined() method, but that requires reparsing $argv and in my particular use case, $argv isn't even available in this section of code.

What I'd like is something like $climate->arguments->provided( $name ). Though that might be a bit confusing with exists and defined already available on that object. Having it only accessible on the Argument object would work too I think.

The method would check if Argument::$values is non-empty.

Happy to PR if you think this is workable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions