Skip to content

Commit 5498794

Browse files
authored
docs: document more detailed usage with manual pages for even better reference (#8)
1 parent 701e900 commit 5498794

File tree

5 files changed

+73
-0
lines changed

5 files changed

+73
-0
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ jobs:
2323
nix develop -c goreleaser release --clean
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
- name: Include documentation
27+
run: |
28+
TAG="${{ github.ref_name }}"
29+
VERSION="${TAG#v}"
30+
gh release upload "$TAG" man/git-coverage.1#git-coverage_"$VERSION"_man.1
31+
env:
32+
GH_TOKEN: ${{ github.token }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ to [Semantic Versioning][semver].
1010
### Added
1111

1212
- Print usage details to standard output if a help flag is used in command.
13+
- Document more detailed usage with manual pages for even better reference.
1314

1415
### Maintenance
1516

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,12 @@ Options are available for customization:
2020

2121
Add a build to `$PATH` for automatic detection.
2222

23+
Read manual pages:
24+
25+
```sh
26+
$ cp ./man/git-coverage.1 /usr/local/share/man/man1/
27+
$ mandb
28+
$ man git-coverage
29+
```
30+
2331
[codecov]: https://about.codecov.io

flake.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@
2222
version = "unversioned";
2323
src = ./.;
2424
nativeBuildInputs = [
25+
pkgs.installShellFiles
2526
pkgs.zig.hook
2627
];
2728
zigBuildFlags = [ "-Doptimize=ReleaseSmall" ];
29+
installPhase = ''
30+
mkdir -p $out/bin
31+
cp zig-out/bin/git-coverage $out/bin/
32+
installManPage man/git-coverage.1
33+
'';
2834
};
2935
devShells.default = pkgs.mkShell {
3036
packages = [

man/git-coverage.1

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.TH GIT-COVERAGE "1" "2025-05-10" "git-coverage 0.1.0" "Git Manual"
2+
.
3+
.SH NAME
4+
git-coverage \- Open test coverage uploaded to \fBcodecov\fP in a web browser.
5+
.
6+
.
7+
.SH SYNOPSIS
8+
.B
9+
git coverage [\fIoptions\fP]
10+
.
11+
.
12+
.SH DESCRIPTION
13+
The \fBgit-coverage\fP program opens test coverage results uploaded to \fBcodecov\fP using \fIgit-remote\fP(1) details.
14+
.
15+
.
16+
.SH OPTIONS
17+
.
18+
.IP "-h, --help"
19+
Print these usage details.
20+
.
21+
.
22+
.SH EXIT STATUS
23+
An exit code of \fB0\fP is returned if a link to coverage results on \fBcodecov\fP can be constructed.
24+
.sp 2
25+
If the browser cannot be opened a link to coverage results is output to \fBstdout\fP before exiting.
26+
.sp 2
27+
Errors in \fIgit\fP(1) configurations or provided flag \fIoptions\fP exits with a non-zero error code.
28+
.
29+
.
30+
.SH STANDARDS
31+
The latest release of \fBgit\fP is recommended.
32+
.
33+
.
34+
.SH HISTORY
35+
\fIhttps://github.com/zimeg/git-coverage/releases/\fP
36+
.
37+
.
38+
.SH EXAMPLES
39+
.
40+
.IP "$ git coverage"
41+
Open test coverage results for the current project in a web browser.
42+
.
43+
.
44+
.SH REPORTING BUGS
45+
\fIhttps://github.com/zimeg/git-coverage/issues/\fP
46+
.
47+
.
48+
.SH SEE ALSO
49+
\fIgit-remote\fP(1)
50+
.nf
51+
\fIhttps://about.codecov.io/\fP

0 commit comments

Comments
 (0)