elogger API
Overview Classes Cluster Class Index          Top Features

argument

Class AP_OPTION


Direct ancestors

AP_CONSTANTS

Known direct descendants

AP_OPTION_WITH_PARAMETER, AP_FLAG

Features

Invariants

indexing

description

Abstract representations of an option, that might or might not require an extra argument

library

Gobo Eiffel Argument Library

copyright

Copyright (c) 2006, Bernd Schoeller and others

license

Eiffel Forum License v2 (see forum.txt)

deferred class AP_OPTION

inherit

AP_CONSTANTS

feature -- Access

description: STRING

-- Description of this option

example: STRING

-- Example for the usage of the option (short preferred)

ensure

example_not_void: Result /= Void

long_form: STRING

-- Long form

name: STRING

-- Name of the option (short or long from)

ensure

name_not_void: Result /= Void

names: STRING

-- Names of the option (short and long)

ensure

names_not_void: Result /= Void

occurrences: INTEGER

-- Number of times this flag was encountered

deferred

short_form: CHARACTER

-- Short form

feature -- Status report

has_long_form: BOOLEAN

-- Does this option have a long form?

ensure

definition: Result = (long_form /= Void)

has_short_form: BOOLEAN

-- Does this option have a short form?

is_mandatory: BOOLEAN

-- Is the option not optional?

needs_parameter: BOOLEAN

-- Does this option need a parameter?

deferred

was_found: BOOLEAN

-- Was the option found during the last parse?

ensure

definition: Result = (occurrences > 0)

feature -- Element change

disable_mandatory

-- Make the option not mandatory.

ensure

not_mandatory: not is_mandatory

enable_mandatory

-- Make the option mandatory.

ensure

mandatory: is_mandatory

set_description (a_string: STRING)

-- Let the text a_string describe the option.

require

a_string_not_void: a_string /= Void

ensure

description_set: description = a_string

set_long_form (a_long_form: STRING)

-- Make a_long_form the long form.

require

a_long_form_not_void: a_long_form /= Void

ensure

has_long_form: has_long_form
long_form_set: long_form = a_long_form

set_short_form (a_short_form: CHARACTER)

-- Make a_short_form the short form.

ensure

has_short_form: has_short_form
short_form_set: short_form = a_short_form

feature -- Removal

remove_long_form

-- Remove the long form.

require

has_short_form: has_short_form

ensure

long_form_remove: not has_long_form

remove_short_form

-- Remove the short form.

require

has_long: has_long_form

ensure

short_form_remove: not has_short_form

feature -- Help Constants

help_text_description: STRING

-- Description of the 'display help text' option
-- (From AP_CONSTANTS)

help_text_long_option: STRING

-- Flag to show the help text, long form
-- (From AP_CONSTANTS)

help_text_short_option: CHARACTER

-- Flag to show the help text, short form
-- (From AP_CONSTANTS)

feature -- Option Constants

long_option_introduction: CHARACTER

-- Character that will introduce a long option (after the short option)
-- (From AP_CONSTANTS)

long_option_parameter_introduction: CHARACTER

-- Character that will introduce the parameter in an long option
-- (From AP_CONSTANTS)

short_option_introduction: CHARACTER

-- Character that will introduce a short option
-- (From AP_CONSTANTS)

feature -- Other Constants

abort_message: STRING

-- Final message to print before aborting
-- (From AP_CONSTANTS)

default_application_description: STRING

-- Default description for the application
-- (From AP_CONSTANTS)

default_parameters_description: STRING

-- Default description for parameters
-- (From AP_CONSTANTS)

maximum_application_name: INTEGER

-- Maximum length of the application that is accepted for
-- the terminal width to still show correct help messages
-- (From AP_CONSTANTS)

terminal_width: INTEGER

-- Width of the terminal to format the help text
-- (From AP_CONSTANTS)

feature {AP_PARSER} -- Parser Interface

record_occurrence (a_parser: AP_PARSER)

-- This option was found during parsing by a_parser.

require

a_parser_not_void: a_parser /= Void
deferred

ensure

occurrences_increased: occurrences = old occurrences + 1

reset

-- Reset the option to a clean state before parsing.

deferred

ensure

not_found: not was_found

invariant

has_short_or_long: has_long_form or has_short_form
occurrences_not_negative: occurrences >= 0

-- From AP_CONSTANTS
reasonable_application_name: maximum_application_name <= terminal_width - 10

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

Documentation generated by edoc