Class ACommandLineFlag

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type ACommandLineFlag = class(ACommandLineOption)

Description

This class represents a command-line flag; that is, an option with a value that is only true if the user specifies the name of the option on the command line.

Flag values accept no parameters; merely their presence on the command line is enough to trigger them. The most common flag value is, of course, --help, the presence of which indicates that the user wants more information on the various options available for invoking the program.

Hierarchy

Overview

Methods

Public function init: boolean; override;
Public function setValue(const newValue: Variant; const makeDirty: boolean = true): Variant; override;

Description

Methods

Public function init: boolean; override;

Initializer

Public function setValue(const newValue: Variant; const makeDirty: boolean = true): Variant; override;

Set the value of the option.

This method overrides the behavior inherited from ACommandLineOption.setValue; it attempts to cast newValue to a boolean value, since flags may only represent conditions that are True or False.

Returns

The previous value of ACommandLineFlag.value.

Exceptions raised
AnOptionValueError
in the event that the attempt to cast newValue to a boolean value fails.

Generated by PasDoc 0.13.0 on 2015-06-25 11:07:51