Skip to content

Updated help information for adig, acountry, and ahost.#334

Merged
bradh352 merged 7 commits into
c-ares:masterfrom
div2016bit:master
Jun 14, 2020
Merged

Updated help information for adig, acountry, and ahost.#334
bradh352 merged 7 commits into
c-ares:masterfrom
div2016bit:master

Conversation

@div2016bit

Copy link
Copy Markdown
Contributor

Information from the man pages was added to the -h option of each of the commands.

@coveralls

coveralls commented May 26, 2020

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 89.145% when pulling 98fd2be on anonymoushelpishere:master into 1b98172 on c-ares:master.

@bradh352

Copy link
Copy Markdown
Member

please move code out of headers

@div2016bit

Copy link
Copy Markdown
Contributor Author

I was able to get Travis to pass with code in header but not in the '.c' (see be57554..., 6e9bae7...) not sure if this has to do with the 'Quick hack...' where it looks like ares_get_opt is manually included in some of the makefiles (e.g. Makefile.m32 at line 42) or if this is some other subtlety that I am not familiar with. In the case that I need to manually include in makefiles via the hack, this seems like more editing than should be needed for a simple help printout, thus perhaps I missed something. Currently all checks have passed.

@bradh352

Copy link
Copy Markdown
Member

your header file still has the full implementation.

you should just move the respective print functions to adig.c/ahost.c/etc instead of creating new external files.

@div2016bit div2016bit closed this May 27, 2020
@div2016bit div2016bit reopened this May 27, 2020
@bradh352

bradh352 commented Jun 2, 2020

Copy link
Copy Markdown
Member

should probably merge -? and -h to do the same output

@div2016bit

Copy link
Copy Markdown
Contributor Author

Note that, to stay consistent with 'man -h' (which I hope is a good example to follow) I omitted the -? from the usage note but the programs now respond to -? and -h.

@bradh352 bradh352 merged commit d561177 into c-ares:master Jun 14, 2020
Comment thread adig.c
break;
case '?':
print_help_info_adig();
break;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One could collapse these info:

        case 'h':
        case '?':
          print_help_info_adig();
          break;

Comment thread adig.c
static void print_help_info_adig() {
printf("adig, version %s \n\n", ARES_VERSION_STR);
printf("usage: adig [-h] [-d] [-f flag] [-s server] [-c class] [-t type] [-T|U port] name ...\n\n"
" d : Print some extra debugging output.\n"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why d and not -d ... as is more common in help-screens?
(same in all 3 a*.c files).

sergepetrenko pushed a commit to tarantool/c-ares that referenced this pull request Jul 29, 2022
Provide more descriptive help information for various utilities.

Fix By: @anonymoushelpishere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants