Automatic generation produced by ISE Eiffel
note description: "Argument parser that accepts only switch options." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date: 2015-12-17 04:34:17 -0900 (Thu, 17 Dec 2015) $" revision: "$Revision: 98279 $" deferred class interface ARGUMENT_OPTION_PARSER feature -- Access frozen application_base: STRING_8 -- The base location of application. -- (from ARGUMENT_BASE_PARSER) ensure -- from ARGUMENT_BASE_PARSER result_attached: Result /= Void not_result_is_empty: not Result.is_empty no_trailing_separator: Result.item (Result.count) /= Operating_environment.Directory_separator frozen Error_messages: ARRAYED_LIST [STRING_8] -- Any error messages generated during parse and validation, if any. -- (from ARGUMENT_BASE_PARSER) ensure -- from ARGUMENT_BASE_PARSER result_attached: Result /= Void result_contains_attached_valid_items: not Result.there_exists (agent {STRING_8}.is_empty) result_contains_attached_items: Assertions.sequence_contains_attached_items (Result) generating_type: TYPE [detachable ARGUMENT_OPTION_PARSER] -- Type of current object -- (type of which it is a direct instance) -- (from ANY) ensure -- from ANY generating_type_not_void: Result /= Void generator: STRING_8 -- Name of current object's generating class -- (base class of the type of which it is a direct instance) -- (from ANY) ensure -- from ANY generator_not_void: Result /= Void generator_not_empty: not Result.is_empty frozen option_values: LIST [ARGUMENT_OPTION] -- Option values parsed via command line, these do not include the loose arguments. See `values`. -- (from ARGUMENT_BASE_PARSER) ensure -- from ARGUMENT_BASE_PARSER result_attached: Result /= Void result_contains_attached_items: Assertions.sequence_contains_attached_items (Result) frozen values: LIST [STRING_8] -- List of arguments values that were not qualified with a switch (aka loose arguments). -- (from ARGUMENT_BASE_PARSER) ensure -- from ARGUMENT_BASE_PARSER result_attached: Result /= Void result_contains_attached_valid_items: not Result.there_exists (agent {STRING_8}.is_empty) result_contains_attached_items: Assertions.sequence_contains_attached_items (Result) feature -- Comparison frozen deep_equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void -- or attached to isomorphic object structures? -- (from ANY) ensure -- from ANY instance_free: class shallow_implies_deep: standard_equal (a, b) implies Result both_or_none_void: (a = Void) implies (Result = (b = Void)) same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b)) symmetric: Result implies deep_equal (b, a) frozen equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void or attached -- to objects considered equal? -- (from ANY) ensure -- from ANY instance_free: class definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.is_equal (b)) frozen is_deep_equal alias "≡≡≡" (other: ARGUMENT_OPTION_PARSER): BOOLEAN -- Are Current and other attached to isomorphic object structures? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY shallow_implies_deep: standard_is_equal (other) implies Result same_type: Result implies same_type (other) symmetric: Result implies other.is_deep_equal (Current) is_equal (other: ARGUMENT_OPTION_PARSER): BOOLEAN -- Is other attached to an object considered -- equal to current object? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY symmetric: Result implies other ~ Current consistent: standard_is_equal (other) implies Result frozen standard_equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void or attached to -- field-by-field identical objects of the same type? -- Always uses default object comparison criterion. -- (from ANY) ensure -- from ANY instance_free: class definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.standard_is_equal (b)) frozen standard_is_equal alias "≜" (other: ARGUMENT_OPTION_PARSER): BOOLEAN -- Is other attached to an object of the same type -- as current object, and field-by-field identical to it? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY same_type: Result implies same_type (other) symmetric: Result implies other.standard_is_equal (Current) feature -- Status report conforms_to (other: ANY): BOOLEAN -- Does type of current object conform to type -- of other (as per Eiffel: The Language, chapter 13)? -- (from ANY) require -- from ANY other_not_void: other /= Void has_executed: BOOLEAN -- Indiciate if execution has occurred (a call to `execute`). -- (from ARGUMENT_BASE_PARSER) frozen has_non_switched_argument: BOOLEAN -- Determines if one or more non-switch qualified arguments were specified in the command-line arguments. -- (from ARGUMENT_BASE_PARSER) ensure -- from ARGUMENT_BASE_PARSER result_true: Result = (has_parsed and then not values.is_empty) frozen has_option (a_name: READABLE_STRING_8): BOOLEAN -- Determines if switch option was specified in the command-line arguments. -- -- a_name: The name of the switch to check existence for. -- Result: True if the command line specified the given switch; False otherwise. -- (from ARGUMENT_BASE_PARSER) require -- from ARGUMENT_BASE_PARSER a_name_attached: a_name /= Void not_a_name_is_empty: not a_name.is_empty ensure -- from ARGUMENT_BASE_PARSER result_true: Result = (has_parsed and then internal_option_of_name (a_name) /= Void) is_showing_argument_usage_inline: BOOLEAN assign set_is_showing_argument_usage_inline -- Indiciate if argument switch value descriptions should be shown inline -- with the argument description -- (from ARGUMENT_BASE_PARSER) is_successful: BOOLEAN -- Indicates if parsing completed without errors. -- (from ARGUMENT_BASE_PARSER) ensure -- from ARGUMENT_BASE_PARSER error_messages_is_empty: Result implies has_parsed and then Error_messages.is_empty is_usage_displayed_on_error: BOOLEAN assign set_is_usage_displayed_on_error -- Indicates if usage should be shown on an error. -- (from ARGUMENT_BASE_PARSER) is_usage_verbose: BOOLEAN assign set_is_usage_verbose -- Indicates if the usage information should be verbose. -- (from ARGUMENT_BASE_PARSER) is_using_separated_switch_values: BOOLEAN assign set_is_using_separated_switch_values -- Indicates if switch values are separated from their switch and not -- qualified using a ':' (by default) -- (from ARGUMENT_BASE_PARSER) same_type (other: ANY): BOOLEAN -- Is type of current object identical to type of other? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY definition: Result = (conforms_to (other) and other.conforms_to (Current)) feature -- Duplication copy (other: ARGUMENT_OPTION_PARSER) -- Update current object using fields of object attached -- to other, so as to yield equal objects. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_equal: Current ~ other frozen deep_copy (other: ARGUMENT_OPTION_PARSER) -- Effect equivalent to that of: -- `copy` (other . `deep_twin`) -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY deep_equal: deep_equal (Current, other) frozen deep_twin: ARGUMENT_OPTION_PARSER -- New object structure recursively duplicated from Current. -- (from ANY) ensure -- from ANY deep_twin_not_void: Result /= Void deep_equal: deep_equal (Current, Result) frozen standard_copy (other: ARGUMENT_OPTION_PARSER) -- Copy every field of other onto corresponding field -- of current object. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_standard_equal: standard_is_equal (other) frozen standard_twin: ARGUMENT_OPTION_PARSER -- New object field-by-field identical to other. -- Always uses default copying semantics. -- (from ANY) ensure -- from ANY standard_twin_not_void: Result /= Void equal: standard_equal (Result, Current) frozen twin: ARGUMENT_OPTION_PARSER -- New object equal to Current -- `twin` calls `copy`; to change copying/twinning semantics, redefine `copy`. -- (from ANY) ensure -- from ANY twin_not_void: Result /= Void is_equal: Result ~ Current feature -- Basic operations frozen default: detachable ARGUMENT_OPTION_PARSER -- Default value of object's type -- (from ANY) frozen default_pointer: POINTER -- Default value of type POINTER -- (Avoid the need to write p.`default` for -- some p of type POINTER.) -- (from ANY) ensure -- from ANY instance_free: class default_rescue -- Process exception for routines with no Rescue clause. -- (Default: do nothing.) -- (from ANY) frozen do_nothing -- Execute a null action. -- (from ANY) ensure -- from ANY instance_free: class feature -- Basic Operations execute (a_action: PROCEDURE) -- Main entry point, which parses the supplied command line arguments and then executes the -- supplied action if parsing an argument validation was successful. -- -- a_action: The action to call to start the application when the arguments have been parsed -- and validated. -- (from ARGUMENT_BASE_PARSER) require -- from ARGUMENT_BASE_PARSER a_action_attached: a_action /= Void not_has_executed: not has_executed ensure -- from ARGUMENT_BASE_PARSER has_executed: has_executed feature -- Output Io: STD_FILES -- Handle to standard file setup -- (from ANY) ensure -- from ANY instance_free: class io_not_void: Result /= Void out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) ensure -- from ANY out_not_void: Result /= Void print (o: detachable ANY) -- Write terse external representation of o -- on standard output. -- (from ANY) ensure -- from ANY instance_free: class frozen tagged_out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) ensure -- from ANY tagged_out_not_void: Result /= Void feature -- Platform Operating_environment: OPERATING_ENVIRONMENT -- Objects available from the operating system -- (from ANY) ensure -- from ANY instance_free: class operating_environment_not_void: Result /= Void feature -- Status Setting set_is_showing_argument_usage_inline (a_show: like is_showing_argument_usage_inline) -- Sets usage formatter to display the switch arguments inline with the switch usage description. -- -- a_show: True show arguments in line; False to display the arguments after the usage. -- (from ARGUMENT_BASE_PARSER) require -- from ARGUMENT_BASE_PARSER not_has_executed: not has_executed ensure -- from ARGUMENT_BASE_PARSER is_showing_argument_usage_inline_set: is_showing_argument_usage_inline = a_show set_is_usage_displayed_on_error (a_display: like is_usage_displayed_on_error) -- Sets usage formatter to display the help information when an error occurs in parsing or -- validation. -- -- a_display: True to display the usage on error; False otherwise. -- (from ARGUMENT_BASE_PARSER) require -- from ARGUMENT_BASE_PARSER not_has_executed: not has_executed ensure -- from ARGUMENT_BASE_PARSER is_usage_displayed_on_error_set: is_usage_displayed_on_error = a_display set_is_usage_verbose (a_verbose: like is_usage_verbose) -- Sets usage formatter to display a much information as possible. -- -- a_verbose: True to display verbose usage; False otherwise. -- (from ARGUMENT_BASE_PARSER) require -- from ARGUMENT_BASE_PARSER not_has_executed: not has_executed ensure -- from ARGUMENT_BASE_PARSER is_usage_verbose_set: is_usage_verbose = a_verbose set_is_using_separated_switch_values (a_use: like is_using_separated_switch_values) -- Sets parser's state to indicate if the user's input should use whitespace to separate -- switches from their argument values. -- -- a_use: True to use whitespace separators; False to use the default separated character. -- (from ARGUMENT_BASE_PARSER) require -- from ARGUMENT_BASE_PARSER not_has_executed: not has_executed ensure -- from ARGUMENT_BASE_PARSER is_using_separated_switch_values_set: is_using_separated_switch_values = a_use invariant not_is_allowing_non_switched_arguments: not is_allowing_non_switched_arguments -- from ARGUMENT_BASE_PARSER not_is_non_switch_argument_required: not is_allowing_non_switched_arguments implies not is_non_switch_argument_required is_successful_means_has_parsed: is_successful implies has_parsed -- from ANY reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) note copyright: "Copyright (c) 1984-2009, Eiffel Software" license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" licensing_options: "http://www.eiffel.com/licensing" copying: "[ This file is part of Eiffel Software's Eiffel Development Environment. Eiffel Software's Eiffel Development Environment is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License (available at the URL listed under "license" above). Eiffel Software's Eiffel Development Environment is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Eiffel Software's Eiffel Development Environment; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ]" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class ARGUMENT_OPTION_PARSER -- Generated by Eiffel Studio --
For more details: eiffel.org