diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-02-19 22:39:21 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-02-19 22:39:21 +0000 |
commit | c60980153c10f7e71e124066c41ee3a643c82ad1 (patch) | |
tree | 34ca5f5835ac6143c931aead969c7c15ba67c271 | |
parent | 12894b829cd1155493b515d333e1c45ca7a4e6b9 (diff) | |
download | cpt-c60980153c10f7e71e124066c41ee3a643c82ad1.tar.gz |
kiss: Print messages from prompt().
This enables the removal of a mess of nested
braces. I'm happy now.
FossilOrigin-Name: 12ffba199537785f2c0b0b09f1f531b3491a0a649de241328ba4051f513e4b7b
-rwxr-xr-x | kiss | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -41,6 +41,7 @@ contains() { prompt() { # Ask the user for some input. + [ "$1" ] && log "$1" log "Continue?: Press Enter to continue or Ctrl+C to abort here" # POSIX 'read' has none of the "nice" options like '-n', '-p' @@ -643,13 +644,9 @@ pkg_build() { set -- $explicit # Only ask for confirmation if more than one package needs to be installed. - [ $# -gt 1 ] && { - log "Install built packages? [$*]" - - prompt && { - args i "$@" - return - } + [ $# -gt 1 ] && prompt "Install built packages? [$*]" && { + args i "$@" + return } log "Run 'kiss i $*' to install the package(s)" |