#!/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>"

### new.method

parameterTestScript.one() # <sshConfigName> # lists the ids you have on this user
{
  echo one
  create.result 0 "That myID create worked well"
  export RESULT
}

parameterTestScript.oneDefaultValue() # <sshConfigName:marcel.iMac> # lists the ids you have on this user
{
  if [ "$1" = "marcel.iMac" ]; then
    success.log "parameterTestScript.oneDefaultValue completed parameter one correctly to marcel.iMac"
    return 0
  else
    warn.log "parameterTestScript.oneDefaultValue did not recieve: marcel.iMac but: $1"
    return 1
  fi
}

parameterTestScript.oneDefaultValueQuotes() # <sshConfigName:'marcel iMac'> # lists the ids you have on this user
{
  warn.log "currently not supported"
}


parameterTestScript.optional() # <?id> # lists the ids you have on this user
{
  echo optional
}

parameterTestScript.optionalDefaultValue() # <?id:123> # lists the ids you have on this user
{
  echo optional 123
}

parameterTestScript.none() #  # function with no parameter completes to ;
{
  important.log "parameterTestScript.none went well"
}

parameterTestScript.noop() # # method with no parameters - used for testing empty completion
{
  echo "noop executed"
}


parameterTestScript.parameter.completion.id() {
  ls ~/.ssh/ids
}

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

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

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

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

  this.start "$@"
}

parameterTestScript.start "$@"

