mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
add cli flag -v to show version info
This commit is contained in:
parent
fbccb1ebf3
commit
ef5253f1bc
3 changed files with 15 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
|
__version__ = pkg_resources.get_distribution("manimgl").version
|
||||||
|
|
||||||
from manimlib.constants import *
|
from manimlib.constants import *
|
||||||
|
|
||||||
from manimlib.animation.animation import *
|
from manimlib.animation.animation import *
|
||||||
|
|
|
@ -7,6 +7,12 @@ import manimlib.utils.init_config
|
||||||
def main():
|
def main():
|
||||||
args = manimlib.config.parse_cli()
|
args = manimlib.config.parse_cli()
|
||||||
|
|
||||||
|
if args.version:
|
||||||
|
from manimlib import __version__
|
||||||
|
print(f"ManimGL v{__version__}")
|
||||||
|
if args.file == None:
|
||||||
|
return
|
||||||
|
|
||||||
if args.config:
|
if args.config:
|
||||||
manimlib.utils.init_config.init_customization()
|
manimlib.utils.init_config.init_customization()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -136,6 +136,11 @@ def parse_cli():
|
||||||
"--config_file",
|
"--config_file",
|
||||||
help="Path to the custom configuration file",
|
help="Path to the custom configuration file",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-v", "--version",
|
||||||
|
action="store_true",
|
||||||
|
help="Display the version of manimgl"
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
return args
|
return args
|
||||||
except argparse.ArgumentError as err:
|
except argparse.ArgumentError as err:
|
||||||
|
|
Loading…
Add table
Reference in a new issue