Skip to content

Commit

Permalink
feat(__main__.py): add support for rajini++ shell
Browse files Browse the repository at this point in the history
rajini++ shell allows you to run rajini++ statements line by line on the terminal.
  • Loading branch information
aadhithya committed May 16, 2022
1 parent 9657020 commit eaee4c9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion rajinipp/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pdb

from typer import Typer

from . import __version_str__
from . import __version__, __version_str__
from .runner import RppRunner

app = Typer()
Expand Down Expand Up @@ -32,6 +34,16 @@ def run(file_path: str, debug: bool = False):
runner.exec(code=code_str, log_level=level)


@app.command()
def shell():
print(f"rajini++ v{__version__}")
while True:
code_line = input("rajinipp>> ")
output = runner.eval(code_line)
if output:
print(output)


@app.callback()
def main():
"""
Expand Down

0 comments on commit eaee4c9

Please sign in to comment.