1
0
Fork 0
mirror of https://gitlab.com/niansa/magicwrap.git synced 2025-03-06 20:48:30 +01:00
magicwrap/main.sh

55 lines
1,011 B
Bash
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#! /bin/bash
#INIT
cd "$(dirname "${BASH_SOURCE[0]}")"
params="$(echo "$@" | sed 's|'"$1"'||1' 2> /dev/null)"
#LIBRARY
. ./library.sh
#FUNCTIONS
runmw () {
./mw.sh $params
}
applymodset () {
moddir="./modules/"
modset="$1"
. ./scripts/modulemgr/modset.sh
}
showhelp () {
sed -e '1,/#\HELPPART/d' "$0"
}
readme () {
mdp ./README.md ||
less ./README.md ||
cat ./README.md
}
showlicense () {
less ./LICENSE
}
#MAIN
case "$1" in
start) runmw
;;
modset) applymodset "$2"
;;
license) showlicense
;;
readme) readme
;;
*) showhelp
;;
esac
exit
#HELPPART
COMMAND LINE OVERVIEW
Command | Usage | Description
start | <command> | Start Magicwrap
modset | <modset> | Apply a module set
Documentation
help | | Show this help
readme | | Show readme
license | | Show license