elogger API
Overview Classes Cluster Class Index          Top Features

argument

Class AP_DISPLAY_HELP_FLAG


Direct ancestors

AP_FLAG, KL_SHARED_EXCEPTIONS, KL_SHARED_FILE_SYSTEM, KL_SHARED_ARGUMENTS

Creation

Features

Invariants

indexing

description

Flags that will generate a help text and terminate the application

library

Gobo Eiffel Argument Library

copyright

Copyright (c) 2006, Bernd Schoeller and others

license

Eiffel Forum License v2 (see forum.txt)

class AP_DISPLAY_HELP_FLAG

inherit

AP_FLAG
AP_OPTION
KL_SHARED_EXCEPTIONS
KL_SHARED_FILE_SYSTEM
KL_SHARED_ARGUMENTS

create

make (a_short_form: CHARACTER; a_long_form: STRING)

-- Make an option that has a_short_form as short form and a_long_form
-- as long form.
-- (From AP_OPTION)

require

a_long_form_not_void: a_long_form /= Void

ensure

short_form_set: has_short_form and short_form = a_short_form
long_form_set: has_long_form and long_form = a_long_form

make_with_long_form (a_long_form: STRING)

-- Make an option that a_long_form as long form.
-- (From AP_OPTION)

require

a_long_form_not_void: a_long_form /= Void

ensure

no_short_form: not has_short_form
long_form_set: has_long_form and long_form = a_long_form

make_with_short_form (a_short_form: CHARACTER)

-- Make an option that has a_short_form as short form.
-- (From AP_OPTION)

ensure

short_form_set: has_short_form and short_form = a_short_form
no_long_form: not has_long_form

feature -- Access

description: STRING

-- Description of this option
-- (From AP_OPTION)

example: STRING

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

ensure

example_not_void: Result /= Void

long_form: STRING

-- Long form
-- (From AP_OPTION)

name: STRING

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

ensure

name_not_void: Result /= Void

names: STRING

-- Names of the option (short and long)
-- (From AP_OPTION)

ensure

names_not_void: Result /= Void

short_form: CHARACTER

-- Short form
-- (From AP_OPTION)

Exceptions: KL_EXCEPTIONS

-- Exception handling
-- (From KL_SHARED_EXCEPTIONS)

ensure

exceptions_not_void: Result /= Void

Arguments: KL_ARGUMENTS

-- Command-line arguments
-- (From KL_SHARED_ARGUMENTS)

ensure

arguments_not_void: Result /= Void

occurrences: INTEGER

-- Number of times this flag was encountered
-- (From AP_OPTION)

feature -- Status report

has_long_form: BOOLEAN

-- Does this option have a long form?
-- (From AP_OPTION)

ensure

definition: Result = (long_form /= Void)

has_short_form: BOOLEAN

-- Does this option have a short form?
-- (From AP_OPTION)

is_mandatory: BOOLEAN

-- Is the option not optional?
-- (From AP_OPTION)

was_found: BOOLEAN

-- Was the option found during the last parse?
-- (From AP_OPTION)

ensure

definition: Result = (occurrences > 0)

needs_parameter: BOOLEAN

-- Does this option need a parameter?
-- (From AP_OPTION)

feature -- Element change

disable_mandatory

-- Make the option not mandatory.
-- (From AP_OPTION)

ensure

not_mandatory: not is_mandatory

enable_mandatory

-- Make the option mandatory.
-- (From AP_OPTION)

ensure

mandatory: is_mandatory

set_description (a_string: STRING)

-- Let the text a_string describe the option.
-- (From AP_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.
-- (From AP_OPTION)

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.
-- (From AP_OPTION)

ensure

has_short_form: has_short_form
short_form_set: short_form = a_short_form

feature -- Removal

remove_long_form

-- Remove the long form.
-- (From AP_OPTION)

require

has_short_form: has_short_form

ensure

long_form_remove: not has_long_form

remove_short_form

-- Remove the short form.
-- (From AP_OPTION)

require

has_long: has_long_form

ensure

short_form_remove: not has_short_form

feature -- Constants

option_description_indentation: INTEGER

-- Number of characters for the indentation of the option
-- text

text_before_description: STRING

-- Text that separates the usage instructions and the
-- application description

text_before_options: STRING

-- Text that introduces the options

text_below_description: STRING

-- Text that separates the application description and the
-- list of options

usage_header: STRING

-- Text that is used to introduce usage instructions

feature -- File systems

file_system: KL_FILE_SYSTEM

-- Underlying file system
-- (From KL_SHARED_FILE_SYSTEM)

ensure

file_system_not_void: Result /= Void
current_file_system: Result.is_current_file_system

unix_file_system: KL_UNIX_FILE_SYSTEM

-- Unix-like file system
-- (From KL_SHARED_FILE_SYSTEM)

ensure

file_system_not_void: Result /= Void

windows_backslash_only_file_system: KL_WINDOWS_FILE_SYSTEM

-- Windows-like file system which accepts only \ as
-- directory separator
-- (From KL_SHARED_FILE_SYSTEM)

ensure

file_system_not_void: Result /= Void

windows_file_system: KL_WINDOWS_FILE_SYSTEM

-- Windows-like file system which accepts both
-- \ and / as directory separator
-- (From KL_SHARED_FILE_SYSTEM)

ensure

file_system_not_void: Result /= Void

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 -- Help Display

display_help (a_parser: AP_PARSER)

-- Display the help text for a_parser (and die afterwards).

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)

-- The option was found during parsing. Display the help text and
-- terminate the application.
-- (From AP_OPTION)

require

a_parser_not_void: a_parser /= Void

ensure

occurrences_increased: occurrences = old occurrences + 1

reset

-- Reset the option to a clean state before parsing.
-- (From AP_OPTION)

ensure

not_found: not was_found

feature -- Obsolete

exceptions_: KL_EXCEPTIONS

-- Exception handling
-- (From KL_SHARED_EXCEPTIONS)

obsolete

[040101] Use Exceptions instead.

ensure

exceptions_not_void: Result /= Void

invariant

reasonable_option_indentation: option_description_indentation < terminal_width

-- From AP_FLAG
flags_do_not_have_parameters: not needs_parameter

-- From AP_OPTION
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