Skip to content

Feature/add manpages#9

Merged
xenOs76 merged 5 commits intomainfrom
feature/add_manpages
Nov 21, 2025
Merged

Feature/add manpages#9
xenOs76 merged 5 commits intomainfrom
feature/add_manpages

Conversation

@xenOs76
Copy link
Copy Markdown
Owner

@xenOs76 xenOs76 commented Nov 21, 2025

Summary by CodeRabbit

  • Documentation

    • Expanded help and examples for certinfo, requests, and the main command; improved usage guidance.
    • Added CLI-driven man page generation and ensured generated man pages are included in release artifacts.
  • Chores

    • Updated ignore rules to skip generated manpages and added packaging/installation steps for man pages.
    • Added tooling dependencies to support man page generation.
  • Tests

    • Added a test step to display the sample requests config during test runs.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 21, 2025

Walkthrough

Adds a hidden CLI command to generate man pages, includes generated manpages in release packaging (archives, NFPM, Docker/Homebrew/Nix), updates command help text, adjusts dev/test scripts and .gitignore, and adds manpage-generation dependencies.

Changes

Cohort / File(s) Summary
Manpage CLI command
cmd/man.go
New hidden Cobra subcommand man that generates man pages using a GenManHeader and GenManTree with a --dest-dir flag.
Release packaging & config
\.goreleaser\.yaml
Activates manpage generation in before hooks; changes archives to include manpages/*; explicitly lists generated manpages in NFPM, Homebrew/Docker manifests, and Nix install steps.
Repository ignore
\.gitignore
Adds manpages entry.
Command help text updates
cmd/certinfo.go, cmd/requests.go, cmd/root.go
Expanded and clarified Long/Help strings and examples for root, certinfo, and requests commands (no signature or runtime behavior changes).
Dev environment & tests
devenv.nix
Changes git-hooks exclude from completions to completions/*; adds scripts.test-requests-show-sample-config.exec and integrates it into test sequences.
Module deps for man generation
go.mod
Adds indirect requires for github.com/cpuguy83/go-md2man/v2 and github.com/russross/blackfriday/v2.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer / CI
  participant CLI as https-wrench (cobra rootCmd)
  participant Gen as go-md2man / GenManTree
  participant FS as Filesystem (manpages/)
  participant Release as goreleaser

  Dev->>CLI: run `https-wrench man --dest-dir=manpages`
  CLI->>Gen: build GenManHeader & call GenManTree(rootCmd, dest)
  Gen->>FS: write generated .1 files (and .1.gz)
  Note right of FS: manpages/ now contains generated pages

  Dev->>Release: run goreleaser
  Release->>FS: before hooks generate manpages (if not present)
  Release->>Release: include `manpages/*` in archives, NFPM, Homebrew, Docker, Nix artifacts
  Release->>Users: release artifacts include manpages
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to:
    • .goreleaser.yaml — verify exact generated filenames and target install paths (e.g., /usr/share/man/man1/) match entries.
    • cmd/man.go — ensure GenManHeader fields and destination flag produce expected compressed outputs.
    • devenv.nix — confirm the new test script is stable in CI/test runs.

Possibly related PRs

Poem

🐇 I hop and carve each manual page,
Into manpages, neat and sage,
Compressed and bundled for release,
A tiny wrench that guides with ease,
Hooray — the docs are on the stage!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feature/add manpages' directly describes the main change in the pull request, which is the addition of manual page generation and packaging across the build system and documentation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/add_manpages

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b829cc8 and 29c77f3.

📒 Files selected for processing (2)
  • cmd/requests.go (1 hunks)
  • cmd/root.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • cmd/requests.go
  • cmd/root.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
cmd/man.go (1)

40-41: Consider default directory alignment with build process.

The default destination directory is "." (current directory), but the build process uses "manpages" (as seen in .goreleaser.yaml line 28-29). Consider whether defaulting to "manpages" would be more consistent, though the current approach offers flexibility.

If you prefer consistency with the build process, apply this diff:

 	manCmd.Flags().StringVar(&manPagesDestDir, "dest-dir",
-		".", "Destination directory for the man pages files")
+		"manpages", "Destination directory for the man pages files")
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3447dcc and 7263fc2.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • .gitignore (1 hunks)
  • .goreleaser.yaml (5 hunks)
  • cmd/certinfo.go (1 hunks)
  • cmd/man.go (1 hunks)
  • cmd/requests.go (1 hunks)
  • cmd/root.go (1 hunks)
  • devenv.nix (3 hunks)
  • go.mod (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-15T17:16:55.051Z
Learnt from: xenOs76
Repo: xenOs76/https-wrench PR: 5
File: devenv.nix:569-569
Timestamp: 2025-11-15T17:16:55.051Z
Learning: In the xenOs76/https-wrench repository, the devenv.nix test environment is local-only without GitHub CI integration, so automatic dependency updates in enterTest are acceptable for the maintainer's workflow.

Applied to files:

  • devenv.nix
📚 Learning: 2025-11-08T16:00:48.187Z
Learnt from: xenOs76
Repo: xenOs76/https-wrench PR: 3
File: internal/requests/requests.go:164-182
Timestamp: 2025-11-08T16:00:48.187Z
Learning: In the https-wrench tool (xenOs76/https-wrench repository), do not enforce minimum TLS version constraints in the HTTP client configuration. The tool is designed to inspect and test TLS settings on various servers, including legacy ones, and needs the flexibility to connect to servers with older TLS versions.

Applied to files:

  • cmd/root.go
🔇 Additional comments (13)
cmd/requests.go (1)

27-42: LGTM! Enhanced documentation improves usability.

The expanded help text provides clear guidance on configuration, sample generation, and includes helpful external references. The examples demonstrate practical usage patterns effectively.

cmd/certinfo.go (1)

23-48: LGTM! Documentation improvements enhance clarity.

The updated help text better describes certinfo capabilities (fetching from TLS endpoints, reading PEM bundles, verifying key-certificate matches) with clear, consistent examples.

.gitignore (1)

5-5: LGTM! Correctly ignores generated manpages directory.

This aligns with the manpage generation feature introduced in this PR, as manpages are generated during the build process (as seen in .goreleaser.yaml).

cmd/man.go (1)

17-36: LGTM! Clean implementation of manpage generation.

The command correctly uses Cobra's doc.GenManTree to generate manpages. The command is appropriately hidden since it's primarily for build-time use. The metadata in GenManHeader is properly configured.

devenv.nix (3)

40-40: LGTM! More explicit git-hooks exclude pattern.

The change from "completions" to "completions/*" makes the exclusion pattern more explicit, ensuring all files under the completions directory are excluded from git hooks.


241-244: LGTM! Test coverage for sample config display.

The new test verifies that the --show-sample-config flag correctly outputs the sample configuration with expected content (containing 'requests:').


512-512: LGTM! Test properly integrated into the test suite.

The new test script is correctly added to the requests test suite execution flow.

.goreleaser.yaml (5)

27-30: LGTM! Manpage generation integrated into build process.

The before hooks correctly generate manpages using the new man command and compress them with gzip, making them ready for distribution.


52-52: LGTM! Archive configuration updated for new manpages directory.

The path correctly references the manpages/* directory that's created in the before hooks.


73-92: LGTM! Comprehensive manpage packaging for Linux distributions.

All generated manpages are correctly mapped to their installation destinations under /usr/share/man/man1/. This includes manpages for:

  • Main command (https-wrench)
  • Subcommands (requests, certinfo)
  • Completion commands (bash, fish, zsh)

157-160: LGTM! Homebrew manpages configuration.

The manpages section correctly lists the primary manpages for inclusion in the Homebrew cask package.


178-180: LGTM! Nix manpage installation.

The installManPage commands correctly install the primary manpages (main command and subcommands) for the Nix package.

go.mod (1)

32-32: No security vulnerabilities detected for the indirect dependencies.

The verification confirms that both github.com/cpuguy83/go-md2man/v2 v2.0.6 and github.com/russross/blackfriday/v2 are free from known security advisories in the GitHub vulnerability database. The indirect dependencies supporting manpage generation via github.com/spf13/cobra/doc are safe to use.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
cmd/root.go (1)

54-54: Fix typo in subcommand name (duplicate concern).

Line 54 still contains "certfinfo" which should be "certinfo" to match the actual subcommand name.

Apply this diff to fix the typo:

-https-wrench has two sub commands: requests and certfinfo.
+https-wrench has two sub commands: requests and certinfo.
🧹 Nitpick comments (2)
cmd/root.go (2)

59-60: Minor grammar improvement.

Line 59 uses "allows to easily read" which is grammatically awkward. Consider rephrasing for better readability.

Apply this diff for a clearer phrasing:

-certinfo is a sub command that allows to easily read information from PEM certificates and keys. The 
+certinfo is a sub command that reads information from PEM certificates and keys. The

Alternatively:

-certinfo is a sub command that allows to easily read information from PEM certificates and keys. The 
+certinfo is a sub command that allows you to easily read information from PEM certificates and keys. The

54-59: Consider standardizing "subcommand" terminology.

The description uses "sub commands" and "sub command" (two words) throughout lines 54, 56, and 59. The standard term in CLI documentation and Cobra is "subcommand" (one word).

Consider this diff to standardize the terminology:

-https-wrench has two sub commands: requests and certinfo.
+https-wrench has two subcommands: requests and certinfo.

-requests is the sub command that does HTTPS requests according to the configuration provided 
+requests is the subcommand that does HTTPS requests according to the configuration provided

-certinfo is a sub command that allows to easily read information from PEM certificates and keys. The 
+certinfo is a subcommand that allows to easily read information from PEM certificates and keys. The
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7263fc2 and b829cc8.

📒 Files selected for processing (1)
  • cmd/root.go (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-08T16:00:48.187Z
Learnt from: xenOs76
Repo: xenOs76/https-wrench PR: 3
File: internal/requests/requests.go:164-182
Timestamp: 2025-11-08T16:00:48.187Z
Learning: In the https-wrench tool (xenOs76/https-wrench repository), do not enforce minimum TLS version constraints in the HTTP client configuration. The tool is designed to inspect and test TLS settings on various servers, including legacy ones, and needs the flexibility to connect to servers with older TLS versions.

Applied to files:

  • cmd/root.go

@xenOs76 xenOs76 merged commit ccdfeab into main Nov 21, 2025
2 checks passed
@xenOs76 xenOs76 self-assigned this Dec 14, 2025
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.

1 participant