Retrieve the entire command line that was used to invoke the program.
Fortran 2003 and later
Subroutine
call get_command([command, length, status])
command
- (Optional) shall be of type character
and of default kind.length
- (Optional) Shall be of type integer
and of default kind.status
- (Optional) Shall be of type integer
and of default kind.If command
is present, stores the entire command line that was used to invoke the program in command
. If length
is present, it is assigned the length of the command line. If status
is present, it is assigned 0 upon success of the command, -1 if command
is too short to store the command line, or a positive value in case of an error.
program test_get_command
character(len=255) :: cmd
call get_command(cmd)
write (*,*) trim(cmd)
end program
get_command_argument, command_argument_count