We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
parse_options
1 parent 4cec390 commit c8927eeCopy full SHA for c8927ee
bin/ruby-build
@@ -26,10 +26,15 @@ lib() {
26
parse_options() {
27
OPTIONS=()
28
ARGUMENTS=()
29
+ EXTRA_ARGUMENTS=()
30
local arg option index
31
- for arg in "$@"; do
32
- if [ "${arg:0:1}" = "-" ]; then
+ while [ $# -gt 0 ]; do
33
+ arg="$1"
34
+ if [ "$arg" == "--" ]; then
35
+ shift 1
36
+ break
37
+ elif [ "${arg:0:1}" = "-" ]; then
38
if [ "${arg:1:1}" = "-" ]; then
39
OPTIONS[${#OPTIONS[*]}]="${arg:2}"
40
else
@@ -40,10 +45,14 @@ lib() {
45
index=$(($index+1))
41
46
done
42
47
fi
48
43
49
44
50
ARGUMENTS[${#ARGUMENTS[*]}]="$arg"
51
52
53
54
+
55
+ EXTRA_ARGUMENTS=("$@")
56
}
57
58
if [ "$1" == "--$FUNCNAME" ]; then
0 commit comments