7 * Add @nodes, plit at sections?
8 * Less kludged first introduction file
9 * include *.texi files for text at start of section?
19 program_name = 'lys-to-tely'
22 sys.stdout.write (r"""Usage: lys-to-tely [OPTIONS]... LY-FILE...
23 Construct tely doc from LY-FILEs.
26 -h, --help print this help
27 -o, --output=NAME write tely doc to NAME
28 -t, --title=TITLE set tely doc title TITLE
33 (options, files) = getopt.getopt(sys.argv[1:], 'hn:t:', [
34 'help', 'name=', 'title='])
41 if o == '-h' or o == '--help':
43 elif o == '-n' or o == '--name':
45 elif o == '-t' or o == '--title':
48 raise 'unknown opt ', o
50 def strip_extension (f, ext):
51 (p, e) = os.path.splitext (f)
57 dir = os.path.dirname (name)
60 name = strip_extension (os.path.basename (name), ".tely")
70 @finalout @c we do not want black boxes.
74 @author Han-Wen Nienhuys and Jan Nieuwenhuizen
79 ''' % (name, title, title)
91 s += "\n\n@lilypondfile[printfilename,texidoc]{%s}" % n
94 s = s + string.join (map (lambda x: name2line (x), files), "\n")
96 f = "%s/%s.tely" % (dir, name)
97 sys.stderr.write ("%s: writing %s..." % (program_name, f))
101 sys.stderr.write ('\n')
103 # not Unix philosophy, but hey, at least we notice when
104 # we don't distribute any .ly files.
105 sys.stderr.write ("No files specified. Doing nothing")