Manual Reference Pages  - command_argument_count (3fortran)

NAME

COMMAND_ARGUMENT_COUNT(3) - [SYSTEM:COMMAND LINE] Get number of command line arguments

SYNOPSIS

result = command_argument_count()

         integer function command_argument_count()

CHARACTERISTICS

o the result is of default integer scalar.

DESCRIPTION

COMMAND_ARGUMENT_COUNT(3) returns the number of arguments passed on the command line when the containing program was invoked.

OPTIONS

None

RESULT

: The return value is of type default integer. It is the number of arguments passed on the command line when the program was invoked.

If there are no command arguments available or if the processor does not support command arguments, then the result has the value zero.

If the processor has a concept of a command name, the command name does not count as one of the command arguments.

EXAMPLES

Sample program:

    program demo_command_argument_count
    implicit none
    integer :: count
       count = command_argument_count()
       print *, count
    end program demo_command_argument_count

Sample output:

       # the command verb does not count
       ./test_command_argument_count
           0
       # quoted strings may count as one argument
       ./test_command_argument_count count arguments
           2
       ./test_command_argument_count ’count arguments’
           1

STANDARD

Fortran 2003

SEE ALSO

GET_COMMAND(3), GET_COMMAND_ARGUMENT(3)

fortran-lang intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 command_argument_count (3fortran) April 28, 2024
Generated by manServer 1.08 from 43e0f03d-3ad8-4970-bcad-4e80e72cce87 using man macros.