Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

argv

argv( 
[ x_int ] 
) 
=> g_result

Description

Returns the arguments passed to a SKILL script. Used to enhance the SKILL script environment. This function works only for scripting with SKILL standalone executable (skill).

Arguments

x_int

It must be a positive integer.

Value Returned

g_result

The return value depends on the arguments passed.

  • argv( ) - List of all arguments (list of strings or nil).
  • argv(0) - Name of the calling script.
  • argv(n) - nth argument as a string or nil if there is no nth argument.

Examples

Assume that arguments passed to a SKILL script file are (“my.il” “1st” “2nd” “3rd”):

argv()  
=> (“1st” “2nd” “3rd”)
argv(0)
=> “my.il”
argv(1)
=> “1st”
argv(4)
=> nil

An example using a SKILL executable:

$ skill -V
@(#)$CDS: skill version 07.02 09/19/2007 09:08 (cat61lnx) $
$ cat /tmp/foo.il
(printf "argc is %d, argv[0] is %s, argv is %L\n" (argc) (argv 0) (argv))
$ skill /tmp/foo.il -someArg -someArg2
argc is 2, argv[0] is /tmp/foo.il, argv is ("-someArg" "-someArg2")

Related Topics

Function and Program Structure


Return to top
 ⠀
X