trick/docs/documentation/simulation_capabilities/Command-Line-Arguments.md
Jacqueline Deans 279d131a0a
Add Horizonal Navigation bars (breadcrumbs) to all documentation pages (#1328)
* Add breadcrumbs to all documentation pages, fix some links between pages
2022-08-05 17:05:10 -05:00

1.7 KiB

HomeDocumentation HomeSimulation Capabilities → Command Line Arguments

The Trick::CommandLineArguments class stores the command line arguments specified by the user when starting the simulation. The class provides routines to access the arguments.

Accessing the Command Line Arguments

The command line arguments are available to user classes through the following two calls.

int command_line_args_get_argc() ;
char ** command_line_args_get_argv() ;

Specific directories and file names may be accessed by the following calls.

const char * command_line_args_get_output_dir() ;
const char * command_line_args_get_input_file() ;
const char * command_line_args_get_default_dir() ;
const char * command_line_args_get_cmdline_name() ;

Modifying the Output Directory

By default the RUN directory of the input file is the output directory. To change this specify the -O or the -OO command line arguments.

S_main_${TRICK_HOST_CPU}.exe RUN_dir/input.py -O <output_dir>

All Trick core output files will be written to the specified <output_dir>.

TimeStamping the Output Directory

The user may also specify a time stamped output directory in the input file.

trick.output_dir_timestamped_on()

This will create a dated subdirectory in the current output directory. All of the Trick core output files will be written to the output directory. This option may be used in conjunction with the -O or the -OO command line arguments.

Continue to Environment