Diff

Differences From Artifact [45c8f50b64]:

To Artifact [67b5085a35]:


    16     16   # Set arguments
    17     17   declare -A jsonArgs
    18     18   jsonArgs["platform"]="$(uname -s)-$(uname -m)"
    19     19   
    20     20   nextArg=''
    21     21   kit_filename=''
    22     22   options=()
           23  +packages=()
    23     24   internalOptionsVerbose='false'
    24     25   for arg in "$@"; do
    25     26   	if [ -n "${nextArg}" ]; then
    26     27   		jsonArgs["${nextArg}"]="${arg}"
    27     28   		nextArg=''
    28     29   		continue
    29     30   	fi
................................................................................
    34     35   			;;
    35     36   		--platform|--tcl-version|--kitcreator-version)
    36     37   			nextArg="${arg:2}"
    37     38   			nextArg="${nextArg//-/_}"
    38     39   			;;
    39     40   		--kitdll|--threaded|--debug|--dynamictk|--staticpkgs)
    40     41   			options+=("${arg:2}")
           42  +			;;
           43  +		--mk4tcl|--tcc4tcl|--tclcurl|--tk|--tls|--tuapi|--itcl|--duktape|--lmdb|--udp)
           44  +			packages+=("${arg:2}")
    41     45   			;;
    42     46   		--platforms|--tcl-versions|--kitcreator-versions|--packages|--options)
    43     47   			action="${arg:2}"
    44     48   			action="${action//-/_}"
    45     49   
    46     50   			formatString='%-20s | %s\n'
    47     51   			printf "${formatString}" Name Description
................................................................................
    59     63   			echo "Invalid option \"${arg}\"" >&2
    60     64   			print_help >&2
    61     65   			exit 1
    62     66   	esac
    63     67   done
    64     68   
    65     69   if [ -n "${options[*]}" ]; then
    66         -	jsonArgs["options"]="${options[@]}"
           70  +	jsonArgs["options"]="${options[*]}"
           71  +fi
           72  +
           73  +if [ -n "${packages[*]}" ]; then
           74  +	jsonArgs["packages"]="${packages[*]}"
    67     75   fi
    68     76   
    69     77   # Convert arguments into a request
    70     78   jqArgs=()
    71     79   jqSettings=''
    72     80   for jsonArg in "${!jsonArgs[@]}"; do
    73     81   	case "${jsonArg}" in
    74         -		options)
           82  +		options|packages)
    75     83   			requestArray='[]'
    76     84   			for value in ${jsonArgs[${jsonArg}]}; do
    77     85   				requestArray="$(jq -crM --arg value "${value}" '. + [ $value ]' <<<"${requestArray}")"
    78     86   			done
    79     87   			jqArgs+=(--argjson "${jsonArg}" "${requestArray}")
    80     88   			;;
    81     89   		*)