[bug#33134,1/4] guix-install.sh: Add parse_args.

Message ID 20181109041437.45557-1-s@ricketyspace.net
State New
Headers show
Series
  • Add auto yes/no switch to guix-install.sh
Related show

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

rsiddharth Nov. 9, 2018, 4:14 a.m. UTC
* etc/guix-install.sh (parse_args): New function.
---
 etc/guix-install.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Patch

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index ca6874ba0..3191d1be9 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -370,6 +370,21 @@  sys_authorize_build_farms()
     done
 }
 
+parse_args()
+{
+    local args_num=$#
+
+    if [ $args_num -lt 1 ]; then
+        return
+    fi
+
+    # process -y / -n arg.
+    AUTO_YN=${1:1:1}
+    if [ -z $AUTO_YN ]; then
+        AUTO_YN=""
+    fi
+}
+
 welcome()
 {
     cat<<"EOF"