Skip to content

Commit

Permalink
man pages
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jan 31, 2018
1 parent 10cf28e commit 27d22b3
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 1 deletion.
1 change: 1 addition & 0 deletions MANIFEST.in
Expand Up @@ -9,3 +9,4 @@ recursive-include gitfame/tests *.py

# Examples/Documentation
include README.rst
include git-fame.1
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -117,3 +117,9 @@ none:

run:
python -Om gitfame

git-fame.1: git-fame.1.md
python -m gitfame --help | tail -n+9 | head -n-2 | cat "$<" - |\
sed -r 's/^ (--\S+) (\S+)\s*(.*)$$/\n\\\1=*\2*\n: \3/' |\
sed -r 's/^ (-\S+, -\S+)\s*/\n\1\n: /' |\
pandoc -o "$@" -s -t man
122 changes: 122 additions & 0 deletions git-fame.1
@@ -0,0 +1,122 @@
.\" Automatically generated by Pandoc 1.19.2.1
.\"
.TH "GIT\-FAME" "1" "2017\-2018" "git\-fame User Manuals" ""
.hy
.SH NAME
.PP
git\-fame \- Pretty\-print \f[C]git\f[] repository collaborators sorted
by contributions.
.SH SYNOPSIS
.PP
gitfame [\-\-help | \f[I]options\f[]] [<\f[I]gitdir\f[]>]
.SH DESCRIPTION
.PP
See <https://github.com/casperdcl/git-fame>.
.PP
Probably not necessary on UNIX systems:
.IP
.nf
\f[C]
git\ config\ \-\-global\ alias.fame\ "!python\ \-m\ gitfame"
\f[]
.fi
.PP
For example, to print statistics regarding all source files in a
C++/CUDA repository (\f[C]*.c/h/t(pp),\ *.cu(h)\f[]), carefully handling
whitespace and line copies:
.IP
.nf
\f[C]
git\ fame\ \-\-incl\ \[aq]\\.[cht][puh]{0,2}$\[aq]\ \-twMC
\f[]
.fi
.SH OPTIONS
.TP
.B <gitdir>
[default: ./]
.RS
.RE
.TP
.B \-h, \-\-help
show this help message and exit
.RS
.RE
.TP
.B \-\-sort=\f[I]key\f[]
[default: loc]|commits|files.
.RS
.RE
.TP
.B \-t, \-\-bytype
Show stats per file extension [default: False].
.RS
.RE
.TP
.B \-M, \-M
Detect intra\-file line moves and copies [default: False].
.RS
.RE
.TP
.B \-w, \-\-ignore\-whitespace
.IP
.nf
\f[C]
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Ignore\ whitespace\ when\ comparing\ the\ parent\[aq]s\ version
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ and\ the\ child\[aq]s\ to\ find\ where\ the\ lines\ came\ from
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [default:\ False].
\f[]
.fi
.RS
.RE
.TP
.B \-\-incl=\f[I]f\f[]
Included files [default: .*].
See \f[C]\-\-excl\f[] for format.
.RS
.RE
.TP
.B \-s, \-\-silent\-progress
.IP
.nf
\f[C]
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Suppress\ `tqdm`\ [default:\ False].
\f[]
.fi
.RS
.RE
.TP
.B \-\-branch=\f[I]b\f[]
Branch or tag [default: HEAD].
.RS
.RE
.TP
.B \-v, \-\-version
show program\[aq]s version number and exit
.RS
.RE
.TP
.B \-C, \-C
Detect inter\-file line moves and copies [default: False].
.RS
.RE
.TP
.B \-\-excl=\f[I]f\f[]
Excluded files (default: None).
In no\-regex mode, may be a comma\-separated list.
Escape (,) for a literal comma (may require \\, in shell).
.RS
.RE
.TP
.B \-\-log=\f[I]lvl\f[]
FATAL|CRITICAL|ERROR|WARN(ING)|[default: INFO]|DEBUG|NOTSET.
.RS
.RE
.TP
.B \-n, \-\-no\-regex
Assume are comma\-separated exact matches rather than regular
expressions [default: False].
NB: if regex is enabled \f[C],\f[] is equivalent to \f[C]|\f[].
.RS
.RE
.SH AUTHORS
Casper da Costa\-Luis <https://github.com/casperdcl>.
34 changes: 34 additions & 0 deletions git-fame.1.md
@@ -0,0 +1,34 @@
% GIT-FAME(1) git-fame User Manuals
% Casper da Costa-Luis <https://github.com/casperdcl>
% 2017-2018

# NAME

git-fame - Pretty-print `git` repository collaborators sorted by contributions.

# SYNOPSIS

gitfame [--help | *options*] [<*gitdir*>]

# DESCRIPTION

See <https://github.com/casperdcl/git-fame>.

Probably not necessary on UNIX systems:

```sh
git config --global alias.fame "!python -m gitfame"
```

For example, to print statistics regarding all source files in a C++/CUDA
repository (``*.c/h/t(pp), *.cu(h)``), carefully handling whitespace and line
copies:

```sh
git fame --incl '\.[cht][puh]{0,2}$' -twMC
```

# OPTIONS

\<gitdir>
: [default: ./]
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -178,7 +178,6 @@ def execute_makefile_commands(commands, alias, verbose=False):
fndoc = os.path.join(os.path.dirname(__file__), 'README.rst')
with io_open(fndoc, mode='r', encoding='utf-8') as fd:
README_rst = fd.read()

setup(
name='git-fame',
version=__version__,
Expand All @@ -195,6 +194,7 @@ def execute_makefile_commands(commands, alias, verbose=False):
provides=['gitfame'],
install_requires=['argopt>=0.3.5'],
entry_points={'console_scripts': ['git-fame=gitfame:main'], },
data_files=[('man/man1', ['git-fame.1'])],
ext_modules=cythonize(["gitfame/_gitfame.py", "gitfame/_utils.py"],
nthreads=2),
classifiers=[
Expand Down

0 comments on commit 27d22b3

Please sign in to comment.