installer: change to --unattended argument and add docs
Diff
1diff --git a/tools/install.sh b/tools/install.sh
2index 05b485333353fd710eeccc398d23720bf0500a7d..8763b351317e49475ba7317e513314211e922e89 100755
3--- a/tools/install.sh
4+++ b/tools/install.sh
5@@ -12,15 +12,23 @@
6 # You can tweak the install behavior by setting variables when running the script. For
7 # example, to change the path to the Oh My Zsh repository:
8 # ZSH=~/.zsh sh install.sh
9+#
10 # Respects the following environment variables:
11 # ZSH - path to the Oh My Zsh repository folder (default: $HOME/.oh-my-zsh)
12 # REPO - name of the GitHub repo to install from (default: robbyrussell/oh-my-zsh)
13 # REMOTE - full remote URL of the git repo to install (default: GitHub via HTTPS)
14 # BRANCH - branch to check out immediately after install (default: master)
15+#
16 # Other options:
17 # CHSH - 'no' means the installer will not change the default shell (default: yes)
18 # RUNZSH - 'no' means the installer will not run zsh after the install (default: yes)
19 #
20+# You can also pass some arguments to the install script to set some these options:
21+# --skip-chsh: has the same behavior as setting CHSH to 'no'
22+# --unattended: sets both CHSH and RUNZSH to 'no'
23+# For example:
24+# sh install.sh --unattended
25+#
26 set -e
2728 # Default settings
29@@ -178,6 +186,7 @@ setup_shell() {
30 }
3132 main() {
33+ # Run as unattended if stdin is closed
34 if [ ! -t 0 ]; then
35 RUNZSH=no
36 CHSH=no
37@@ -186,7 +195,7 @@ main() {
38 # Parse arguments
39 while [ $# -gt 0 ]; do
40 case $1 in
41- --silent|--batch) RUNZSH=no; CHSH=no ;;
42+ --unattended) RUNZSH=no; CHSH=no ;;
43 --skip-chsh) CHSH=no ;;
44 esac
45 shift