Add '--man-version', '--man-date' parameters #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thedist.version
attribute of the given command'sEntryPoint
. This means your generated man pages have versions like1.2.3.dev4
when we want1.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:click_man.shell
, so it can be tested.Resolves: #38