~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to generate_docs.py

  • Committer: Martin Pool
  • Date: 2006-03-03 08:46:31 UTC
  • mto: This revision was merged to the branch mainline in revision 1593.
  • Revision ID: mbp@sourcefrog.net-20060303084631-ec3a92888fd7e1da
doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
3
3
# Copyright 2005 Canonical Ltd.
4
 
#
 
4
 
5
5
# This program is free software; you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
7
7
# the Free Software Foundation; either version 2 of the License, or
8
8
# (at your option) any later version.
9
 
#
 
9
 
10
10
# This program is distributed in the hope that it will be useful,
11
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
13
# GNU General Public License for more details.
14
 
#
 
14
 
15
15
# You should have received a copy of the GNU General Public License
16
16
# along with this program; if not, write to the Free Software
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 
19
18
"""%(prog)s - generate information from built-in bzr help
20
19
 
21
20
%(prog)s creates a file with information on bzr in one of
39
38
import tools.doc_generate
40
39
 
41
40
def main(argv):
42
 
    parser = OptionParser(usage="""%prog [options] OUTPUT_FORMAT
43
 
 
44
 
Available OUTPUT_FORMAT:
45
 
 
46
 
    man              man page
47
 
    rstx             man page in ReStructuredText format
48
 
    bash_completion  bash completion script""")
 
41
    parser = OptionParser(usage="%prog [options] OUTPUT_FORMAT")
49
42
 
50
43
    parser.add_option("-s", "--show-filename",
51
44
                      action="store_true", dest="show_filename", default=False,
83
76
        outfile = open(outfilename,"w")
84
77
 
85
78
    if options.show_filename and (outfilename != "-"):
86
 
        sys.stdout.write(outfilename)
87
 
        sys.stdout.write('\n')
 
79
        print >>sys.stdout, outfilename
88
80
    
89
81
    infogen_mod.infogen(options, outfile)
90
82
 
94
86
    Prints out the examples stored in the docstring. 
95
87
 
96
88
    """
97
 
    sys.stdout.write(__doc__ % {"prog":sys.argv[0]})
98
 
    sys.stdout.write('\n')
 
89
    print >>sys.stdout, __doc__ % {"prog":sys.argv[0]}
99
90
    sys.exit(0)
100
91
 
101
92
if __name__ == '__main__':