12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/bin/bash
- #shellcheck disable=SC2034
- # mkit - simple install helper
- # See LICENSE file for copyright and license details.
-
- init_core() {
- #
- # Load core module (or die)
- #
- #shellcheck disable=SC1090
- . "$MKIT_DIR/include/mkit.sh" \
- && . "$MKIT_DIR/include/vars.sh" \
- && return 0
- echo "failed to load core; check if MKIT_DIR is set properly: $MKIT_DIR" >&2
- exit 9
- }
-
- #
- # Path to MKit dir (where 'include' is)
- #
- MKIT_DIR=${MKIT_DIR:-$(dirname "$0")}
-
- just_ini() {
- #
- # Just do one mkit.ini operation $1
- #
- local op=$1
- local key=$2
- mkit_init || return $?
- ini "$op" "$key"
- }
-
- main () {
- init_core
- case "$1" in
- -V|--version-semver) echo "$MKIT_VERSION"; exit 0 ;;
- -i|--ini-1value) just_ini 1value "$2"; exit $? ;;
- -I|--ini-values) just_ini values "$2"; exit $? ;;
- --ini-lskeys) just_ini lskeys "$2"; exit $? ;;
- --ini-lssect) just_ini lssect "$2"; exit $? ;;
- --ini-sec) just_ini sec "$2"; exit $? ;;
- --version) echo "Mkit (Simple Makefile target helper) $MKIT_VERSION"
- exit 0 ;;
- esac
- mkit_init
- route "$@"
- }
-
- main "$@"
|