From 9daedca4dee677bf06d60c32e235e28e1b5233c1 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sun, 17 May 2020 11:46:29 -0700 Subject: [PATCH] More documentation Documentation of new command-line opts. --- man/ptulsconv.1 | 8 +++++--- ptulsconv/__init__.py | 2 +- ptulsconv/__main__.py | 25 ++++++++++++++++--------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/man/ptulsconv.1 b/man/ptulsconv.1 index 916a11d..70442b5 100644 --- a/man/ptulsconv.1 +++ b/man/ptulsconv.1 @@ -15,15 +15,17 @@ an XML file for import into Filemaker Pro. show a help message and exit. .TP .RI "-i " "TC" -Don't output events before this timecode, and offset all remaining -events to start at this timecode. +Drop events before this timecode. .TP .RI "-o " "TC" -Don't output events occurring after this timecode. +Drop events after this timecode. .TP .RI "-m " Include muted clips. .TP +.RI "--json " +Output a JSON document instead of XML. (--xform will have no effect.) +.TP .RI "--xform " "NAME" Convert the output with a built-in output transform. .TP diff --git a/ptulsconv/__init__.py b/ptulsconv/__init__.py index 50b6c7e..cdc880f 100644 --- a/ptulsconv/__init__.py +++ b/ptulsconv/__init__.py @@ -2,6 +2,6 @@ from .ptuls_grammar import protools_text_export_grammar from .ptuls_parser_visitor import DictionaryParserVisitor from .transformations import TimecodeInterpreter -__version__ = '0.4.0' +__version__ = '0.4.1' __author__ = 'Jamie Hardt' __license__ = 'MIT' diff --git a/ptulsconv/__main__.py b/ptulsconv/__main__.py index 395aa22..8687110 100644 --- a/ptulsconv/__main__.py +++ b/ptulsconv/__main__.py @@ -11,31 +11,38 @@ def main(): parser = OptionParser() parser.usage = "ptulsconv TEXT_EXPORT.txt" - parser.add_option('-i', dest='in_time', help="Don't output events occurring before this timecode.", metavar='TC') - parser.add_option('-o', dest='out_time', help="Don't output events occurring after this timecode.", metavar='TC') + filter_opts = OptionGroup(title='Filtering Options', parser=parser) + + 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', # 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.') - 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.", default=None, metavar='N') - parser.add_option('--json', default=False, action='store_true', dest='write_json', - help='Output a JSON document instead of XML.') + parser.add_option_group(filter_opts) - 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') - parser.add_option('--show-available-tags', dest='show_tags', + output_opts.add_option('--show-available-tags', dest='show_tags', action='store_true', 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', default=False, help='Display available built-in XSLT transforms.') + parser.add_option_group(output_opts) (options, args) = parser.parse_args(sys.argv)