+------------------------Fortran 2003 Draft Standard-------------------------+
Purpose
Returns the number of command line arguments for the command that invoked the program.
Class
Inquiry function
Result Type and Attributes
Default integer scalar
Result Value
The result value is the number of command arguments, not counting the command name. If there are no command arguments, the result value is 0.
Examples
integer cmd_count cmd_count = COMMAND_ARGUMENT_COUNT() print*, cmd_count end
The following is sample output generated by the above program:
$ a.out 0 $ a.out aa 1 $ a.out aa bb 2
+---------------------End of Fortran 2003 Draft Standard---------------------+