From 0b2917d1eb5273afffaa1794e77bc8ba3589090c Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 18 Apr 2020 02:17:01 +0200 Subject: [PATCH] [cli] Ask for verification before installing/uninstalling --- legendary/cli.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/legendary/cli.py b/legendary/cli.py index d0c94b4..fda3a56 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -288,7 +288,11 @@ def main(): for warn in sorted(res.warnings): logger.warning(warn) - _ = input('Do you wish to proceed? [Press Enter]') + choice = input(f'Do you wish to install "{igame.title}"? [Y/n]: ') + if choice and choice.lower()[0] != 'y': + print('Aborting...') + exit(0) + start_t = time.time() try: @@ -336,10 +340,16 @@ def main(): igame = core.get_installed_game(target_app) if not igame: logger.error(f'Game {target_app} not installed, cannot uninstall!') + exit(0) if igame.is_dlc: logger.error('Uninstalling DLC is not supported.') exit(1) + choice = input(f'Do you wish to uninstall "{igame.title}"? [y/N]: ') + if not choice or choice.lower()[0] != 'y': + print('Aborting...') + exit(0) + try: logger.info(f'Removing "{igame.title}" from "{igame.install_path}"...') core.uninstall_game(igame)