-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx.sh
More file actions
85 lines (70 loc) · 1.35 KB
/
x.sh
File metadata and controls
85 lines (70 loc) · 1.35 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/zsh
set -euo pipefail
#cke='./cookie'
cke='./cookie_0'
qe='{
"n": 11,
"delay" : 10000,
"k": "v",
"x": [1, 2, "3", "x"]
}'
ql='{
"username": "admin",
"passwd" : "forget"
}'
req() {
[[ ! -f ${cke} ]] && touch ${cke}
local a=(
'login'
'logout'
now
hailstone
'env'
'echo'
)
curl -vs -X POST \
--cookie ${cke} \
--cookie-jar ${cke} \
-H 'content-type: application/json' \
-H 'accept: application/json' \
--data ${qe} \
'http://172.16.1.11:902/'${a[1]} | jq
}
purge() {
rm -rf bin obj
}
cln() {
msbuild api.csproj \
-v:q \
-t:clean > /dev/null
#-maxcpucount:4 \
}
bld() {
msbuild api.csproj \
-v:q \
-t:build
#-maxcpucount:4 \
#-p:WarningLevel=0 \
}
xxx() {
pushd bin/Release/
echo -e '\e[0;96m||||||||||||||||||||||||||||||||||||||||||||||||||\e[0m\n'
./api.exe
popd
}
update() {
nuget install Microsoft.AspNet.WebApi.Owin -OutputDirectory packages
nuget install Microsoft.Owin.Hosting -OutputDirectory packages
nuget install Microsoft.Owin.Host.HttpListener -OutputDirectory packages
}
typeset -A opts
for k in ${(k)functions}; do
opts+=(["$k[1]"]=$k)
done
[[ -z ${@} ]] && \
paste -d ' ' <(print -l '\-'${(j:\n-:k)opts}) <(print -l $opts) && exit
while getopts ${(j::k)opts} opt ${@}; do
$opts[$opt] ${@}
done
shift $(($OPTIND -1))
exit