From 1c92602172790bbcb75f6083cf53ce7fea25b33a Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Fri, 24 Jul 2009 14:18:07 +0300 Subject: apk: add -i/--interactive option (fixes #60) and use that to figure if questions are allowed or not instead of the verbosity level. --- src/state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index f539b3b..16acfba 100644 --- a/src/state.c +++ b/src/state.c @@ -667,7 +667,7 @@ int apk_state_commit(struct apk_state *state, } size_diff /= 1024; - if (apk_verbosity > 1) { + if (apk_verbosity > 1 || (apk_flags & APK_INTERACTIVE)) { r = dump_packages(state, cmp_remove, "The following packages will be REMOVED"); r += dump_packages(state, cmp_downgrade, @@ -681,6 +681,8 @@ int apk_state_commit(struct apk_state *state, (size_diff < 0) ? "disk space will be freed" : "additional disk space will be used"); + } + if (apk_flags & APK_INTERACTIVE) { fprintf(stderr, "Do you want to continue [Y/n]? "); fflush(stderr); r = fgetc(stdin); -- cgit v1.2.3-60-g2f50