From: Étienne BERSAC Date: Thu, 21 Sep 2017 09:41:16 +0000 (+0200) Subject: Update synopsis from --help in pod X-Git-Tag: v10.0~32^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=243299409816f5940f2b775165d1736bb1253be1;p=pgbadger Update synopsis from --help in pod --- diff --git a/.circleci/config.yml b/.circleci/config.yml index f964e67..b1724ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,9 +28,9 @@ jobs: name: Check README is up to date with pod command: | perl Makefile.PL - touch --no-create doc/pgBadger.pod + touch --no-create pgbadger make README - git diff --exit-code + git diff --exit-code README doc/pgBadger.pod workflows: version: 2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 312bf81..dc7692c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,3 +13,13 @@ pgBadger project provides a [.editorconfig](http://editorconfig.org/) file to setup consistent spacing in files. Please follow it! + + +## Keep Documentation Updated + +The first pgBadger documentation is `pgbadger --help`. `--help` is +injected in `doc/pgBadger.pod`. `README` is the text formatting of +`doc/pgBadger.pod`. Update `README` and `doc/pgBadger.pod` with `make +README`. + +A job in CI ensure all versionned documentations are consistent. diff --git a/Makefile.PL b/Makefile.PL index e7d5926..753ce9f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -39,6 +39,18 @@ sub MY::postamble { return <<'EOMAKE'; README: doc/pgBadger.pod pod2text $^ > $@ + +.INTERMEDIATE: doc/synopsis.pod +doc/synopsis.pod: Makefile pgbadger + echo "=head1 SYNOPSIS" > $@ + ./pgbadger --help >> $@ + echo "=head1 DESCRIPTION" >> $@ + sed -i 's/ +$$//g' $@ + +doc/pgBadger.pod: doc/synopsis.pod Makefile + git checkout $@ + sed -i '/^=head1 SYNOPSIS/,/^=head1 DESCRIPTION/d' $@ + sed -i '4r $<' $@ EOMAKE }