Skip to content
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

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

Merged
merged 7 commits into from Jun 14, 2020

Conversation

div2016bit
Copy link
Contributor

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

@coveralls
Copy link

coveralls commented May 26, 2020

Coverage Status

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

@bradh352
Copy link
Member

please move code out of headers

@div2016bit
Copy link
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
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
Copy link
Member

bradh352 commented Jun 2, 2020

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

@div2016bit
Copy link
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
3 checks passed
break;
case '?':
print_help_info_adig();
break;
Copy link
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;

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
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).

eriklax pushed a commit to halon/c-ares that referenced this pull request Aug 22, 2020
Provide more descriptive help information for various utilities.

Fix By: @anonymoushelpishere
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.

None yet

4 participants