more human-readable output in usage generation

This commit is contained in:
Antoine Beaupré 2015-09-30 17:42:18 -04:00
parent e3433f433c
commit 50e7d0f345
2 changed files with 14 additions and 7 deletions

View File

@ -145,10 +145,11 @@ usage: $(shell borg help | grep -A1 "Available commands:" | tail -1 | sed 's/[{}
# generate help file based on usage
usage/%.rst.inc: ../borg/archiver.py
printf ".. _borg_$*:\n\n" > $@
printf "borg $*\n" >> $@
echo -n borg $* | tr 'a-z- ' '-' >> $@
printf "\n::\n\n" >> $@
borg help $* --usage-only | sed -e 's/^/ /' >> $@
printf "\nDescription\n~~~~~~~~~~~\n" >> $@
borg help $* --epilog-only >> $@
@echo generating usage for $*
@printf ".. _borg_$*:\n\n" > $@
@printf "borg $*\n" >> $@
@echo -n borg $* | tr 'a-z- ' '-' >> $@
@printf "\n::\n\n" >> $@
@borg help $* --usage-only | sed -e 's/^/ /' >> $@
@printf "\nDescription\n~~~~~~~~~~~\n" >> $@
@borg help $* --epilog-only >> $@

6
docs/api.rst Normal file
View File

@ -0,0 +1,6 @@
Borg Backup API documentation
=============================
.. automodule:: borg
:members:
:undoc-members: