ruki 2 лет назад
Родитель
Сommit
19f068b62e
1 измененных файлов с 14 добавлено и 2 удалено
  1. 14 2
      configure

+ 14 - 2
configure

@@ -431,11 +431,23 @@ _show_version()
     exit 2
 }
 
+# --foo=yes => foo
+_parse_argument_name()
+{
+    echo "${1#*--}" | sed "s/${2-=[^=]*}$//"
+}
+
+# --foo=yes => yes
+_parse_argument_value()
+{
+    echo "$1" | sed "s/^${2-[^=]*=}//"
+}
+
 # parse input arguments
 _handle_option()
 {
-    local name=${1}
-    name=${name#*--}
+    local name=`_parse_argument_name ${1}`
+    local value=`_parse_argument_value ${1}`
     if test "x${name}" = "xhelp"; then
         _show_usage
         return 0