mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 22:34:24 +08:00
17 lines
388 B
Python
17 lines
388 B
Python
import click
|
|
import pathlib
|
|
from plugcli.params import MultiStrategyGetter, Option, NOT_PARSED
|
|
|
|
|
|
def get_file_and_extension(user_input, context):
|
|
file = user_input
|
|
ext = file.name.split('.')[-1] if file else None
|
|
return file, ext
|
|
|
|
OUTPUT_FILE_AND_EXT = Option(
|
|
"-o", "--output",
|
|
help="output file",
|
|
getter=get_file_and_extension,
|
|
type=click.File(mode='wb'),
|
|
)
|