help_usage Subroutine

subroutine help_usage(l_help)

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: l_help

Variables

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: help_text(:)
integer, public :: i
character(len=*), public, parameter :: ident = "@(#)help_usage(3f): prints help information"
logical, public :: stopit = .false.

Source Code

subroutine help_usage(l_help)
implicit none
character(len=*),parameter     :: ident="@(#)help_usage(3f): prints help information"
logical,intent(in)             :: l_help
character(len=:),allocatable :: help_text(:)
integer                        :: i
logical                        :: stopit=.false.
stopit=.false.
if(l_help)then
help_text=[ CHARACTER(LEN=128) :: &
'NAME                                                                            ',&
'   xauth_key(1f) - [M_random] generate magic cookies for xauth                  ',&
'   (LICENSE:PD)                                                                 ',&
'SYNOPSIS                                                                        ',&
'   xauth_key [characters] [ -n number_of_characters]                            ',&
'DESCRIPTION                                                                     ',&
'   xauth_key generates a random hexadecimal number                              ',&
'OPTIONS                                                                         ',&
'   characters  Set of letters to compose string from.                           ',&
'               Defaults to ''0123456789abcdef''.                                ',&
'   -n N        Number of digits. Defaults to 128                                ',&
'   -r N        Number of cookies to generate                                    ',&
'   --version   Display version information and exit.                            ',&
'   --help      Display help text and exit.                                      ',&
'EXAMPLE                                                                         ',&
'   generate a value for use with the X authority system:                        ',&
'                                                                                ',&
'    xauth add :0 . `xauth_key`                                                  ',&
'SEE ALSO                                                                        ',&
'   X(1), xauth(1)                                                               ',&
'AUTHOR                                                                          ',&
'   John S. Urban                                                                ',&
'LICENSE                                                                         ',&
'   Public Domain                                                                ',&
'']
   WRITE(*,'(a)')(trim(help_text(i)),i=1,size(help_text))
   stop ! if --help was specified, stop
endif
end subroutine help_usage