#!/usr/bin/env bash
#clear
#export PS4='\e[90m+${LINENO} in ${#BASH_SOURCE[@]}>${FUNCNAME[0]}:${BASH_SOURCE[@]##*/} \e[0m'
#set -x

#echo "starting: $0 <LOG_LEVEL=$1>"

private.check.course.intro()     #  #  # an example
{
 local arg1="$1"
 if [ -n "$arg1" ]; then
   shift
   create.result 0 "arg1 is set to $arg1"
 else
  arg1=defualtValue
  create.result 1 "arg1 missing. Using: $arg1"
 fi
 info.log "arg1 is set to $arg1"

  xdg-open https://drive.google.com/file/d/1UuVFdav0diZpDT3i9V8O9FosyrKxuXMo/view?usp=sharing

 return $(result)
}

private.check.finished()     #  #  # an example
{
 local arg1="$1"
 if [ -n "$arg1" ]; then
   shift
   create.result 0 "arg1 is set to $arg1"
 else
  arg1=defualtValue
  create.result 1 "arg1 missing. Using: $arg1"
 fi
 info.log "arg1 is set to $arg1"


 return $(result)
}

academyScript.course() # # list available courses
{
  create.result 0 ""
  return $(result)
}

### new.method

academyScript.usage()
{
  local this=${0##*/}
  echo "You started" 
  echo "$0

  Usage:
  $this: command   Parameter and Description"
  this.help
  echo "
  
  Examples
    $this v
    $this init
    $this course 
    ----------
  "
}

academyScript.start()
{
  #echo "sourcing init"
  source this

  # if [ -z "$1" ]; then
  #   status.discover "$@"
  #   return 0
  # fi

  this.start "$@"
}

academyScript.start "$@"

