@@ -6,26 +6,33 @@ if [[ ! -e "$(pwd)/scripts" ]]; then
66else
77 WORK_PATH=" $( pwd) "
88fi
9+
10+ LOG_FILEPATH=" /tmp/wlaset.log"
911SCRIPT_PATH=" $WORK_PATH /scripts"
1012SCRIPT_FILES=(messages paths config startup apply)
1113for script in " ${SCRIPT_FILES[@]} " ; do . " $SCRIPT_PATH /$script .sh" ; done
1214
1315# Options To be used
1416# TODO: Debug option
15- OPTS=$( getopt -o -v --long verbose,reset,load,reload,setup,gui,help -- " $@ " ) ; eval set -- " $OPTS "
17+ OPTS=$( getopt -o VRDLrh --long gui,setup,reset,debug,verbose,load,reload,help -- " $@ " )
18+ [ $? -ne 0 ] && exit 1 && eval set -- " $OPTS "
1619while true ; do
1720 case " $1 " in
1821 --gui) GUI=true; shift ;;
1922 --setup) SETUP=true; shift ;;
20- --reset) RESET=true; shift ;;
21- --verbose) VERBOSE=true; shift ;;
22- --load) LOAD=true; shift ;;
23- --reload) RELOAD=true; shift ;;
24- --help) echo " $HELP_MESSAGE " ; exit 0;;
23+ -R | --reset) RESET=true; shift ;;
24+ -D | --debug) DEBUG=true; shift ;;
25+ -V | --verbose) VERBOSE=true; shift ;;
26+ -L | --load) LOAD=true; shift ;;
27+ -r | --reload) RELOAD=true; shift ;;
28+ -h | --help) echo " $HELP_MESSAGE " ; exit 0;;
2529 * ) shift ; break ;;
2630 esac
2731done
2832
33+ # Debug option logic
34+ $DEBUG && cat " $LOG_FILEPATH " || LOG_FILEPATH=/dev/null
35+
2936# GUI dialog Configuration
3037if $GUI && $SETUP ; then
3138 VERBOSE=true ; verbose sorry " You can only select one of the config optios." ; exit 1
0 commit comments