dnscontrol
dnscontrol copied to clipboard
DOCS: Trailing commas
Another trick is to close your
D()
withEND)
:D("foo.com", ... A(...), A(...), A(...), END)
END
is just an alias for{}
, which is ignored by DNSControl. However it makes a comma on the previous line required, like all other lines.
Cool! I didn't know this and it was always a small frustration. Maybe something to document as tips and tricks?
Originally posted by @cafferata in https://github.com/StackExchange/dnscontrol/issues/2848#issuecomment-1962488254
Additional question, when do we choose to provide the code examples with END
and when not? Currently both are used.
- Code example with the
END
constant. https://docs.dnscontrol.org/language-reference/domain-modifiers/ignore#typical-usage - Code example without the
END
constant. https://docs.dnscontrol.org/language-reference/domain-modifiers/a
Excellent points!
I think it would serve the community best if we made END)
the default. It isn't required, of course, but it just makes everything so much easier.
Here are the cleanups needed:
- Change any code examples to use END
- Change get-zones to output END statements (working on this in https://github.com/StackExchange/dnscontrol/pull/2849)
- And, of course, somewhere we should explain
END)
vs)
and its benefits (and let people know that it is optional. I could imagine people seeing plain)
and be confused. (As you pointed out in your comment)
I'm working on get-zone. Would you be interested in the others?
Would you be interested in the others?
Yes, certainly! This documentation advocate will work on it 🤓