Command Line Interface (CLI) class.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | progname |
Program name. |
||
character(len=:), | public, | allocatable | :: | version |
Program version. |
||
character(len=:), | public, | allocatable | :: | help |
Help message. |
||
character(len=:), | public, | allocatable | :: | help_color |
ANSI color of help messages. |
||
character(len=:), | public, | allocatable | :: | help_style |
ANSI style of help messages. |
||
character(len=:), | public, | allocatable | :: | help_markdown |
Longer help message, markdown formatted. |
||
character(len=:), | public, | allocatable | :: | description |
Detailed description. |
||
character(len=:), | public, | allocatable | :: | license |
License description. |
||
character(len=:), | public, | allocatable | :: | authors |
Authors list. |
||
character(len=:), | public, | allocatable | :: | epilog |
Epilogue message. |
||
character(len=:), | public, | allocatable | :: | m_exclude |
Mutually exclude other CLA(s group). |
||
character(len=:), | public, | allocatable | :: | error_message |
Meaningful error message to standard-error. |
||
character(len=:), | public, | allocatable | :: | error_color |
ANSI color of error messages. |
||
character(len=:), | public, | allocatable | :: | error_style |
ANSI style of error messages. |
||
character(len=512), | public, | allocatable | :: | examples(:) |
Examples of correct usage. |
||
integer(kind=I4P), | public | :: | error | = | 0_I4P |
Error trapping flag. |
|
integer(kind=I4P), | public | :: | usage_lun | = | stderr |
Output unit to print help/usage messages |
|
integer(kind=I4P), | public | :: | version_lun | = | stdout |
Output unit to print version message |
|
integer(kind=I4P), | public | :: | error_lun | = | stderr |
Error unit to print error messages |
|
type(command_line_arguments_group), | private, | allocatable | :: | clasg(:) |
CLA list [1:Na]. |
||
character(len=512), | private, | allocatable | :: | args(:) |
Actually passed command line arguments. |
||
logical, | private | :: | disable_hv | = | .false. |
Disable automatic ‘help’ and ‘version’ CLAs. |
|
logical, | private | :: | is_parsed_ | = | .false. |
Parse status. |
|
logical, | private | :: | ignore_unknown_clas | = | .false. |
Disable errors-raising for passed unknown CLAs. |
|
integer(kind=I4P), | private | :: | error_unknown_clas | = | 0_I4P |
Error trapping flag for unknown CLAs. |
Free dynamic memory when finalizing.
Free dynamic memory when finalizing.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(command_line_interface), | intent(inout) | :: | self |
CLI data. |
Free dynamic memory.
Free dynamic memory.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(object), | intent(inout) | :: | self |
Object data. |
Print version.
Print version.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(object), | intent(in) | :: | self |
Object data. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
Print meaningful error message.
Print meaningful error message to standard-error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(object), | intent(in) | :: | self |
Object data. |
Set examples of correct usage.
Set examples of correct usage.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(object), | intent(inout) | :: | self |
Object data. |
||
character(len=*), | intent(in), | optional | :: | examples(1:) |
Examples of correct usage. |
Assignment overloading.
Assign two abstract objects.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(object), | intent(inout) | :: | lhs |
Left hand side. |
||
class(object), | intent(in) | :: | rhs |
Rigth hand side. |
Free dynamic memory.
Free dynamic memory.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
Initialize CLI.
Initialize CLI.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | progname |
Program name. |
|
character(len=*), | intent(in), | optional | :: | version |
Program version. |
|
character(len=*), | intent(in), | optional | :: | help |
Help message introducing the CLI usage. |
|
character(len=*), | intent(in), | optional | :: | description |
Detailed description message introducing the program. |
|
character(len=*), | intent(in), | optional | :: | license |
License description. |
|
character(len=*), | intent(in), | optional | :: | authors |
Authors list. |
|
character(len=*), | intent(in), | optional | :: | examples(1:) |
Examples of correct usage. |
|
character(len=*), | intent(in), | optional | :: | epilog |
Epilog message. |
|
logical, | intent(in), | optional | :: | disable_hv |
Disable automatic insert of ‘help’ and ‘version’ CLAs. |
|
integer(kind=I4P), | intent(in), | optional | :: | usage_lun |
Unit number to print usage/help. |
|
integer(kind=I4P), | intent(in), | optional | :: | error_lun |
Unit number to print error info. |
|
integer(kind=I4P), | intent(in), | optional | :: | version_lun |
Unit number to print version/license info. |
|
character(len=*), | intent(in), | optional | :: | error_color |
ANSI color of error messages. |
|
character(len=*), | intent(in), | optional | :: | error_style |
ANSI style of error messages. |
|
logical, | intent(in), | optional | :: | ignore_unknown_clas |
Disable errors-raising for passed unknown CLAs. |
Add CLAs group CLI.
Add CLAs group to CLI.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | help |
Help message. |
|
character(len=*), | intent(in), | optional | :: | description |
Detailed description. |
|
character(len=*), | intent(in), | optional | :: | exclude |
Group name of the mutually exclusive group. |
|
character(len=*), | intent(in), | optional | :: | examples(1:) |
Examples of correct usage of the group. |
|
character(len=*), | intent(in) | :: | group |
Name of the grouped CLAs. |
Add CLA to CLI.
Add CLA to CLI.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of the grouped CLAs. |
|
integer(kind=I4P), | intent(in), | optional | :: | group_index |
Index of the grouped CLAs. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
character(len=*), | intent(in), | optional | :: | switch_ab |
Abbreviated switch name. |
|
character(len=*), | intent(in), | optional | :: | help |
Help message describing the CLA. |
|
character(len=*), | intent(in), | optional | :: | help_markdown |
Longer help message, markdown formatted. |
|
character(len=*), | intent(in), | optional | :: | help_color |
ANSI color of help messages. |
|
character(len=*), | intent(in), | optional | :: | help_style |
ANSI style of help messages. |
|
logical, | intent(in), | optional | :: | required |
Flag for set required argument. |
|
logical, | intent(in), | optional | :: | val_required |
Flag for set value required for optional argument. |
|
logical, | intent(in), | optional | :: | positional |
Flag for checking if CLA is a positional or a named CLA. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
logical, | intent(in), | optional | :: | hidden |
Flag for hiding CLA, thus it does not compare into help. |
|
character(len=*), | intent(in), | optional | :: | act |
CLA value action. |
|
character(len=*), | intent(in), | optional | :: | def |
Default value. |
|
character(len=*), | intent(in), | optional | :: | nargs |
Number of arguments consumed by CLA. |
|
character(len=*), | intent(in), | optional | :: | choices |
List of allowable values for the argument. |
|
character(len=*), | intent(in), | optional | :: | exclude |
Switch name of the mutually exclusive CLA. |
|
character(len=*), | intent(in), | optional | :: | envvar |
Environment variable from which take value. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Check if a CLA has been passed.
Check if a CLA has been passed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
Check if a CLA has been passed.
Check if a CLAs group has been defined.
Check if a CLAs group has been defined.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | group |
Name of group (command) of CLAs. |
||
integer(kind=I4P), | intent(out), | optional | :: | g |
Index of group. |
Check if a CLAs group has been defined.
Check if a CLA has been defined.
Check if a CLA has been defined.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | switch |
Switch name. |
||
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLAs. |
Check if a CLA has been defined.
Check if CLI has been parsed.
Check if CLI has been parsed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
Parsed status.
Set two CLAs group as mutually exclusive.
Set two CLAs group ad mutually exclusive.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | group1 |
Name of the first grouped CLAs. |
||
character(len=*), | intent(in) | :: | group2 |
Name of the second grouped CLAs. |
Check if a CLAs group has been run.
Check if a CLAs group has been run.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | group |
Name of group (command) of CLAs. |
Check if a CLAs group has been runned.
Parse Command Line Interfaces.
Parse Command Line Interfaces by means of a previously initialized CLAs groups list.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA value(s) from CLAs list parsed.
Get CLA (single) value from CLAs list parsed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
class(*), | intent(inout) | :: | val |
CLA value. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
class(*), | intent(inout) | :: | val(1:) |
CLA values. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA value(s) from CLAs list parsed, varying size list.
Get CLA multiple values from CLAs list parsed with varying size list, real(R8P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
real(kind=R8P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed with varying size list, real(R4P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
real(kind=R4P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed with varying size list, integer(I8P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I8P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed with varying size list, integer(I4P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I4P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed with varying size list, integer(I2P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I2P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed with varying size list, integer(I1P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I1P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed with varying size list, logical.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
logical, | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed with varying size list, character.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLI usage.
Print correct usage of CLI.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
integer(kind=I4P), | intent(in) | :: | g |
Group index. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
logical, | intent(in), | optional | :: | no_header |
Avoid insert header to usage. |
|
logical, | intent(in), | optional | :: | no_examples |
Avoid insert examples to usage. |
|
logical, | intent(in), | optional | :: | no_epilog |
Avoid insert epilogue to usage. |
|
logical, | intent(in), | optional | :: | markdown |
Format things with markdown |
Usage string.
Get CLI signature.
Get signature.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
logical, | intent(in), | optional | :: | bash_completion |
Return the signature for bash completion. |
Signature.
Print correct usage of CLI.
Print correct usage.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
Save bash completion script (for named CLAs only).
Save bash completion script (for named CLAs only).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | bash_file |
Output file name of bash completion script. |
||
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Save CLI usage as man page.
Save CLI usage as man page.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | man_file |
Output file name for saving man page. |
||
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Save CLI usage as markdown.
Save CLI usage as markdown.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(in) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | markdown_file |
Output file name for saving man page. |
||
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Trig error occurence and print meaningful message.
Trig error occurrence and print meaningful message.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
Object data. |
||
integer(kind=I4P), | intent(in) | :: | error |
Error occurred. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | group |
Group name. |
|
character(len=*), | intent(in), | optional | :: | switch |
CLA switch name. |
Check data consistency.
Check data consistency.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Check if two mutually exclusive CLAs group have been called.
Check if two mutually exclusive CLAs group have been called.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
Get CLAs groups indexes.
Get the argument indexes of CLAs groups defined parsing the actual passed CLAs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I4P), | intent(out), | allocatable | :: | ai(:,:) |
CLAs grouped indexes. |
Get CLAs.
Get CLAs from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | args |
String containing command line arguments. |
||
integer(kind=I4P), | intent(out), | allocatable | :: | ai(:,:) |
CLAs grouped indexes. |
Get CLAs from CLI invocation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I4P), | intent(out), | allocatable | :: | ai(:,:) |
CLAs grouped indexes. |
Get CLAs from string.
Get CLAs from string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(in) | :: | args |
String containing command line arguments. |
||
integer(kind=I4P), | intent(out), | allocatable | :: | ai(:,:) |
CLAs grouped indexes. |
Get CLAs from CLI invocation.
Get CLAs from CLI invocation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I4P), | intent(out), | allocatable | :: | ai(:,:) |
CLAs grouped indexes. |
Get CLA (single) value from CLAs list parsed.
Get CLA (single) value from CLAs list parsed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
class(*), | intent(inout) | :: | val |
CLA value. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed.
Get CLA multiple values from CLAs list parsed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
class(*), | intent(inout) | :: | val(1:) |
CLA values. |
||
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, R16P.
Get CLA multiple values from CLAs list parsed with varying size list, real(R16P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
real(kind=R16P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, R8P.
Get CLA multiple values from CLAs list parsed with varying size list, real(R8P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
real(kind=R8P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, R4P.
Get CLA multiple values from CLAs list parsed with varying size list, real(R4P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
real(kind=R4P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, I8P.
Get CLA multiple values from CLAs list parsed with varying size list, integer(I8P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I8P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, I4P.
Get CLA multiple values from CLAs list parsed with varying size list, integer(I4P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I4P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, I2P.
Get CLA multiple values from CLAs list parsed with varying size list, integer(I2P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I2P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, I1P.
Get CLA multiple values from CLAs list parsed with varying size list, integer(I1P).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
integer(kind=I1P), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, bool.
Get CLA multiple values from CLAs list parsed with varying size list, logical.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
logical, | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
Get CLA multiple values from CLAs list parsed, varying size, char.
Get CLA multiple values from CLAs list parsed with varying size list, character.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | self |
CLI data. |
||
character(len=*), | intent(out), | allocatable | :: | val(:) |
CLA values. |
|
character(len=*), | intent(in), | optional | :: | pref |
Prefixing string. |
|
character(len=*), | intent(in), | optional | :: | args |
String containing command line arguments. |
|
character(len=*), | intent(in), | optional | :: | group |
Name of group (command) of CLA. |
|
character(len=*), | intent(in), | optional | :: | switch |
Switch name. |
|
integer(kind=I4P), | intent(in), | optional | :: | position |
Position of positional CLA. |
|
integer(kind=I4P), | intent(out), | optional | :: | error |
Error trapping flag. |
CLI assignment overloading.
Assignment operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | lhs |
Left hand side. |
||
type(command_line_interface), | intent(in) | :: | rhs |
Right hand side. |
CLI assignment overloading.
Assignment operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(command_line_interface), | intent(inout) | :: | lhs |
Left hand side. |
||
type(command_line_interface), | intent(in) | :: | rhs |
Right hand side. |
type, extends(object), public :: command_line_interface !< Command Line Interface (CLI) class. private type(command_line_arguments_group), allocatable :: clasg(:) !< CLA list [1:Na]. #ifdef __GFORTRAN__ character(512 ), allocatable :: args(:) !< Actually passed command line arguments. #else character(len=:), allocatable :: args(:) !< Actually passed command line arguments. #endif logical :: disable_hv=.false. !< Disable automatic 'help' and 'version' CLAs. logical :: is_parsed_=.false. !< Parse status. logical :: ignore_unknown_clas=.false. !< Disable errors-raising for passed unknown CLAs. integer(I4P) :: error_unknown_clas=0_I4P !< Error trapping flag for unknown CLAs. contains ! public methods procedure, public :: free !< Free dynamic memory. procedure, public :: init !< Initialize CLI. procedure, public :: add_group !< Add CLAs group CLI. procedure, public :: add !< Add CLA to CLI. procedure, public :: is_passed !< Check if a CLA has been passed. procedure, public :: is_defined_group !< Check if a CLAs group has been defined. procedure, public :: is_defined !< Check if a CLA has been defined. procedure, public :: is_parsed !< Check if CLI has been parsed. procedure, public :: set_mutually_exclusive_groups !< Set two CLAs group as mutually exclusive. procedure, public :: run_command => is_called_group !< Check if a CLAs group has been run. procedure, public :: parse !< Parse Command Line Interfaces. generic, public :: get => & get_cla, & get_cla_list !< Get CLA value(s) from CLAs list parsed. generic, public :: get_varying => & #if defined _R16P get_cla_list_varying_R16P, & #endif get_cla_list_varying_R8P, & get_cla_list_varying_R4P, & get_cla_list_varying_I8P, & get_cla_list_varying_I4P, & get_cla_list_varying_I2P, & get_cla_list_varying_I1P, & get_cla_list_varying_logical, & get_cla_list_varying_char !< Get CLA value(s) from CLAs list parsed, varying size list. procedure, public :: usage !< Get CLI usage. procedure, public :: signature !< Get CLI signature. procedure, public :: print_usage !< Print correct usage of CLI. procedure, public :: save_bash_completion !< Save bash completion script (for named CLAs only). procedure, public :: save_man_page !< Save CLI usage as man page. procedure, public :: save_usage_to_markdown !< Save CLI usage as markdown. ! private methods procedure, private :: errored !< Trig error occurence and print meaningful message. procedure, private :: check !< Check data consistency. procedure, private :: check_m_exclusive !< Check if two mutually exclusive CLAs group have been called. procedure, private :: get_clasg_indexes !< Get CLAs groups indexes. generic, private :: get_args => & get_args_from_string, & get_args_from_invocation !< Get CLAs. procedure, private :: get_args_from_string !< Get CLAs from string. procedure, private :: get_args_from_invocation !< Get CLAs from CLI invocation. procedure, private :: get_cla !< Get CLA (single) value from CLAs list parsed. procedure, private :: get_cla_list !< Get CLA multiple values from CLAs list parsed. procedure, private :: get_cla_list_varying_R16P !< Get CLA multiple values from CLAs list parsed, varying size, R16P. procedure, private :: get_cla_list_varying_R8P !< Get CLA multiple values from CLAs list parsed, varying size, R8P. procedure, private :: get_cla_list_varying_R4P !< Get CLA multiple values from CLAs list parsed, varying size, R4P. procedure, private :: get_cla_list_varying_I8P !< Get CLA multiple values from CLAs list parsed, varying size, I8P. procedure, private :: get_cla_list_varying_I4P !< Get CLA multiple values from CLAs list parsed, varying size, I4P. procedure, private :: get_cla_list_varying_I2P !< Get CLA multiple values from CLAs list parsed, varying size, I2P. procedure, private :: get_cla_list_varying_I1P !< Get CLA multiple values from CLAs list parsed, varying size, I1P. procedure, private :: get_cla_list_varying_logical !< Get CLA multiple values from CLAs list parsed, varying size, bool. procedure, private :: get_cla_list_varying_char !< Get CLA multiple values from CLAs list parsed, varying size, char. procedure, private :: cli_assign_cli !< CLI assignment overloading. generic, private :: assignment(=) => cli_assign_cli !< CLI assignment overloading. final :: finalize !< Free dynamic memory when finalizing. endtype command_line_interface