Skip to content

Commit 47c5492

Browse files
authored
feat: add a --version flag (#619)
1 parent f6fbf7a commit 47c5492

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

robyn/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from InquirerPy import prompt
44
from InquirerPy.base.control import Choice
55
from .argument_parser import Config
6+
from robyn.robyn import get_version
67

78

89
def create_robyn_app():
@@ -81,11 +82,13 @@ def docs():
8182
webbrowser.open("https://sparckles.github.io/robyn/#/")
8283

8384

84-
8585
if __name__ == "__main__":
8686
config = Config()
8787
if config.create:
8888
create_robyn_app()
8989

90+
if config.version:
91+
print(get_version())
92+
9093
if config.docs:
9194
docs()

robyn/argument_parser.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def __init__(self) -> None:
5151
default=False,
5252
help="Open the browser on successful start.",
5353
)
54+
parser.add_argument(
55+
"--version",
56+
action="store_true",
57+
default=False,
58+
help="Show the Robyn version.",
59+
)
5460

5561
args, _ = parser.parse_known_args()
5662

@@ -60,6 +66,7 @@ def __init__(self) -> None:
6066
self.create = args.create
6167
self.docs = args.docs
6268
self.open_browser = args.open_browser
69+
self.version = args.version
6370

6471
if self.dev and (self.processes != 1 or self.workers != 1):
6572
raise Exception("--processes and --workers shouldn't be used with --dev")

0 commit comments

Comments
 (0)