From 124f4c06c2e2def1bdeca7cdf259900eb21c41af Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Apr 26 2018 08:31:46 +0000 Subject: Add man page for waiverdb-cli Sphinx generates man pages for waiverdb-cli(1) and waiverdb(7) which contains just REST API. --- diff --git a/docs/conf.py b/docs/conf.py index 6772736..a645ee5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -149,8 +149,10 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'waiverdb', u'WaiverDB Documentation', - [author], 1) + ('waiverdb-cli', 'waiverdb-cli', u'waiverdb-cli Documentation', + [author], 1), + ('api', 'waiverdb', u'WaiverDB Documentation', + [author], 7) ] diff --git a/docs/index.rst b/docs/index.rst index 68ee1b2..4ec38bc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,6 +10,7 @@ test results. developer-guide api + waiverdb-cli release-notes diff --git a/docs/waiverdb-cli.rst b/docs/waiverdb-cli.rst new file mode 100644 index 0000000..9631563 --- /dev/null +++ b/docs/waiverdb-cli.rst @@ -0,0 +1,73 @@ +============ +waiverdb-cli +============ + +Synopsis +======== + +``waiverdb-cli [OPTIONS]`` + +Description +=========== + +**waiverdb-cli** is a CLI tool for reading and modifying WaiverDB (companion service to +ResultsDB, for recording waivers against). + +Options +======= + +``-C, --config-file PATH`` + + Specify a config file to use. + +``-r, --result-id INTEGER`` + + Specify one or more results to be waived. + +``-s, --subject TEXT`` + + Specify one subject for a result to waive. + +``-t, --testcase TEXT`` + + Specify a testcase for the subject. + +``-p, --product-version TEXT`` + + Specify one of PDC's product version identifiers. + +``--waived / --no-waived`` + + Whether or not the result is waived. + +``-c, --comment TEXT`` + + A comment explaining why the result is waived. + +``-h, --help`` + + Print usage help and exit. + +Files +===== + +:file:`/usr/share/doc/waiverdb/client.conf.example` + + Template for configuration file. + +:file:`/etc/waiverdb/client.conf` + + Default configuration file. + +Examples +======== + +Waive test results with IDs 47 and 48 and specific product version:: + + waiverdb-cli -r 47 -r 48 -p "fedora-28" -c "This is fine" + +Waive test results with specific subject and product version:: + + waiverdb-cli -t dist.rpmdeplint \ + -s '{"item": "qclib-1.3.1-3.fc28", "type": "koji_build"}' \ + -p "fedora-28" -c "This is expected for non-x86 packages" diff --git a/waiverdb.spec b/waiverdb.spec index 077b150..9fb5212 100644 --- a/waiverdb.spec +++ b/waiverdb.spec @@ -112,7 +112,7 @@ sed -i 's/\.stg\.fedoraproject\.org/.fedoraproject.org/g' conf/client.conf.examp %build %if 0%{?fedora} || 0%{?rhel} > 7 %py3_build -make -C docs SPHINXOPTS= html text +make -C docs SPHINXOPTS= html man text %else %py2_build %endif @@ -141,6 +141,14 @@ install -m0644 \ conf/client.conf.example \ %{buildroot}%{_sysconfdir}/waiverdb/client.conf +install -D -m0644 \ + docs/_build/man/waiverdb-cli.1 \ + %{buildroot}%{_mandir}/man1/waiverdb-cli.1 + +install -D -m0644 \ + docs/_build/man/waiverdb.7 \ + %{buildroot}%{_mandir}/man7/waiverdb.7 + # Tests don't make sense here now that we require postgres to run them. #%%check #export PYTHONPATH=%%{buildroot}/%%{python3_sitelib} @@ -176,6 +184,8 @@ install -m0644 \ %endif %attr(755,root,root) %{_bindir}/waiverdb-cli %config(noreplace) %{_sysconfdir}/waiverdb/client.conf +%{_mandir}/man1/waiverdb-cli.1* +%{_mandir}/man7/waiverdb.7* %post %systemd_post %{name}.service