protected function parseArgument($args, $argIndex, $startFrom, DefinedSwitch $switch, $switchSeen)
 {
     // initialise the return value
     $arg = null;
     // is the argument optional or required?
     if ($switch->testHasOptionalArgument()) {
         // it is optional ... but is
         // it there?
         if (isset($args[$argIndex])) {
             // yes it is
             $arg = substr($args[$argIndex], $startFrom);
         } else {
             $arg = $switch->arg->defaultValue;
             $argIndex--;
         }
     } else {
         // argument is required ... but
         // is it there?
         if (!isset($args[$argIndex])) {
             // no it is not
             // error!
             throw new \Exception('switch ' . $switchSeen . ' expected argument');
         }
         // yes it is
         $arg = substr($args[$argIndex], $startFrom);
         // did we get an argument?
         if (strlen(trim($arg)) == 0) {
             // no, we did not
             throw new \Exception('switch ' . $switchSeen . ' expected argument');
         }
     }
     return array($arg, $argIndex);
 }