dm_arg_read Function

public function dm_arg_read(args, app, major, minor, patch, version) result(rc)

Uses

  • proc~~dm_arg_read~~UsesGraph proc~dm_arg_read dm_arg_read module~dm_version dm_version proc~dm_arg_read->module~dm_version

Reads all arguments from command-line and prints error message if one is missing. Returns the error code of the first invalid argument.

The function also parses the command-line arguments for -v/--version to display the current application and library version, and -h/--help to output all available command-line arguments. If one of these arguments is passed, dm_stop(0) is called afterwards.

Optional argument version may be a string of third-party library names and version numbers.

The function returns the following error codes:

  • E_EMPTY if array of arguments is empty.
  • E_ARG_INVALID if an required argument has not been passed.
  • E_ARG_NO_VALUE if an argument has been passed without value.
  • E_ARG_TYPE if an argument has the wrong type.
  • E_ARG_LENGTH if the length of the argument is wrong.
  • E_ARG_UNKNOWN if an unknown argument has been passed.

Arguments

Type IntentOptional Attributes Name
type(arg_type), intent(inout) :: args(:)

Arguments to match.

character(len=*), intent(in), optional :: app

App name (for -v).

integer, intent(in), optional :: major

Major version number (for -v).

integer, intent(in), optional :: minor

Minor version number (for -v).

integer, intent(in), optional :: patch

Patch level (for -v).

character(len=*), intent(in), optional :: version

Additional version string.

Return Value integer


Calls

proc~~dm_arg_read~~CallsGraph proc~dm_arg_read dm_arg_read interface~dm_itoa dm_itoa proc~dm_arg_read->interface~dm_itoa interface~dm_version_out dm_version_out proc~dm_arg_read->interface~dm_version_out proc~dm_arg_has dm_arg_has proc~dm_arg_read->proc~dm_arg_has proc~dm_arg_help dm_arg_help proc~dm_arg_read->proc~dm_arg_help proc~dm_arg_parse dm_arg_parse proc~dm_arg_read->proc~dm_arg_parse proc~dm_arg_type_is_valid dm_arg_type_is_valid proc~dm_arg_read->proc~dm_arg_type_is_valid proc~dm_arg_validate dm_arg_validate proc~dm_arg_read->proc~dm_arg_validate proc~dm_error_out dm_error_out proc~dm_arg_read->proc~dm_error_out proc~dm_is_error dm_is_error proc~dm_arg_read->proc~dm_is_error proc~dm_stop dm_stop proc~dm_arg_read->proc~dm_stop proc~dm_arg_has->proc~dm_arg_parse proc~dm_arg_parse->proc~dm_error_out proc~dm_ascii_escape dm_ascii_escape proc~dm_arg_parse->proc~dm_ascii_escape proc~dm_arg_validate->interface~dm_itoa proc~dm_arg_validate->proc~dm_arg_type_is_valid proc~dm_arg_validate->proc~dm_is_error interface~dm_string_to dm_string_to proc~dm_arg_validate->interface~dm_string_to proc~dm_file_exists dm_file_exists proc~dm_arg_validate->proc~dm_file_exists proc~dm_id_is_valid dm_id_is_valid proc~dm_arg_validate->proc~dm_id_is_valid proc~dm_log_level_from_string dm_log_level_from_string proc~dm_arg_validate->proc~dm_log_level_from_string proc~dm_log_level_is_valid dm_log_level_is_valid proc~dm_arg_validate->proc~dm_log_level_is_valid proc~dm_time_is_valid dm_time_is_valid proc~dm_arg_validate->proc~dm_time_is_valid proc~dm_uuid4_is_valid dm_uuid4_is_valid proc~dm_arg_validate->proc~dm_uuid4_is_valid proc~dm_error_out->proc~dm_stop proc~dm_error_out->proc~dm_ascii_escape proc~dm_error_message dm_error_message proc~dm_error_out->proc~dm_error_message c_exit c_exit proc~dm_stop->c_exit proc~dm_log_level_from_string->interface~dm_string_to proc~dm_is_ok dm_is_ok proc~dm_log_level_from_string->proc~dm_is_ok proc~dm_log_level_from_name dm_log_level_from_name proc~dm_log_level_from_string->proc~dm_log_level_from_name proc~dm_ascii_is_digit dm_ascii_is_digit proc~dm_time_is_valid->proc~dm_ascii_is_digit interface~dm_to_lower dm_to_lower proc~dm_log_level_from_name->interface~dm_to_lower proc~dm_string_to_lower dm_string_to_lower interface~dm_to_lower->proc~dm_string_to_lower