If the option has a value, gets it.
value_type option_value(Option option);
Name | Type | Description |
---|---|---|
option | Option | An optional value. |
Returns: The value if the option has one.
This function uses assert to check if the option has a value. When using a release build, this function is equivalent to option_value_or_default.
Strongly Typed:
OPTION_DEFINE_H(StringOption, str_opt, char*)
StringOption option = str_opt_make("Hello World");
printf("%s\n", str_opt_value(option));
// Output:
// Hello World
Generically Typed:
OPTION_DEFINE_H(StringOption, str_opt, char*)
StringOption option = gds_option_make(StringOption, "Hello World");
printf("%s\n", gds_option_value(option));
// Output:
// Hello World