click-man icon indicating copy to clipboard operation
click-man copied to clipboard

Add '--man-version', '--man-date' parameters

Open stephenfin opened this issue 4 years ago • 1 comments

I store generated man pages in git. While auto-generated files generally aren't stored in version control, there are some advantages to this, chief among them being ease of packaging. Unfortunately, for projects that use something like setuptools-scm, there doesn't currently appear to be an easy way to generate these man pages ahead of time since the version information is retrieved from the dist.version attribute of the given command's EntryPoint. This means your generated man pages have versions like 1.2.3.dev4 when we want 1.2.4.

The solution is easy. Add a --man-version parameter (so named because --version is already taken), allowing you to configure this manually. For completeness, we also add a --man-date parameter, allowing you to configure the other dynamic property of these man pages. There are four steps necessary to achieve this:

  1. Move the main CLI functionality to a new module, click_man.shell, so it can be tested.
  2. Add tests for existing functionality
  3. Add the new functionality, along with tests
  4. Resolve issues with Travis, since the tests now expect the package to be installed

Resolves: #38

stephenfin avatar Apr 17 '20 18:04 stephenfin

Rebased. Is anyone interested in this? I can abandon if not.

stephenfin avatar Jul 01 '22 11:07 stephenfin