This is mostly to simplify tests, but it also improves readability.
The infrastructure changes in this commit also make it possible to
introduce a new `url` variable that defaults to `opt('server', $h)`
concatenated with `opt('script', $h)` so that we can start migrating
away from those user-unfriendly variables.
This doesn't add any new command-line arguments, but it does mean that
a new command-line argument can be added for any variable, not just
those in `$variables{'global-defaults'}`, and its value will be copied
to `%globals`.
My main motivation for this commit is to make it possible to remove
the redundant variable declarations between
`$variables{'global-defaults'}` and
`$variables{'protocol-common-defaults'}`.
The `opt` function falls back to global/default if the value is
undefined, even if it is explicitly set to `undef`. `group_hosts_by`
should behave the same.
The alternative is to "fix" the code to match the original intention,
but users haven't been complaining so it's better to avoid the risk of
introducing a new bug in the fix.
Different protocols can have different default values for a particular
variable. Grab the protocol-specific variable definition if given a
hostname when looking up the variable's default.
Allow newlines to be in values, but stop searching for assignments
once an unescaped/unquoted newline is discovered. This is preparation
to using `parse_assignments` to process the `--options` command-line
argument, which might have embedded newlines.
Variable declarations already have a `required` flag, which makes the
type confusing. What would it mean for a variable to be a required
`T_OFQDN`? And how would an optional `T_FQDN` differ from an optional
`T_OFQDN`?
This does not affect the `--help` command-line argument.
The `help` setting didn't do anything useful, and it didn't make sense
to set `help=1` in the config file (or pass `--options=help=1`), so
this removal is unlikely to affect anyone. If the setting does exist,
the user will get a warning and the setting will be ignored.
The `ssl` option is a global option, not a per-host option. This
commit could instead do:
local $ddclient::globals{ssl} = 0;
but it's more straightforward to include `http://` in the `server`
option, and it tests that `server` supports the inclusion of the
scheme.
Removed the min-interval set to 5 minutes in changeip, because according to my tests, changeip has no problem updating every 30 seconds, which is the default min-interval value in ddclient