2 # --- T2-COPYRIGHT-BEGIN ---
4 # Copyright (C) 2023 - 2025 The T2 SDE Project
5 # SPDX-License-Identifier: GPL-2.0
6 # --- T2-COPYRIGHT-END ---
9 [ "$top" ] && cd ${top%/*}
13 commands
["bootstrap"]="bootstrap vital deps on homebrew systems"
14 commands
["config"]="creates a target configuration profile"
15 commands
["install"]="installs a package and its dependencies"
16 commands
["uninstall"]="uninstalls a package from the system"
17 commands
["download"]="downloads assets of a package"
18 commands
["build"]="builds a package from source"
19 commands
["build-target"]="builds a whole target sandbox"
20 commands
["clean"]="clean-up build artifacts"
21 commands
["create"]="create a package from external URLs"
22 commands
["create-iso"]="create an ISO after a target build"
23 commands
["list-errors"]="list build target errors"
24 commands
["commit"]="commit changes to the T2 source tree"
25 commands
["find"]="find package based on meta data"
26 commands
["update"]="update a package meta-data version"
27 commands
["upgrade"]="upgrade the system install packages"
28 commands
["up|pull"]="update / pull t2 source tree changes"
32 Usage: t2 command <options>
36 for i
in "${!commands[@]}"; do
37 local desc
=${commands[$i]}
38 local n
=$
((${#i} + 2))
40 [ $n -gt 7 ] && t
="\t"
46 -v, --verbose verbose operation
52 # convert modern --* args to backward-compat single-dash -*
53 # and save the first non option as cmd
58 [[ -z "$cmd" && "$a" = [^
-]* && ( ${#args[*]} -eq 0 ||
${args[-1]} != "-cfg" ) ]] && cmd
="$a" && continue
63 conf|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|ci
) exec scripts
/Commit
"${args[@]}" ;;
72 download|dl
) exec scripts
/Download
"${args[@]}" ;;
73 find) exec scripts
/Find-Pkg
"${args[@]}" ;;
74 install|inst
) 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 ;;