2013-06-28 05:22:14 -07:00
|
|
|
#!/usr/bin/env bash
|
2021-07-29 00:37:35 -07:00
|
|
|
# YES_ZSH
|
2021-07-29 05:44:12 -07:00
|
|
|
# YES_BASH
|
|
|
|
# NO_DASH
|
2021-07-29 00:37:35 -07:00
|
|
|
|
2021-07-30 17:57:08 -07:00
|
|
|
pause() { ### @-
|
|
|
|
### pause — the companion script of `confirm`.
|
|
|
|
###
|
|
|
|
### ```
|
|
|
|
### $ pause
|
|
|
|
### Press any key to continue
|
|
|
|
### $
|
|
|
|
### ```
|
2021-07-29 00:37:35 -07:00
|
|
|
[ -n "${ZSH_VERSION:-}" ] \
|
2021-07-29 05:44:12 -07:00
|
|
|
&& read -sk '?Press any key to continue
|
|
|
|
' || read -n1 -u 1 -sp 'Press any key to continue
|
|
|
|
'
|
2021-07-29 00:37:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
[ "${SOURCING:-0}" -gt 0 ] || pause "$@"
|