mirror of
https://github.com/radareorg/r2env.git
synced 2026-11-07 23:03:20 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
348be83710 | ||
|
|
8997dd8f3c |
No files matched your search
+7
-2
@@ -35,7 +35,8 @@ class R2Env:
|
||||
print_console(" [*] {0} ({1})".format(r2_version, r2_path))
|
||||
|
||||
def show_config(self):
|
||||
return json.dumps(self._config)
|
||||
print_console("[*] Current r2env config:")
|
||||
print_console(json.dumps(self._config))
|
||||
|
||||
def list_available_packages(self):
|
||||
print_console("[*] List of available Radare packages")
|
||||
@@ -70,8 +71,12 @@ class R2Env:
|
||||
return
|
||||
self._package_manager.uninstall_package(package)
|
||||
|
||||
def use(self, package):
|
||||
def use(self, package=None):
|
||||
self.exit_if_r2env_not_initialized()
|
||||
if not package:
|
||||
print_console("[x] Package not defined. Please use 'r2env use' with one installed package. ", ERROR)
|
||||
self.list_installed_packages()
|
||||
return
|
||||
cur_ver = self._get_current_version()
|
||||
new_dst_dir = self._package_manager.get_package_path(package)
|
||||
if cur_ver:
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ def show_help():
|
||||
print_console(HELP_MESSAGE)
|
||||
|
||||
|
||||
actions_with_argument = ["install", "uninstall", "use"]
|
||||
actions_with_argument = ["install", "uninstall"]
|
||||
actions = {
|
||||
"init": R2Env().init,
|
||||
"version": R2Env().get_r2_path,
|
||||
@@ -58,7 +58,7 @@ def run_action(action, args, use_meson):
|
||||
|
||||
def exit_if_not_argument_is_set(args):
|
||||
if len(args) < 1:
|
||||
print_console("[x] Missing package argument.", ERROR)
|
||||
print_console("[x] Missing package argument. ( as for example: radare2@latest)", ERROR)
|
||||
sys.exit(-1)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user