/** * Adds a default parameter for this CLI call. DefaultIdentifier will be alphanumeric with underscores in all caps. * Because default parameters are required, there is no default value to specify. * Note that since defualt parameters MUST be passed in, there is no short or long (-x or --xxx) identifiers associated with them. * The identifier specified is simply for internal use. Processing of default identifiers are done in the order they are added * to the class. So for example, if default identifiers are added in the following way: * $this->AddDefaultParameter('USERNAME', QCliParameterType::String, 'Your Username'); * $this->AddDefaultParameter('PASSWORD', QCliParameterType::String, 'Your Possword'); * $this->AddDefaultParameter('PATH_TO_FILE', QCliParameterType::Path, 'Path to the given file'); * then the call to the CLI must follow with USERNAME PASSWORD PATH_TO_FILE. * @param string $strDefaultIdentifier * @param QCliParameterType $intCliParameterType * @param string $strHelpText * @return void */ public function AddDefaultParameter($strDefaultIdentifier, $intCliParameterType, $strHelpText) { // Cleanup the Identifier, and throw in invalid try { $strDefaultIdentifier = QCliParameterProcessor::CleanDefaultIdentifier($strDefaultIdentifier); } catch (QInvalidCastException $objExc) { $objExc->IncrementOffset(); throw $objExc; } // Ensure DefaultIdentifier is not already in use if ($strDefaultIdentifier && array_key_exists($strDefaultIdentifier, $this->strDefaultIdentifierArray)) { throw new QCallerException('DefaultIdentifier already in use: ' . $strDefaultIdentifier); } // Get the ValueIndex for this flag, and set the value to false $intIndex = count($this->mixDefaultValueArray); $this->mixDefaultValueArray[$intIndex] = null; $this->intDefaultParameterTypeArray[$intIndex] = $intCliParameterType; $this->strDefaultHelpTextArray[$intIndex] = $strHelpText; $this->strDefaultIdentifierArray[$intIndex] = $strDefaultIdentifier; }