Unit Command.Helpers

Uses
Classes, Interfaces, Objects and Records
Types
Constants
Variables

Description

This unit contains a set of simple functions that help to perform repetitive actions related to parsing the arguments passed by the command line.

Overview

Functions and Procedures

procedure AppendToArray(var AArray: TArray<string>; const AText: string);
function RemoveStartingDashes(const LOption: string): string;
function SplitOptionAndValue(var AOption: string): string;

Description

Functions and Procedures

procedure AppendToArray(var AArray: TArray<string>; const AText: string);

Appends a string to an array of string automatically increasing its size

Parameters
AArray
Variable of type TArray<string> to which an item will be added.
AText
String to be added to the array.
function RemoveStartingDashes(const LOption: string): string;

Removes the first "-" and second "-" characters if found from the string passed as a parameter. Returns a new string without these characters.

Parameters
LOption
String option passed as an argument via the command line that will be processed to remove the leading "-".
function SplitOptionAndValue(var AOption: string): string;

Given an option with value, split the option in two parts: the option name and the value. The option name is the part before the "=" character. The value is the part after the "=" character. If the option doesn't contain the "=" character, the value is empty. The function returns the value and keeps the only the option name in the parameter AOption.

Parameters
AOption
String option passed as an argument via the command line that will be processed split a possible value from the option name.

Generated by PasDoc 0.16.0.