* updated ioquake3.cache
[t2sde.git] / t2
blob91f79849d4d4642e8183d3b3e509547d0b41da50
1 #!/usr/bin/env bash
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # T2 SDE: t2
4 # Copyright (C) 2023 - 2024 The T2 SDE Project
5 #
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 declare -A commands
15 commands["bootstrap"]="bootstrap vital deps on homebrew systems"
16 commands["config"]="creates a target configuration profile"
17 commands["install"]="installs a package and its dependencies"
18 commands["uninstall"]="uninstalls a package from the system"
19 commands["download"]="downloads assets of a package"
20 commands["build"]="builds a package from source"
21 commands["build-target"]="builds a whole target sandbox"
22 commands["clean"]="clean-up build artifacts"
23 commands["create"]="create a package from external URLs"
24 commands["create-iso"]="create an ISO after a target build"
25 commands["list-errors"]="list build target errors"
26 commands["commit"]="commit changes to the T2 source tree"
27 commands["find"]="find package based on meta data"
28 commands["update"]="update a package meta-data version"
29 commands["upgrade"]="upgrade the system install packages"
30 commands["up|pull"]="update / pull t2 source tree changes"
32 usage() {
33 cat << EOT
34 Usage: t2 command <options>
35 Commands:
36 EOT
38 for i in "${!commands[@]}"; do
39 local desc=${commands[$i]}
40 local n=$((${#i} + 2))
41 local t="\t\t"
42 [ $n -gt 7 ] && t="\t"
43 echo -e " $i$t$desc"
44 done | sort
46 cat << EOT
47 Options:
48 -v, --verbose verbose operation
49 -c, --cfg config name
50 EOT
51 exit 1
54 cmd="$1"; shift
56 # convert modern --* args to backward-compat single-dash -*
57 declare -a args
58 for a; do
59 args+=(${a/--/-})
60 done
62 case "$cmd" in
63 config) exec scripts/Config "${args[@]}" ;;
64 bootstrap) exec scripts/Bootstrap "${args[@]}" ;;
65 build) exec scripts/Build-Pkg "${args[@]}" ;;
66 build-target) exec scripts/Build-Target "${args[@]}" ;;
67 clean) exec scripts/Cleanup "${args[@]}" ;;
68 create) exec scripts/Create-Pkg "${args[@]}" ;;
69 create-iso) exec scripts/Create-ISO "${args[@]}" ;;
70 list-errors) exec scripts/Create-ErrList "${args[@]}" ;;
71 commit) exec scripts/Commit "${args[@]}" ;;
72 download) exec scripts/Download "${args[@]}" ;;
73 find) exec scripts/Find-Pkg "${args[@]}" ;;
74 install) exec scripts/Emerge-Pkg "${args[@]}" ;;
75 update) exec scripts/Update-Pkg "${args[@]}" ;;
76 upgrade) exec scripts/Emerge-Pkg -system "${args[@]}" ;;
77 uninstall) exec mine -r "${args[@]}" ;;
78 up|pull) if [ -e .git ]; then exec git pull; else exec svn up; fi ;;
79 *) usage ;;
80 esac