Intel® Quartus® Prime Standard Edition User Guide: Scripting

ID 683325
Date 9/24/2018
Document Table of Contents

2.10.5. 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