args


args, a Fortran90 code which demonstrates command line argument retrieval.

In particular, the code is a demonstration of the IARGC and GETARG routines, commonly available on UNIX systems.

These routines allow a Fortran program to count and retrieve the command line arguments with which it was invoked. Thus, if an executable program is called fu and we invoke it with the command

fu man chu
then IARGC will return the value 2, and GETARG, with an input of 0, 1 or 2, will return the values fu, man or chu.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

args is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

args_test

gfortran_intrinsics_test, a Fortran90 code which demonstrates the use of intrinsic programs provided by the GFortran compiler, which include versions of IARGC and GETARG.

Source code:


Last revised on 26 August 2021.