- p.add_option ('-v', '--verbose',
- action = "store_true",
- dest = 'verbose',
- help = _ ("be verbose"))
-
- p.add_option ('', '--lxml',
- action = "store_true",
- default = False,
- dest = "use_lxml",
- help = _ ("use lxml.etree; uses less memory and cpu time"))
-
- p.add_option ('-z', '--compressed',
- action = "store_true",
- dest = 'compressed',
- default = False,
- help = _ ("input file is a zip-compressed MusicXML file"))
-
- p.add_option ('-r', '--relative',
- action = "store_true",
- default = True,
- dest = "relative",
- help = _ ("convert pitches in relative mode (default)"))
-
- p.add_option ('-a', '--absolute',
- action = "store_false",
- dest = "relative",
- help = _ ("convert pitches in absolute mode"))
-
- p.add_option ('-l', '--language',
- metavar = _ ("LANG"),
- action = "store",
- help = _ ("use LANG for pitch names, e.g. 'deutsch' for note names in German"))
-
- p.add_option ('--nd', '--no-articulation-directions',
- action = "store_false",
- default = True,
- dest = "convert_directions",
- help = _ ("do not convert directions (^, _ or -) for articulations, dynamics, etc."))
-
- p.add_option ('--nrp', '--no-rest-positions',
- action = "store_false",
- default = True,
- dest = "convert_rest_positions",
- help = _ ("do not convert exact vertical positions of rests"))
-
- p.add_option ('--npl', '--no-page-layout',
- action = "store_false",
- default = True,
- dest = "convert_page_layout",
- help = _ ("do not convert the exact page layout and breaks"))
-
- p.add_option ('--no-beaming',
- action = "store_false",
- default = True,
- dest = "convert_beaming",
- help = _ ("do not convert beaming information, use lilypond's automatic beaming instead"))
-
- p.add_option ('-o', '--output',
- metavar = _ ("FILE"),
- action = "store",
- default = None,
- type = 'string',
- dest = 'output_name',
- help = _ ("set output filename to FILE, stdout if -"))
- p.add_option_group ('',
- description = (
+ p.add_option('-v', '--verbose',
+ action="callback",
+ callback=ly.handle_loglevel_option,
+ callback_args=("DEBUG",),
+ help=_ ("be verbose"))
+
+ p.add_option('', '--lxml',
+ action="store_true",
+ default=False,
+ dest="use_lxml",
+ help=_ ("use lxml.etree; uses less memory and cpu time"))
+
+ p.add_option('-z', '--compressed',
+ action="store_true",
+ dest='compressed',
+ default=False,
+ help=_ ("input file is a zip-compressed MusicXML file"))
+
+ p.add_option('-r', '--relative',
+ action="store_true",
+ default=True,
+ dest="relative",
+ help=_ ("convert pitches in relative mode (default)"))
+
+ p.add_option('-a', '--absolute',
+ action="store_false",
+ dest="relative",
+ help=_ ("convert pitches in absolute mode"))
+
+ p.add_option('-l', '--language',
+ metavar=_ ("LANG"),
+ action="store",
+ help=_ ("use LANG for pitch names, e.g. 'deutsch' for note names in German"))
+
+ p.add_option("--loglevel",
+ help=_ ("Print log messages according to LOGLEVEL "
+ "(NONE, ERROR, WARNING, PROGRESS (default), DEBUG)"),
+ metavar=_ ("LOGLEVEL"),
+ action='callback',
+ callback=ly.handle_loglevel_option,
+ type='string')
+
+ p.add_option('--nd', '--no-articulation-directions',
+ action="store_false",
+ default=True,
+ dest="convert_directions",
+ help=_ ("do not convert directions (^, _ or -) for articulations, dynamics, etc."))
+
+ p.add_option('--nrp', '--no-rest-positions',
+ action="store_false",
+ default=True,
+ dest="convert_rest_positions",
+ help=_ ("do not convert exact vertical positions of rests"))
+
+ p.add_option('--nsb', '--no-system-breaks',
+ action="store_false",
+ default=True,
+ dest="convert_system_breaks",
+ help=_ ("ignore system breaks"))
+
+ p.add_option('--npb', '--no-page-breaks',
+ action="store_false",
+ default=True,
+ dest="convert_page_breaks",
+ help=_ ("ignore page breaks"))
+
+ p.add_option('--npm', '--no-page-margins',
+ action="store_false",
+ default=True,
+ dest="convert_page_margins",
+ help=_ ("ignore page margins"))
+
+ p.add_option('--npl', '--no-page-layout',
+ action="store_false",
+ default=True,
+ dest="convert_page_layout",
+ help=_ ("do not convert the exact page layout and breaks (shortcut for \"--nsb --npb --npm\" options)"))
+
+ p.add_option('--nsd', '--no-stem-directions',
+ action="store_false",
+ default=True,
+ dest="convert_stem_directions",
+ help=_ ("ignore stem directions from MusicXML, use lilypond's automatic stemming instead"))
+
+ p.add_option('--nb', '--no-beaming',
+ action="store_false",
+ default=True,
+ dest="convert_beaming",
+ help=_ ("do not convert beaming information, use lilypond's automatic beaming instead"))
+
+ p.add_option('-o', '--output',
+ metavar=_ ("FILE"),
+ action="store",
+ default=None,
+ type='string',
+ dest='output_name',
+ help=_ ("set output filename to FILE, stdout if -"))
+
+ p.add_option('-m', '--midi',
+ action="store_true",
+ default=False,
+ dest="midi",
+ help=_("activate midi-block in .ly file"))
+
+ # transpose function
+ p.add_option('--transpose',
+ metavar=_ ("TOPITCH"),
+ action="store",
+ dest="transpose",
+ help=_ ("set pitch to transpose by the interval between pitch 'c' and TOPITCH"))
+
+ # time signature changing function
+ p.add_option('--sm', '--shift-meter',
+ metavar=_ ("BEATS/BEATTYPE"),
+ action="store",
+ dest="shift_meter",
+ help=_ ("change the length|duration of notes as a function of a given time signature to make the score look faster or slower, (eg. '4/4' or '2/2')"))
+
+ # switch tabstaff clef
+ p.add_option('--tc', '--tab-clef',
+ metavar=_ ("TABCLEFNAME"),
+ action="store",
+ dest="tab_clef",
+ help=_ ("switch between two versions of tab clefs (\"tab\" and \"moderntab\")"))
+
+ # StringNumber stencil on/off
+ p.add_option('--sn', '--string-numbers',
+ metavar=_ ("t[rue]/f[alse]"),
+ action="store",
+ dest="string_numbers",
+ help=_ ("deactivate string number stencil with --string-numbers f[alse]. Default is t[rue]"))
+
+ # StringNumber stencil on/off
+ p.add_option('--fb', '--fretboards',
+ action="store_true",
+ default=False,
+ dest="fretboards",
+ help=_("converts '<frame>' events to a separate FretBoards voice instead of markups"))
+
+ p.add_option_group('',
+ description=(