Check-in [d41d1c1345]
Overview
Comment:Better API client
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d41d1c13459a4e2568540fd4e1e0c24922265920
User & Date: rkeene on 2019-05-01 13:47:04
Other Links: manifest | tags
Context
2019-05-01
13:51
Updated ignores to include NSF check-in: c8139e1826 user: rkeene tags: trunk
13:47
Better API client check-in: d41d1c1345 user: rkeene tags: trunk
2019-04-10
16:20
KitCreator 0.11.1 check-in: 86cf5d1b91 user: rkeene tags: trunk, 0.11.1
Changes

Modified build/utils/download-api-client from [67b5085a35] to [e4f8c366e4].

1
2
3
4
5
6
7
8
9
10
11

12
13

14
15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43



44





45
46
47
48
49
50
51
#! /usr/bin/env bash

# Define endpoint
endpoint_url="https://kitcreator.rkeene.org/kitcreator"

# Help
function print_help() {
	echo 'download-api-client [--platform <platform>] [--tcl-version <version>]'
	echo '                    [--kitcreator-version <version>] [--kitdll]'
	echo '                    [--threaded] [--debug] [--dynamictk]'
	echo '                    [--staticpkgs] [--verbose]'

	echo 'download-api-client {--help|--platforms|--tcl-versions|'
	echo '                     --kitcreator-versions|--packages}'

}

# Set arguments
declare -A jsonArgs
jsonArgs["platform"]="$(uname -s)-$(uname -m)"

nextArg=''
kit_filename=''
options=()
packages=()
internalOptionsVerbose='false'

for arg in "$@"; do
	if [ -n "${nextArg}" ]; then
		jsonArgs["${nextArg}"]="${arg}"
		nextArg=''
		continue
	fi

	case "${arg}" in
		--verbose)
			internalOptionsVerbose='true'
			;;
		--platform|--tcl-version|--kitcreator-version)
			nextArg="${arg:2}"
			nextArg="${nextArg//-/_}"
			;;
		--kitdll|--threaded|--debug|--dynamictk|--staticpkgs)
			options+=("${arg:2}")
			;;
		--mk4tcl|--tcc4tcl|--tclcurl|--tk|--tls|--tuapi|--itcl|--duktape|--lmdb|--udp)



			packages+=("${arg:2}")





			;;
		--platforms|--tcl-versions|--kitcreator-versions|--packages|--options)
			action="${arg:2}"
			action="${action//-/_}"

			formatString='%-20s | %s\n'
			printf "${formatString}" Name Description










|
>

|
>











>


















|
>
>
>
|
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /usr/bin/env bash

# Define endpoint
endpoint_url="https://kitcreator.rkeene.org/kitcreator"

# Help
function print_help() {
	echo 'download-api-client [--platform <platform>] [--tcl-version <version>]'
	echo '                    [--kitcreator-version <version>] [--kitdll]'
	echo '                    [--threaded] [--debug] [--dynamictk]'
	echo '                    [--staticpkgs] [--verbose] [--pkg-<package>...]'
	echo '                    [--opt-<option>...] [--empty-packages]'
	echo 'download-api-client {--help|--platforms|--tcl-versions|'
	echo '                     --kitcreator-versions|--packages|'
	echo '                     --options}'
}

# Set arguments
declare -A jsonArgs
jsonArgs["platform"]="$(uname -s)-$(uname -m)"

nextArg=''
kit_filename=''
options=()
packages=()
internalOptionsVerbose='false'
noPackages='false'
for arg in "$@"; do
	if [ -n "${nextArg}" ]; then
		jsonArgs["${nextArg}"]="${arg}"
		nextArg=''
		continue
	fi

	case "${arg}" in
		--verbose)
			internalOptionsVerbose='true'
			;;
		--platform|--tcl-version|--kitcreator-version)
			nextArg="${arg:2}"
			nextArg="${nextArg//-/_}"
			;;
		--kitdll|--threaded|--debug|--dynamictk|--staticpkgs)
			options+=("${arg:2}")
			;;
		--opt-*)
			options+=("${arg:6}")
			;;
		--pkg-*)
			packages+=("${arg:6}")
			noPackages='false'
			;;
		--empty-packages)
			packages=()
			noPackages='true'
			;;
		--platforms|--tcl-versions|--kitcreator-versions|--packages|--options)
			action="${arg:2}"
			action="${action//-/_}"

			formatString='%-20s | %s\n'
			printf "${formatString}" Name Description
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
	esac
done

if [ -n "${options[*]}" ]; then
	jsonArgs["options"]="${options[*]}"
fi

if [ -n "${packages[*]}" ]; then
	jsonArgs["packages"]="${packages[*]}"
fi

# Convert arguments into a request
jqArgs=()
jqSettings=''
for jsonArg in "${!jsonArgs[@]}"; do







|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
	esac
done

if [ -n "${options[*]}" ]; then
	jsonArgs["options"]="${options[*]}"
fi

if [ -n "${packages[*]}" -o "${noPackages}" = 'true' ]; then
	jsonArgs["packages"]="${packages[*]}"
fi

# Convert arguments into a request
jqArgs=()
jqSettings=''
for jsonArg in "${!jsonArgs[@]}"; do