Skip to content

Commit 0ee21c4

Browse files
dnakovtrufae
authored andcommitted
Fix -MM
1 parent 50ee2e3 commit 0ee21c4

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Diff for: main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import runpy
22
import os
3-
r2aihome = os.path.dirname(__file__) #os.readlink(__file__))
4-
runpy.run_path(r2aihome + '/r2ai/main.py')
3+
4+
runpy.run_path(os.path.relpath('./r2ai/main.py', __file__))

Diff for: r2ai/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2-
from .models import models
2+
from .models import models, mainmodels
33
sys.modules["r2ai"].models = models
4+
sys.modules["r2ai"].mainmodels = mainmodels
45
VERSION = "0.5.0"

Diff for: r2ai/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def run_rcfile_once():
101101
rcfile_loaded = True
102102

103103
if have_rlang:
104-
from .repl import runline, r2ai_repl, help_message
104+
from r2ai.repl import runline, r2ai_repl, help_message
105105
if have_r2pipe:
106106
r2ai_repl(ai)
107107
os.exit(0)

Diff for: r2ai/repl.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ def runline(ai, usertext):
165165
print(help_message)
166166
elif usertext.startswith("clear") or usertext.startswith("-k"):
167167
print("\x1b[2J\x1b[0;0H\r")
168-
elif usertext.startswith("-M"):
169-
print(r2ai.models().strip())
170168
elif usertext.startswith("-MM"):
171169
print(r2ai.mainmodels().strip())
170+
elif usertext.startswith("-M"):
171+
print(r2ai.models().strip())
172172
elif usertext.startswith("-m"):
173173
words = usertext.split(" ")
174174
if len(words) > 1:

0 commit comments

Comments
 (0)