From 2d12d2ffb26d61d7ef10cf2b09da3012a4ef56ae Mon Sep 17 00:00:00 2001 From: merakor Date: Thu, 7 May 2020 18:28:40 +0000 Subject: kiss: add option to disable prompts FossilOrigin-Name: b4c88886e87894e335724f4310bdf04eb1830ea8e03b12efd664831a2bcfbc6f --- CHANGELOG.md | 6 ++++++ kiss | 7 ++++++- man/kiss.1 | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aeb825e..c29cdec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ this project _somewhat_ adheres to [Semantic Versioning]. [Keep a Changelog]: https://keepachangelog.com/en/1.0.0/ [Semantic Versioning]: https://semver.org/spec/v2.0.0.html +1.20.0 - 2020-05-07 +------------------- + +### Added +- `KISS_NOPROMPT` can be specified in order to skip prompts + 1.19.1 - 2020-05-07 ------------------- diff --git a/kiss b/kiss index f53aa71..398091f 100755 --- a/kiss +++ b/kiss @@ -39,6 +39,11 @@ contains() { } prompt() { + # If a KISS_NOPROMPT variable is set, continue. + # This can be useful for installation scripts and + # bootstrapping. + [ "$KISS_NOPROMPT" ] && return 0 + # Ask the user for some input. [ "$1" ] && log "$1" log "Continue?: Press Enter to continue or Ctrl+C to abort here" @@ -1477,7 +1482,7 @@ args() { l|list) pkg_list "$@" ;; u|update) pkg_updates ;; s|search) for pkg do pkg_find "$pkg" all; done ;; - v|version) log kiss 1.19.1 ;; + v|version) log kiss 1.20.0 ;; h|help|-h|--help|'') exec 2>&1 diff --git a/man/kiss.1 b/man/kiss.1 index b243a90..62aabc8 100644 --- a/man/kiss.1 +++ b/man/kiss.1 @@ -172,6 +172,13 @@ export KISS_COLOUR=1 # Enables globally .IP export KISS_COLOUR=0 # Disables globally .PP +.SS DISABLING PROMPTS +User can disable prompts by setting a \fIKISS_NOPROMPT\fR environment value. This +can be useful for scripting purposes. + +.IP +KISS_NOPROMPT=1 kiss b pkg1 pkg2 +.PP .SH ALTERNATIVES SYSTEM When a package with conflicts is installed the conflicting files will be added as "choices" to the alternatives system. -- cgit v1.2.3