mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-07-15 00:52:15 +08:00
Refactor old work
This commit is contained in:
27
manim_slides/commons.py
Normal file
27
manim_slides/commons.py
Normal file
@ -0,0 +1,27 @@
|
||||
import click
|
||||
from .defaults import CONFIG_PATH
|
||||
|
||||
|
||||
def config_path_option(function):
|
||||
return click.option(
|
||||
"-c",
|
||||
"--config",
|
||||
"config_path",
|
||||
default=CONFIG_PATH,
|
||||
type=click.Path(dir_okay=False),
|
||||
help="Set path to configuration file.",
|
||||
)(function)
|
||||
|
||||
|
||||
def config_options(function):
|
||||
function = config_path_option(function)
|
||||
function = click.option(
|
||||
"-f", "--force", is_flag=True, help="Overwrite any existing configuration file."
|
||||
)(function)
|
||||
function = click.option(
|
||||
"-m",
|
||||
"--merge",
|
||||
is_flag=True,
|
||||
help="Merge any existing configuration file with the new configuration.",
|
||||
)(function)
|
||||
return function
|
Reference in New Issue
Block a user