Skip to content

refactor: migrate man page generation to cargo xtask#109

Merged
avihut merged 3 commits intomasterfrom
no-user-facing-man-command
Jan 28, 2026
Merged

refactor: migrate man page generation to cargo xtask#109
avihut merged 3 commits intomasterfrom
no-user-facing-man-command

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Jan 28, 2026

Summary

  • Move man page generation from user-facing daft man command to cargo xtask pattern
  • Man pages are now pre-generated and committed to man/ directory
  • Remove clap_mangen from main binary dependencies (moved to xtask only)
  • Add CI verification that committed man pages stay in sync with code

Changes

New files:

  • xtask/Cargo.toml - New package for development automation
  • xtask/src/main.rs - gen-man subcommand implementation with tests

Key modifications:

  • Cargo.toml - Added workspace config, removed clap_mangen
  • src/lib.rs - Expose commands module for xtask access
  • src/commands/mod.rs - Remove man module
  • justfile - Updated gen-man, install-man; added verify-man
  • .github/workflows/test.yml - Add xtask-test job
  • .github/workflows/release.yml - Install pre-generated man pages in Homebrew

Deleted:

  • src/commands/man.rs - User-facing man page generation

Test plan

  • cargo test --lib passes (excluding network-dependent tests)
  • cargo test --package xtask passes
  • cargo clippy -- -D warnings passes
  • cargo fmt -- --check passes
  • just gen-man generates all 11 man pages
  • just verify-man confirms man pages are up-to-date
  • CI xtask-test job verifies man page freshness
  • CI homebrew-simulation uses pre-generated man pages

🤖 Generated with Claude Code

avihut and others added 2 commits January 28, 2026 12:14
Move man page generation from user-facing `daft man` command to a cargo
xtask pattern. Man pages are now pre-generated and committed to the
repository.

Key changes:
- Create xtask package with gen-man subcommand
- Convert to Cargo workspace with xtask member
- Expose commands module from library for xtask access
- Pre-generate all 11 man pages in man/ directory
- Remove daft man command from main binary
- Move clap_mangen dependency to xtask only
- Update Homebrew formula to install pre-generated man pages
- Add xtask-test job to CI for verification
- Update justfile with gen-man, install-man, verify-man recipes

Benefits:
- Smaller release binary (clap_mangen not bundled)
- Simpler user experience (no need to generate man pages)
- CI verification that man pages stay in sync with code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove /man/ from .gitignore to allow committing pre-generated man pages
- Add all 11 pre-generated man pages to repository
- Mark remote.rs tests as #[ignore] since they require network access
  to the origin remote which is not available in CI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@avihut avihut self-assigned this Jan 28, 2026
@avihut avihut added refactor Code refactoring ci CI/CD changes chore Maintenance tasks labels Jan 28, 2026
In CI environments with parallel test execution, the current directory
might become invalid if another test deletes its temp directory. Update
test_current_directory to gracefully handle this case.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@avihut avihut merged commit 42da343 into master Jan 28, 2026
5 checks passed
@avihut avihut deleted the no-user-facing-man-command branch January 28, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance tasks ci CI/CD changes refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant