Compare commits

..
4 Commits
Author SHA1 Message Date
pancake 0af796baa0 stupid python rules 2021-06-17 18:08:56 +02:00
pancake f64c5d8dd3 mec 2021-06-17 17:57:58 +02:00
pancake 0f4197ef60 fixes 2021-06-17 17:54:16 +02:00
pancake 9dcd499400 Fix build and shell for termux 2021-06-17 17:41:41 +02:00
2 changed files with 6 additions and 15 deletions

No files matched your search

+1 -2
View File
@@ -87,8 +87,7 @@ class R2Env:
@staticmethod
def version():
thispath = os.path.dirname(os.path.realpath(__file__))
with open(thispath + "/version.txt", "r") as version:
with open("version.txt", "r") as version:
return version.read()
def shell(self, cmd=""):
+5 -13
View File
@@ -16,8 +16,7 @@ config - display current .r2env settings
install [pkg] - build and install given package. Use --meson to use it as the build system.
uninstall [pkg] - remove selected package
use [pkg] - use r2 package defined. pkg should be a release version or latest.
path - show path of current r2 in use
version - show version of r2env
version - show the current Radare version and its origin
versions - List all Radare versions installed
list - list all Radare packages available to r2env
shell - open a new shell with PATH env var set
@@ -29,16 +28,11 @@ def show_help():
print_console(HELP_MESSAGE)
def show_version():
print_console(R2Env().version())
actions_with_argument = ["install", "uninstall", "use"]
actions_with_arguments = ["shell"]
actions = {
"init": R2Env().init,
"version": show_version,
"path": R2Env().get_r2_path,
"version": R2Env().get_r2_path,
"config": R2Env().show_config,
"list": R2Env().list_available_packages,
"install": R2Env().install,
@@ -51,9 +45,7 @@ actions = {
def run_action(action, args, use_meson):
if action == "":
show_help()
elif action not in actions:
if action not in actions:
print_console("[X] Action not found", ERROR)
elif action in actions_with_arguments:
actions[action](" ".join(args))
@@ -83,8 +75,8 @@ def main():
parser.add_argument("action", help="run specified action. (Run r2env help for more information)",
action="store", default=["help"])
parser.add_argument('args', metavar='args', nargs='*', type=str, help='Specified arguments')
parser.add_argument("-v", "--version", dest="version", help="Show r2env version", action="store_true")
parser.add_argument("-m", "--meson", dest="meson", help="Use meson as your build system.", action="store_true")
parser.add_argument("-v", "--version", help="Show r2env version", action="store_true")
parser.add_argument("-m", "--meson", help="Use meson as your build system.", action="store_true")
args = parser.parse_args()
if args.version:
print_console(R2Env().version())