mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 08:39:00 +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.animation.animation import *
|
||||
|
|
|
@ -7,6 +7,12 @@ import manimlib.utils.init_config
|
|||
def main():
|
||||
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:
|
||||
manimlib.utils.init_config.init_customization()
|
||||
else:
|
||||
|
|
|
@ -136,6 +136,11 @@ def parse_cli():
|
|||
"--config_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()
|
||||
return args
|
||||
except argparse.ArgumentError as err:
|
||||
|
|
Loading…
Add table
Reference in a new issue