From f47b6c630923716ed1d15c133d3aa3256c6e1ba1 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 25 Jun 2022 10:08:20 -0400 Subject: [PATCH] Add a man page for the chardetect command --- chardetect.1 | 23 +++++++++++++++++++++++ python-chardet.spec | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 chardetect.1 diff --git a/chardetect.1 b/chardetect.1 new file mode 100644 index 0000000..31717c2 --- /dev/null +++ b/chardetect.1 @@ -0,0 +1,23 @@ +.TH CHARDETECT "1" "June 2022" "" "User Commands" +.SH NAME +.B chardetect +\(en takes one or more file paths and reports their detected encodings +.SH SYNOPSIS +.B chardetect +.RB [ \-h ] +.RB [ \-\-version ] +.RI [ input \ ...] +.SH OPTIONS +.SS "POSITIONAL ARGUMENTS" +.TP +.I input +File whose encoding we would like to determine. +(default: +.IR stdin ) +.SS "OPTIONAL ARGUMENTS" +.TP +.B \-h\fR, \fB\-\-help +show a help message and exit +.TP +.B \-\-version +show program\(cqs version number and exit diff --git a/python-chardet.spec b/python-chardet.spec index 68b209e..248cc39 100644 --- a/python-chardet.spec +++ b/python-chardet.spec @@ -15,6 +15,8 @@ Summary: Character encoding auto-detection in Python License: LGPLv2+ URL: https://github.com/chardet/chardet Source0: %{pypi_source chardet} +# Hand-written for Fedora in groff_man(7) format based on --help output +Source1: chardetect.1 BuildArch: noarch @@ -59,6 +61,7 @@ grep -lr "^#\!/usr/bin/env python" chardet/ | xargs sed -i "1d" %install %pyproject_install %pyproject_save_files chardet +install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}' %if %{with tests} @@ -71,6 +74,7 @@ grep -lr "^#\!/usr/bin/env python" chardet/ | xargs sed -i "1d" %license LICENSE %doc README.rst %{_bindir}/chardetect +%{_mandir}/man1/chardetect.1* %changelog