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

Add default values for given options #1

Open
jcowgar opened this issue Jul 1, 2014 · 1 comment
Open

Add default values for given options #1

jcowgar opened this issue Jul 1, 2014 · 1 comment

Comments

@jcowgar
Copy link
Owner

jcowgar commented Jul 1, 2014

You can currently specify the default option when you access it:

Dim name As String = options.StringValue("name", "World")

But if you access it multiple times, you have to specify the default value multiple times. The idea here is to specify it at the time the option is created:

Dim o As New Option("n", "name", "Name of person to say hello to")
o.DefaultValue = "World"

.. later ..

Print "Hello, " + options.StringValue("name")
@hwerglmir
Copy link

Also you can print the defaults in the help option (see for example psql help)

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