Skip to content

feat(cli): add man page generation via make manpage#73

Open
Kshitij-K-Singh wants to merge 1 commit into
optiqor:mainfrom
Kshitij-K-Singh:feat/man-pages
Open

feat(cli): add man page generation via make manpage#73
Kshitij-K-Singh wants to merge 1 commit into
optiqor:mainfrom
Kshitij-K-Singh:feat/man-pages

Conversation

@Kshitij-K-Singh
Copy link
Copy Markdown

What

Add make manpage target to generate man pages for all CLI commands using Cobra's built-in doc.GenManTree.

Why

Distribution of kerno as a system tool (deb/rpm/Homebrew) expects /usr/share/man/man1/kerno.1.gz to exist. Cobra's doc package auto-generates man pages from the command tree — always in sync, no hand-written troff.

Fixes #15

How

  • Created cmd/kerno-mangen/main.go using cobra/doc.GenManTree
  • Post-processes generated files to use hyphen-separated names (kerno-doctor.1 instead of kernodoctor.1)
  • Added manpage: target to Makefile
  • Added docs/man/*.1 to .gitignore (regeneratable artifacts)
  • Updated README with make manpage in build targets
  • No new runtime dependencies — github.com/spf13/cobra/doc is already part of the cobra module

Testing

  • go build ./... passes
  • go test ./... passes
  • go vet ./... passes
  • golangci-lint run ./... passes
  • Tested locally with:
  • N/A — pure docs/refactor
  • sudo ./bin/bpf-verify --read 5s confirms 6/6 programs still load
  • ./scripts/verify.sh passes (or specific phase: ./scripts/verify.sh quality)

Checklist

  • PR title follows Conventional Commits (feat(scope): subject)
  • All commits are DCO-signed (git commit -s)
  • No unrelated changes pulled in
  • Documentation updated where user-visible behavior changed
  • Added/updated tests for new code paths
  • If a new doctor rule, paired with a chaos scenario in scripts/verify.sh

Signed-off-by: Kshitij-K-Singh <kshitijk.singh.min24@itbhu.ac.in>
@github-actions
Copy link
Copy Markdown

🚀 First PR — welcome aboard!

A few things to expect:

  1. CI: every PR runs build + race tests + lint + (eventually) the kernel matrix. If something fails, the log will tell you exactly which gate.
  2. DCO: every commit needs Signed-off-by:git commit -s adds it automatically.
  3. Conventional Commits: PR titles like feat(doctor): add new rule or fix(bpf): handle X. We squash-merge by default.
  4. Review: a maintainer will review within 72 hours. Suggestions are conversations, not orders — push back if something doesn't fit your context.

If you get stuck, reply here or jump to Discussions. We want this PR to land.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 15, 2026
@btwshivam
Copy link
Copy Markdown
Member

btwshivam commented May 15, 2026

add screenshort of manpage.. ill then review techinal part

@Kshitij-K-Singh
Copy link
Copy Markdown
Author

Kshitij-K-Singh commented May 16, 2026

image Attached the screenshot @btwshivam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tooling: Add make manpage to generate Linux man pages from Cobra commands

2 participants