Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if argument defined via Argument object #148

Open
TimothyBJacobs opened this issue Jun 19, 2019 · 1 comment
Open

Check if argument defined via Argument object #148

TimothyBJacobs opened this issue Jun 19, 2019 · 1 comment

Comments

@TimothyBJacobs
Copy link

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.

@duncan3dc
Copy link
Member

Hi @TimothyBJacobs I'd be happy to accept a PR for this feature 👍

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

No branches or pull requests

2 participants