Mwnci args() Function

Syntax

args()

Parameters

None

Description

The args() function returns an array containing the calling application command line arguments.

args() is called when mwnci is executed and stores the results in variables ARGV and ARGC

  • ARGC is the number of arguments on the command line (including the program name itself)
  • ARGV is an array of C-style strings (character arrays) ARGV[0] is the name of the program being executed.

Example

#!/usr/bin/env mwnci
println("args()=", args())
println("ARGV=", ARGV)
println("ARGC=", ARGC)


./args.mwnci
args()=[./args.mwnci]
ARGV=[./args.mwnci]
ARGC=1


./args.mwnci arg1 arg2 three
args()=[./args.mwnci, arg1, arg2, three]
ARGV=[./args.mwnci, arg1, arg2, three]
ARGC=4