Skip to content

Commit 5da80ae

Browse files
committed
Add version number to print
1 parent dbc710a commit 5da80ae

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

fastapi_ccli/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
43
import typer
54

5+
__version__ = '0.0.1'
6+
67
# bool fonts
78
GREEN = typer.style('True', fg='green', bold=True)
89
RED = typer.style('False', fg='red', bold=True)

fastapi_ccli/cloner/version.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
import typer
4+
from fastapi_ccli import __version__
5+
6+
version = typer.Typer()
7+
8+
9+
@version.command()
10+
def print_version(
11+
_version: bool = typer.Option(
12+
True,
13+
'--version',
14+
'-V',
15+
help='获取当前框架版本号'
16+
)
17+
):
18+
typer.secho(__version__, fg=typer.colors.WHITE, bold=True)

0 commit comments

Comments
 (0)