-
Notifications
You must be signed in to change notification settings - Fork 921
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
More helpful pdnsutil help output #15082
base: master
Are you sure you want to change the base?
Conversation
This extends the commands dictionary with a command group and the one-liner help message. When the list of these one-liners get output, they are now output in sorted order within each group.
Pull Request Test Coverage Report for Build 12931605740Details
💛 - Coveralls |
"add-meta ZONE KIND VALUE Add zone metadata, this adds to the existing KIND\n" | ||
" [VALUE ...]"}}, | ||
{"add-record", {true, addRecord, GROUP_ZONE, | ||
"add-record ZONE NAME TYPE [ttl] content\n" | ||
" [content..] Add one or more records to ZONE"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation for [VALUE ...]
and [content..]
doesn't match
"add-meta ZONE KIND VALUE Add zone metadata, this adds to the existing KIND\n" | ||
" [VALUE ...]"}}, | ||
{"add-record", {true, addRecord, GROUP_ZONE, | ||
"add-record ZONE NAME TYPE [ttl] content\n" | ||
" [content..] Add one or more records to ZONE"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"add-meta ZONE KIND VALUE Add zone metadata, this adds to the existing KIND\n" | |
" [VALUE ...]"}}, | |
{"add-record", {true, addRecord, GROUP_ZONE, | |
"add-record ZONE NAME TYPE [ttl] content\n" | |
" [content..] Add one or more records to ZONE"}}, | |
"add-meta ZONE KIND VALUE Add zone metadata, this adds to the existing KIND\n" | |
" [VALUE ...]"}}, | |
{"add-record", {true, addRecord, GROUP_ZONE, | |
"add-record ZONE NAME TYPE [ttl] content\n" | |
" [content...] Add one or more records to ZONE"}}, |
I think you want an extra .
here, you might want a space depending on what you're doing...
" [rsasha1|rsasha1-nsec3-sha1|rsasha256|rsasha512|ecdsa256|ecdsa384" | ||
#if defined(HAVE_LIBSODIUM) || defined(HAVE_LIBCRYPTO_ED25519) | ||
"|ed25519" | ||
#endif | ||
#if defined(HAVE_LIBCRYPTO_ED448) | ||
"|ed448" | ||
#endif | ||
"]\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My personal preference would be to make the [
/|
/]
line up:
" [rsasha1|rsasha1-nsec3-sha1|rsasha256|rsasha512|ecdsa256|ecdsa384" | |
#if defined(HAVE_LIBSODIUM) || defined(HAVE_LIBCRYPTO_ED25519) | |
"|ed25519" | |
#endif | |
#if defined(HAVE_LIBCRYPTO_ED448) | |
"|ed448" | |
#endif | |
"]\n" | |
" [rsasha1|rsasha1-nsec3-sha1|rsasha256|rsasha512|ecdsa256|ecdsa384" | |
#if defined(HAVE_LIBSODIUM) || defined(HAVE_LIBCRYPTO_ED25519) | |
"|ed25519" | |
#endif | |
#if defined(HAVE_LIBCRYPTO_ED448) | |
"|ed448" | |
#endif | |
"]\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That probably would fail the clang-format step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I had to make a 🤖 happy, I might even make a macro:
#define IGNORED_INDENT_________________
Or something...
Linters shouldn't make it harder to read/reason over things...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wait, this is a clang-format off
zone, so why not.
[Did you now? If you write
// clang-format off // go home, clang-format, you're drunk
it does not disable clang-format
as expected.]
{"b2b-migrate", {true, B2BMigrate, GROUP_OTHER, | ||
"b2b-migrate OLD NEW Move all data from one backend to another"}}, | ||
{"backend-cmd", {true, backendCmd, GROUP_OTHER, | ||
"backend-cmd BACKEND CMD [CMD..] Perform one or more backend commands"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"backend-cmd BACKEND CMD [CMD..] Perform one or more backend commands"}}, | |
"backend-cmd BACKEND CMD [CMD...] Perform one or more backend commands"}}, |
"|ed448" | ||
#endif | ||
"]\n" | ||
" Add a ZSK or KSK to zone and specify algo&bits"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" Add a ZSK or KSK to zone and specify algo&bits"}}, | |
" Add a ZSK or KSK to zone and specify alg & bits"}}, |
I prefer alg
as an abbreviation for algorithm
I prefer spaces around &
...
{"rectify-all-zones", {true, rectifyAllZones, GROUP_DNSSEC, | ||
"rectify-all-zones [quiet] Rectify all zones. Optionally quiet output with errors only"}}, | ||
{"rectify-zone", {true, rectifyZone, GROUP_DNSSEC, | ||
"rectify-zone ZONE [ZONE ..] Fix up DNSSEC fields (order, auth)"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"rectify-zone ZONE [ZONE ..] Fix up DNSSEC fields (order, auth)"}}, | |
"rectify-zone ZONE [ZONE ...] Fix up DNSSEC fields (order, auth)"}}, |
"remove-zone-key ZONE KEY-ID Remove key with KEY-ID from ZONE"}}, | ||
{"replace-rrset", {true, replaceRRSet, GROUP_RRSET, | ||
"replace-rrset ZONE NAME TYPE [ttl] Replace named RRSET from zone\n" | ||
" content [content..]"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" content [content..]"}}, | |
" content [content...]"}}, |
{"secure-all-zones", {true, secureAllZones, GROUP_DNSSEC, | ||
"secure-all-zones [increase-serial] Secure all zones without keys"}}, | ||
{"secure-zone", {true, secureZone, GROUP_DNSSEC, | ||
"secure-zone ZONE [ZONE ..] Add DNSSEC to zone ZONE"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"secure-zone ZONE [ZONE ..] Add DNSSEC to zone ZONE"}}, | |
"secure-zone ZONE [ZONE ...] Add DNSSEC to zone ZONE"}}, |
And what happens if there's more than one zone?
{"set-kind", {true, setKind, GROUP_ZONE, | ||
"set-kind ZONE KIND Change the kind of ZONE to KIND (primary, secondary, native, producer, consumer)"}}, | ||
{"set-meta", {true, setMeta, GROUP_META, | ||
"set-meta ZONE KIND [VALUE] [VALUE] Set zone metadata, optionally providing a value. *No* value clears meta\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing since there appear to be two VALUE fields but no ...
...
" [producer|consumer]\n" | ||
" [coo|unique|group] VALUE\n" | ||
" [VALUE ...]"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indentation doesn't match anything else I've seen...
As you may or may not have guessed, this PR was not changing any of the existing help texts, only moving them around. Thanks to the review feedback I'll try to make them look better now. |
I can't remember if my original attempt did. I think I struggled because they were so inconsistent. |
Also, I'm really tempted to make the help text for every command span two lines, as in
On one hand, this would prevent some help sentences to span two lines due to them being preceded by about 35 spaces; on the other hand there are nevertheless a fair number of commands where synposis and help fits on a single line. Opinions? |
I started doing something like that in places in my PR. The existing wrapping was more trouble than it was worth. |
Short description
This is another take at #12350 ("Group pdnsutil usage by topic"). The dictionary of
pdnsutil
commands is extended with a "command group" and the short help text, for every command. This allows these help texts to be output in groups, with alphabetical ordering within each group, automagically.Doing this also exposes a few commands which lack help texts, these can either remain hidden or get gifted a nice help text (to be discussed in this PR).
The grouping of commands is
stolenborrowed from #12350 and open for discussion as well. The changes in this PR allow for group assignment to be changed very easily, as well as new groups created, if deemed useful.Checklist
I have: