+# Any version-related directories should be unlinked and relinked to the correct version
+# (for example: 'go' is special and needs both $HOME/go and $HOME/.local/opt/go)
+# (others like 'rg', 'hugo', and 'caddy' are single files that just get replaced)
+pkg_switch_version() {
+ rm -rf "$pkg_common_opt"
+ ln -s "$pkg_new_opt" "$pkg_common_opt"
+}
+
+# Different packages represent the version in different ways
+# ex: node v12.8.0 (leading 'v')
+# ex: go1.14 (no space, nor trailing '.0's)
+# ex: flutter 1.17.2 (plain)
+pkg_format_cmd_version() {
+ my_version=$1
+ echo "$pkg_cmd_name $my_version"
+}