Skip to content

Commit e656002

Browse files
committed
WINTERMUTE: Simplify arguments for dcp extractor
1 parent 44c05dc commit e656002

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

engines/wintermute/dcp_extractor.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,12 @@ def main():
137137
prog='dcp_extractor.py',
138138
description='Wintermute DCP archive extractor')
139139

140-
parser.add_argument('--sfx',
141-
action='store_true')
142-
143-
action_parsers = parser.add_subparsers(required=True)
144-
list_parser = action_parsers.add_parser('list', help='list archive contents')
145-
list_parser.add_argument('input', type=argparse.FileType('rb'), metavar='dcp file')
146-
list_parser.set_defaults(action=dcp_list)
147-
extract_parser = action_parsers.add_parser('extract', help='extract archive contents')
148-
extract_parser.add_argument('input', type=argparse.FileType('rb'), metavar='dcp file')
149-
extract_parser.add_argument('output_dir', type=pathlib.Path, metavar='output directory')
150-
extract_parser.set_defaults(action=dcp_extract)
140+
parser.add_argument('--sfx', action='store_true')
141+
parser.add_argument('input', type=argparse.FileType('rb'), metavar='dcp file')
142+
parser.add_argument('output_dir', nargs='?', type=pathlib.Path,
143+
default=pathlib.Path('output'), metavar='output directory',
144+
help='Output directory (default: ./output)')
145+
parser.set_defaults(action=dcp_extract)
151146

152147
options = parser.parse_args()
153148

0 commit comments

Comments
 (0)