More documentation

Documentation of new command-line opts.
This commit is contained in:
Jamie Hardt
2020-05-17 11:46:29 -07:00
parent 93a014bdc0
commit 9daedca4de
3 changed files with 22 additions and 13 deletions

View File

@@ -15,15 +15,17 @@ an XML file for import into Filemaker Pro.
show a help message and exit. show a help message and exit.
.TP .TP
.RI "-i " "TC" .RI "-i " "TC"
Don't output events before this timecode, and offset all remaining Drop events before this timecode.
events to start at this timecode.
.TP .TP
.RI "-o " "TC" .RI "-o " "TC"
Don't output events occurring after this timecode. Drop events after this timecode.
.TP .TP
.RI "-m " .RI "-m "
Include muted clips. Include muted clips.
.TP .TP
.RI "--json "
Output a JSON document instead of XML. (--xform will have no effect.)
.TP
.RI "--xform " "NAME" .RI "--xform " "NAME"
Convert the output with a built-in output transform. Convert the output with a built-in output transform.
.TP .TP

View File

@@ -2,6 +2,6 @@ from .ptuls_grammar import protools_text_export_grammar
from .ptuls_parser_visitor import DictionaryParserVisitor from .ptuls_parser_visitor import DictionaryParserVisitor
from .transformations import TimecodeInterpreter from .transformations import TimecodeInterpreter
__version__ = '0.4.0' __version__ = '0.4.1'
__author__ = 'Jamie Hardt' __author__ = 'Jamie Hardt'
__license__ = 'MIT' __license__ = 'MIT'

View File

@@ -11,31 +11,38 @@ def main():
parser = OptionParser() parser = OptionParser()
parser.usage = "ptulsconv TEXT_EXPORT.txt" parser.usage = "ptulsconv TEXT_EXPORT.txt"
parser.add_option('-i', dest='in_time', help="Don't output events occurring before this timecode.", metavar='TC') filter_opts = OptionGroup(title='Filtering Options', parser=parser)
parser.add_option('-o', dest='out_time', help="Don't output events occurring after this timecode.", metavar='TC')
filter_opts.add_option('-i', dest='in_time', help="Don't output events occurring before this timecode.", metavar='TC')
filter_opts.add_option('-o', dest='out_time', help="Don't output events occurring after this timecode.", metavar='TC')
# parser.add_option('-P', '--progress', default=False, action='store_true', dest='show_progress', # parser.add_option('-P', '--progress', default=False, action='store_true', dest='show_progress',
# help='Show progress bar.') # help='Show progress bar.')
parser.add_option('-m', '--include-muted', default=False, action='store_true', dest='include_muted', filter_opts.add_option('-m', '--include-muted', default=False, action='store_true', dest='include_muted',
help='Include muted clips.') help='Include muted clips.')
parser.add_option('-R', '--reel', dest='select_reel', help="Output only events in reel N, and recalculate start " filter_opts.add_option('-R', '--reel', dest='select_reel', help="Output only events in reel N, and recalculate start "
" times relative to that reel's start time.", " times relative to that reel's start time.",
default=None, metavar='N') default=None, metavar='N')
parser.add_option('--json', default=False, action='store_true', dest='write_json', parser.add_option_group(filter_opts)
help='Output a JSON document instead of XML.')
parser.add_option('--xform', dest='xslt', help="Convert with built-is XSLT transform.", output_opts = OptionGroup(title="Output Options", parser=parser)
output_opts.add_option('--json', default=False, action='store_true', dest='write_json',
help='Output a JSON document instead of XML. If this option is enabled, --xform with have no'
'effect')
output_opts.add_option('--xform', dest='xslt', help="Convert with built-is XSLT transform.",
default=None, metavar='NAME') default=None, metavar='NAME')
parser.add_option('--show-available-tags', dest='show_tags', output_opts.add_option('--show-available-tags', dest='show_tags',
action='store_true', action='store_true',
default=False, help='Display tag mappings for the FMP XML output style and exit.') default=False, help='Display tag mappings for the FMP XML output style and exit.')
parser.add_option('--show-available-transforms', dest='show_transforms', output_opts.add_option('--show-available-transforms', dest='show_transforms',
action='store_true', action='store_true',
default=False, help='Display available built-in XSLT transforms.') default=False, help='Display available built-in XSLT transforms.')
parser.add_option_group(output_opts)
(options, args) = parser.parse_args(sys.argv) (options, args) = parser.parse_args(sys.argv)