summaryrefslogtreecommitdiffstats
path: root/commands/service/doc/Makefile
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-09-28 15:46:45 +0200
committerMichal Minar <miminar@redhat.com>2013-09-28 16:44:40 +0200
commit5c06e633987e982af476b44afd1284d9780f74d3 (patch)
treefc1d090da237ec0abd20944a73e23fabf54126bd /commands/service/doc/Makefile
parent30315e94cedff6e9ba29504d759cacb330accbeb (diff)
downloadopenlmi-scripts-5c06e633987e982af476b44afd1284d9780f74d3.tar.gz
openlmi-scripts-5c06e633987e982af476b44afd1284d9780f74d3.tar.xz
openlmi-scripts-5c06e633987e982af476b44afd1284d9780f74d3.zip
improved makefiles for generating cmd line doc
Determine the command names from setup.py for particular command libraries. Updated storage command line documentation.
Diffstat (limited to 'commands/service/doc/Makefile')
-rw-r--r--commands/service/doc/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/commands/service/doc/Makefile b/commands/service/doc/Makefile
index 39f6e65..bb6edb1 100644
--- a/commands/service/doc/Makefile
+++ b/commands/service/doc/Makefile
@@ -6,6 +6,7 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
+COMMAND_NAME := service
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
@@ -46,14 +47,20 @@ help:
cmdregen: cmdline.generated
cmdline.generated:
+ if ! python -c 'import lmi.scripts.$(COMMAND_NAME)' >/dev/null; then \
+ echo "Please install install the command library first." >&2; \
+ exit 1; \
+ fi
( \
echo ".."; \
echo " !!!!!!!!!"; \
echo " This is generated file. Use 'make cmdregen' to regenerate it from installed 'lmi help XXX'"; \
echo " !!!!!!!!!"; \
echo ; \
- for i in service; \
- do lmi help $$i | python ../../../tools/help2rst $$i | tr -d '\033' |sed 's/..1034h//' ; \
+ for i in `sed -n '/entry_points/,/)/p' ../setup.py | \
+ sed -n "s/\s*,\?['\"]\s*\([a-z-]\+\)\s*=.*/\1/p"`; do \
+ lmi help $$i | python ../../../tools/help2rst $$i | \
+ tr -d '\033' |sed 's/..1034h//'; \
done \
) > $@