Intel® Quartus® Prime Pro Edition User Guide: Scripting

ID 683432
Date 3/28/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.6.7. Accessing Command-Line Arguments

The global variable quartus(args) is a list of the arguments typed on the command-line following the name of the Tcl script.

Simple Command-Line Argument Access

The following Tcl example prints all the arguments in the quartus(args) variable:

set i 0
foreach arg $quartus(args) {
	puts "The value at index $i is $arg"
	incr i
}

 Passing Command-Line Arguments to Scripts

If you copy the script in the previous example to a file named print_args.tcl, it displays the following output when you type the following at a command prompt.

quartus_sh -t print_args.tcl my_project 100MHz
The value at index 0 is my_project
The value at index 1 is 100MHz