summaryrefslogtreecommitdiff
path: root/tools/publish.py
blob: 539548911de197a59118e0e629bf1bc792c6c42d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python

"""
:Author: David Goodger
:Contact: goodger@users.sourceforge.net
:Revision: $Revision$
:Date: $Date$
:Copyright: This module has been placed in the public domain.

A minimal front-end to the Docutils Publisher.

This module takes advantage of the default values defined in `publish()`.
"""

import sys
from docutils.core import publish


if len(sys.argv) == 2:
    publish(source=sys.argv[1])
elif len(sys.argv) == 3:
    publish(source=sys.argv[1], destination=sys.argv[2])
elif len(sys.argv) > 3:
    print >>sys.stderr, 'Maximum 2 arguments allowed.'
    sys.exit(1)
else:
    publish()