Command Line Options

The following options may be included on the Source Insight command line.

Suppressing New Program Instances

-i <rest of command line>

This option will direct the rest of the command line to an already running instance of Source Insight, if any. If there are no instances already running, then a new instance is started.

Example:

sourceinsight4 –i myfile.cpp

This will locate an already running instance of Source Insight, and tell it to open myfile.cpp.

Always Starting a New Program Instance

-ni <rest of command line>

This option will start a new instance of Source Insight, even if one is already running.

Example:

sourceinsight4 -ni myfile.cpp

Normally, if you invoke Source Insight with one or more file name on the command line, and another instance of Source Insight is already running, then the files will open in the existing instance of Source Insight. A new Source Insight instance is not launched. This option forces a new instance to launch.

Running a Source Insight Command

-c <command-name>

This option will start Source Insight, and run the specified command. The command can be a built-in com­mand, or a defined custom command, or a macro command.

To invoke a macro command, use the name of the macro function, but do not include parentheses. There is no way to pass parameters to a macro function from the command line. For example:

sourceinsight4 -c MyMacroFunction

Specifying a Project to Open

-p <project-name>

This option closes the current project, if any, and opens the project given in project-name. If the project does not exist, Source Insight will give an error message.

Example:

sourceinsight4 -p myproj

Closing the Current Project

-pc

This option closes the current project if one is open. No other project is opened.

Example:

sourceinsight4 -pc

Using a Temporary Project

-pt <projectname>

This option closes the current project, if any, and opens the project given in projectname. Unlike the -p option, the next time you run Source Insight, the old current project is opened. This is useful if you want to put a Source Insight command in a batch file, but don't want the current project to be changed.

Example:

sourceinsight4 -pt mail

Finding a Symbol

-f <symbol_name>

This option locates the symbol given in symbol_name, opens that file, and positions the insertion point on the symbol.   If the symbol can't be found, Source Insight will give an error message. This is unlike specifying a symbol in place of a file name because this explicitly tells Source Insight that you are looking for a parsed symbol, not a file.

Example:

sourceinsight4 -f DoIdle

Synchronizing Project Files

-u

This option updates all project files right away when Source Insight starts. It is exactly like using the Synchro­nize Files command on the Project menu.

Example:

sourceinsight4 -u

Synchronizing Files in Batch Mode

-ub

This option is like -u except that Source Insight quits after the files are updated. This is useful for putting a command in a batch file to synchronize Source Insight projects.

Example:

sourceinsight4 –ub

Suppressing the Splash Screen

-s

This option turns off the Source Insight splash screen that normally appears when starting up.

Comparing Files

-d <file1> <file2>

This option open the File Compare window and compares the two given files. See: File Compare.

Resetting All Settings

-reset

This option tells Source Insight to reset all optional settings: the configuration, the layout, and any session information. You will be prompted and asked which things you want to reset.

Resetting Configuration Options to Defaults

-reset-config

This option tells Source Insight to reset all optional settings in the configuration. This includes things like the color settings, styles, key bindings, and all options set on the Options menu.

Resetting the Display Layout

-reset-layout

This option tells Source Insight to reset the window layout to defaults.