1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 04:39:03 -08:00
rc/sh/pause

20 lines
400 B
Bash
Executable file

#!/usr/bin/env bash
# YES_ZSH
# YES_BASH
# NO_DASH
pause() { ### @-
### pause — the companion script of [`confirm`.](#confirm)
###
### ```
### $ pause
### Press any key to continue
### $
### ```
[ -n "${ZSH_VERSION:-}" ] \
&& read -sk '?Press any key to continue
' || read -n1 -u 1 -sp 'Press any key to continue
'
}
[ -n "${preload+-}" ] || pause "$@"