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

Make usage documentation consistent and also demoose #371

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

mattias-p
Copy link
Member

@mattias-p mattias-p commented May 28, 2024

Purpose

This PR kills two birds with one stone:

  • It fixes the discrepancy between perldoc zonemaster-cli and zonemaster-cli --help, and
  • it migrates away from Moose and Moosex::Getopt::GLD.

Context

Changes

Application:

  • Instead of using Moose and Moosex::Getopt::GLD we now Getopt::Long and Pod::Usage which are both Perl core modules.
  • I merged the best parts of the --help and perldoc usage texts. As I worked through them I realized there was a lot of room for further improvement. I tried to be conservative making improvements but in some cases I couldn't help myself.

Tests:

  • A unit test is added to make sure --help work.
  • A unit test is added to make sure all POD is syntactically correct.

Documentation:

  • The --help text is longer now and formatted differently. This because we're using a different method of generating it and the details are taken from POD instead of Moose attributes.

Reviewing this PR

  • Inspect the help text and man page of both this branch and the develop branch looking details that have gone missing.

Testing this PR

  • Unit tests should pass.
  • Perform a limited amount of exploratory testing for edge cases like missing required arguments, unknown options, invalid arguments, or conflicting flags.

@mattias-p mattias-p added the V-Patch Versioning: The change gives an update of patch in version. label May 28, 2024
@mattias-p mattias-p added this to the v2024.1 milestone May 28, 2024
@matsduf
Copy link
Contributor

matsduf commented Jun 25, 2024

I guess .travis.yml should also be updated to match the update. The installation instruction also needs an update.

@mattias-p mattias-p marked this pull request as draft June 25, 2024 17:34
@mattias-p mattias-p force-pushed the 68-usage branch 4 times, most recently from a813fd4 to e56eec4 Compare July 1, 2024 09:33
@mattias-p
Copy link
Member Author

I've split out #381 from this PR and rebased this one on top of that one.

lib/Zonemaster/CLI.pm Outdated Show resolved Hide resolved
@matsduf
Copy link
Contributor

matsduf commented Nov 8, 2024

The man page starts with

zonemaster-cli --test=delegation/delegation01 --level=debug zonemaster.net

The easier and preferred format is

zonemaster-cli --test=delegation01 --level=debug zonemaster.net

@matsduf
Copy link
Contributor

matsduf commented Nov 8, 2024

zonemaster-cli -h gives brief information now, and that is fine, but I do not get any information on how to get full information. zonemaster-cli --help gives brief information. Is it possible to give it paged like a man page? perldoc Zonemaster::CLI gives no information. Maybe refer to man zonemaster-cli and zonemaster-cli --help?

@matsduf
Copy link
Contributor

matsduf commented Nov 8, 2024

I think zonemaster-cli with no argument should refer to some documentation like "--help".

@matsduf
Copy link
Contributor

matsduf commented Nov 8, 2024

zonemaster-cli --help gives less information than man zonemaster-cli. Preferably it should be the same, or the former refer to the latter. The man page comes from the script. Couldn't --help extract the POD from the script and show that paged? I know that is possible to achieve.

@mattias-p
Copy link
Member Author

The man page starts with

zonemaster-cli --test=delegation/delegation01 --level=debug zonemaster.net

The easier and preferred format is

zonemaster-cli --test=delegation01 --level=debug zonemaster.net

As I state in the PR description I'm deferring all improvements to the text. If you look at #389 you'll see that I update the SYNOPSIS section so that it declares the command line syntax instead of just a selection of examples.

matsduf
matsduf previously approved these changes Nov 11, 2024
@matsduf
Copy link
Contributor

matsduf commented Nov 11, 2024

@mattias-p, please look at issue #388. I think you are behind that code.

@mattias-p
Copy link
Member Author

@matsduf As you discovered I had forgotten to implement the --help aliases. I've force-pushed implementation and automatic test for that. Please review again.

Copy link
Contributor

@marc-vanderwal marc-vanderwal left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@mattias-p mattias-p merged commit cef20e9 into zonemaster:develop Nov 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V-Patch Versioning: The change gives an update of patch in version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants