diff options
-rw-r--r-- | doc/apk.8.scd | 5 | ||||
-rw-r--r-- | src/apk.c | 4 | ||||
-rw-r--r-- | src/commit.c | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/doc/apk.8.scd b/doc/apk.8.scd index ff3e93a..dcabf45 100644 --- a/doc/apk.8.scd +++ b/doc/apk.8.scd @@ -79,6 +79,8 @@ The following options are available for all commands. *-i, --interactive* Ask confirmation before performing certain operations. + Interactive mode can be made the default when running on a tty, + by creating /etc/apk/interactive as an empty file. *-p, --root* <_ROOT_> Manage file system at _ROOT_. @@ -137,6 +139,9 @@ The following options are available for all commands. *--no-cache* Do not use any local cache path. +*--no-interactive* + Disable interactive mode. + *--no-network* Do not use the network. The cache is still used when possible. @@ -86,6 +86,7 @@ static struct apk_repository_list *apk_repository_new(const char *url) OPT(OPT_GLOBAL_interactive, APK_OPT_SH("i") "interactive") \ OPT(OPT_GLOBAL_keys_dir, APK_OPT_ARG "keys-dir") \ OPT(OPT_GLOBAL_no_cache, "no-cache") \ + OPT(OPT_GLOBAL_no_interactive, "no-interactive") \ OPT(OPT_GLOBAL_no_network, "no-network") \ OPT(OPT_GLOBAL_no_progress, "no-progress") \ OPT(OPT_GLOBAL_print_arch, "print-arch") \ @@ -168,6 +169,9 @@ static int option_parse_global(void *ctx, struct apk_db_options *dbopts, int opt case OPT_GLOBAL_interactive: apk_flags |= APK_INTERACTIVE; break; + case OPT_GLOBAL_no_interactive: + apk_flags &= ~APK_INTERACTIVE; + break; case OPT_GLOBAL_progress: apk_flags |= APK_PROGRESS; break; diff --git a/src/commit.c b/src/commit.c index dacc864..4b4f588 100644 --- a/src/commit.c +++ b/src/commit.c @@ -319,7 +319,7 @@ int apk_solver_commit_changeset(struct apk_database *db, printf("Do you want to continue [Y/n]? "); fflush(stdout); r = fgetc(stdin); - if (r != 'y' && r != 'Y' && r != '\n') + if (r != 'y' && r != 'Y' && r != '\n' && r != EOF) return -1; } } |