Next: Startup Files, Up: Invoking Octave from the Command Line [Contents][Index]
Here is a complete list of the command line options that Octave accepts.
--built-in-docstrings-file filenameSpecify the name of the file containing documentation strings for the built-in functions of Octave. This value is normally correct and should only need to specified in extraordinary situations.
--debug-dEnter parser debugging mode. Using this option will cause Octave’s parser to print a lot of information about the commands it reads, and is probably only useful if you are actually trying to debug the parser.
--debug-jitEnable JIT compiler debugging and tracing.
--doc-cache-file filenameSpecify the name of the doc cache file to use. The value of filename
specified on the command line will override any value of
OCTAVE_DOC_CACHE_FILE found in the environment, but not any commands
in the system or user startup files that use the doc_cache_file
function.
--echo-commands-xEcho commands as they are executed.
--eval codeEvaluate code and exit when finished unless --persist is also specified.
--exec-path pathSpecify the path to search for programs to run. The value of path
specified on the command line will override any value of
OCTAVE_EXEC_PATH found in the environment, but not any commands
in the system or user startup files that set the built-in variable
EXEC_PATH.
--force-guiForce the graphical user interface (GUI) to start.
--help-h-?Print short help message and exit.
--image-path pathAdd path to the head of the search path for images. The value of
path specified on the command line will override any value of
OCTAVE_IMAGE_PATH found in the environment, but not any commands
in the system or user startup files that set the built-in variable
IMAGE_PATH.
--info-file filenameSpecify the name of the info file to use. The value of filename
specified on the command line will override any value of
OCTAVE_INFO_FILE found in the environment, but not any commands
in the system or user startup files that use the info_file
function.
--info-program programSpecify the name of the info program to use. The value of program
specified on the command line will override any value of
OCTAVE_INFO_PROGRAM found in the environment, but not any
commands in the system or user startup files that use the
info_program function.
--interactive-iForce interactive behavior. This can be useful for running Octave via a remote shell command or inside an Emacs shell buffer. For another way to run Octave within Emacs, see Emacs Octave Support.
--jit-compilerEnable the JIT compiler used for accelerating loops.
--line-editingForce readline use for command-line editing.
--no-guiDisable the graphical user interface (GUI) and use the command line interface (CLI) instead.
--no-history-HDisable recording of command-line history.
--no-init-fileDon’t read the initialization files ~/.octaverc and .octaverc.
--no-init-pathDon’t initialize the search path for function files to include default locations.
--no-line-editingDisable command-line editing.
--no-site-fileDon’t read the site-wide octaverc initialization files.
--no-window-system-WDisable use of a windowing system including graphics. This forces a strictly terminal-only environment.
--norc-fDon’t read any of the system or user initialization files at startup. This is equivalent to using both of the options --no-init-file and --no-site-file.
--path path-p pathAdd path to the head of the search path for function files. The
value of path specified on the command line will override any value
of OCTAVE_PATH found in the environment, but not any commands in the
system or user startup files that set the internal load path through one
of the path functions.
--persistGo to interactive mode after --eval or reading from a file named on the command line.
--silent--quiet-qDon’t print the usual greeting and version message at startup.
--texi-macros-file filenameSpecify the name of the file containing Texinfo macros for use by makeinfo.
--traditional--braindeadFor compatibility with MATLAB, set initial values for user preferences to the following values
PS1 = ">> " PS2 = "" allow_noninteger_range_as_index = true beep_on_error = true confirm_recursive_rmdir = false crash_dumps_octave_core = false save_default_options = "-mat-binary" do_braindead_shortcircuit_evaluation = true fixed_point_format = true history_timestamp_format_string = "%%-- %D %I:%M %p --%%" page_screen_output = false print_empty_dimensions = false
and disable the following warnings
Octave:abbreviated-property-match Octave:fopen-file-in-path Octave:function-name-clash Octave:load-file-in-path
Note that this does not enable the Octave:matlab-incompatible
warning, which you might want if you want to be told about writing code
that works in Octave but not MATLAB (see warning,
warning_ids).
--verbose-VTurn on verbose output.
--version-vPrint the program version number and exit.
fileExecute commands from file. Exit when done unless --persist is also specified.
Octave also includes several functions which return information about the command line, including the number of arguments and all of the options.
Return the command line arguments passed to Octave. For example, if you invoked Octave using the command
octave --no-line-editing --silent
argv would return a cell array of strings with the elements
--no-line-editing and --silent.
If you write an executable Octave script, argv will return the
list of arguments passed to the script. See Executable Octave Programs,
for an example of how to create an executable Octave script.
Return the last component of the value returned by
program_invocation_name.
See also: program_invocation_name.
Return the name that was typed at the shell prompt to run Octave.
If executing a script from the command line (e.g., octave foo.m)
or using an executable Octave script, the program name is set to the
name of the script. See Executable Octave Programs, for an example of
how to create an executable Octave script.
See also: program_name.
Here is an example of using these functions to reproduce the command line which invoked Octave.
printf ("%s", program_name ());
arg_list = argv ();
for i = 1:nargin
printf (" %s", arg_list{i});
endfor
printf ("\n");
See Indexing Cell Arrays, for an explanation of how to retrieve objects
from cell arrays, and Defining Functions, for information about the
variable nargin.
Next: Startup Files, Up: Invoking Octave from the Command Line [Contents][Index]