click-man
click-man copied to clipboard
Add '--man-version', '--man-date' parameters
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:
- Move the main CLI functionality to a new module,
click_man.shell
, so it can be tested. - Add tests for existing functionality
- Add the new functionality, along with tests
- Resolve issues with Travis, since the tests now expect the package to be installed
Resolves: #38
Rebased. Is anyone interested in this? I can abandon if not.