comparison doc/interpreter/basics.txi @ 9132:eb1747dbd360

Update help strings for command line options Add documentation for --no-init-path option Add documentation for environment variables OCTAVE_SITE_INITFILE, OCTAVE_VERSION_INITFILE
author Rik <rdrider0-list@yahoo.com>
date Fri, 17 Apr 2009 14:53:17 -0700
parents 1bf0ce0930be
children c0cef1436788
comparison
equal deleted inserted replaced
9131:6340043000c0 9132:eb1747dbd360
61 @subsection Command Line Options 61 @subsection Command Line Options
62 @cindex Octave command options 62 @cindex Octave command options
63 @cindex command options 63 @cindex command options
64 @cindex options, Octave command 64 @cindex options, Octave command
65 65
66 Here is a complete list of all the command line options that Octave 66 Here is a complete list of the command line options that Octave
67 accepts. 67 accepts.
68 68
69 69
70 @table @code 70 @table @code
71 @item --debug 71 @item --debug
72 @itemx -d 72 @itemx -d
73 @cindex @code{--debug} 73 @cindex @code{--debug}
74 @cindex @code{-d} 74 @cindex @code{-d}
75 Enter parser debugging mode. Using this option will cause Octave's 75 Enter parser debugging mode. Using this option will cause Octave's
76 parser to print a lot of information about the commands it reads, and is 76 parser to print a lot of information about the commands it reads, and is
77 probably only useful if you are actually trying to debug the parser. 77 probably only useful if you are actually trying to debug the parser.
78 78
79 @item --doc-cache-file 79 @item --doc-cache-file @var{filename}
80 @cindex @code{--doc-cache-file} @var{filename} 80 @cindex @code{--doc-cache-file @var{filename}}
81 Specify the name of the doc cache file to use. The value of @var{filename} 81 Specify the name of the doc cache file to use. The value of @var{filename}
82 specified on the command line will override any value of 82 specified on the command line will override any value of
83 @code{OCTAVE_DOC_CACHE_FILE} found in the environment, but not any commands 83 @code{OCTAVE_DOC_CACHE_FILE} found in the environment, but not any commands
84 in the system or user startup files that use the @code{doc_file_cache} 84 in the system or user startup files that use the @code{doc_cache_file}
85 function. 85 function.
86 86
87 @item --echo-commands 87 @item --echo-commands
88 @itemx -x 88 @itemx -x
89 @cindex @code{--echo-commands} 89 @cindex @code{--echo-commands}
90 @cindex @code{-x} 90 @cindex @code{-x}
91 Echo commands as they are executed. 91 Echo commands as they are executed.
92 92
93 @item --eval @var{code} 93 @item --eval @var{code}
94 Evaluate @var{code} and exit when done unless @code{--persist} is also 94 Evaluate @var{code} and exit when finished unless @code{--persist} is also
95 specified. 95 specified.
96 96
97 @item --exec-path @var{path} 97 @item --exec-path @var{path}
98 @cindex @code{--exec-path @var{path}} 98 @cindex @code{--exec-path @var{path}}
99 Specify the path to search for programs to run. The value of @var{path} 99 Specify the path to search for programs to run. The value of @var{path}
100 specified on the command line will override any value of 100 specified on the command line will override any value of
101 @code{OCTAVE_EXEC_PATH} found in the environment, but not any commands 101 @code{OCTAVE_EXEC_PATH} found in the environment, but not any commands
102 in the system or user startup files that set the built-in variable 102 in the system or user startup files that set the built-in variable
103 @code{EXEC_PATH}. 103 @code{EXEC_PATH}.
104 104
105 @item --help 105 @item --help
106 @itemx -h 106 @itemx -h
107 @itemx -? 107 @itemx -?
108 @cindex @code{--help} 108 @cindex @code{--help}
109 @cindex @code{-h} 109 @cindex @code{-h}
110 @cindex @code{-?} 110 @cindex @code{-?}
111 Print short help message and exit. 111 Print short help message and exit.
112 112
113 @item --image-path @var{path} 113 @item --image-path @var{path}
114 @cindex @code{--image-path @var{path}} 114 @cindex @code{--image-path @var{path}}
115 Specify the path to search for images. The value of @var{path} 115 Add path to the head of the search path for images. The value of
116 specified on the command line will set the value of 116 @var{path} specified on the command line will override any value of
117 @code{IMAGE_PATH} found in the environment. 117 @code{OCTAVE_IMAGE_PATH} found in the environment, but not any commands
118 in the system or user startup files that set the built-in variable
119 @code{IMAGE_PATH}.
118 120
119 @item --info-file @var{filename} 121 @item --info-file @var{filename}
120 @cindex @code{--info-file @var{filename}} 122 @cindex @code{--info-file @var{filename}}
121 Specify the name of the info file to use. The value of @var{filename} 123 Specify the name of the info file to use. The value of @var{filename}
122 specified on the command line will override any value of 124 specified on the command line will override any value of
130 specified on the command line will override any value of 132 specified on the command line will override any value of
131 @code{OCTAVE_INFO_PROGRAM} found in the environment, but not any 133 @code{OCTAVE_INFO_PROGRAM} found in the environment, but not any
132 commands in the system or user startup files that use the 134 commands in the system or user startup files that use the
133 @code{info_program} function. 135 @code{info_program} function.
134 136
135 @item --interactive 137 @item --interactive
136 @itemx -i 138 @itemx -i
137 @cindex @code{--interactive} 139 @cindex @code{--interactive}
138 @cindex @code{-i} 140 @cindex @code{-i}
139 Force interactive behavior. This can be useful for running Octave via a 141 Force interactive behavior. This can be useful for running Octave via a
140 remote shell command or inside an Emacs shell buffer. For another way 142 remote shell command or inside an Emacs shell buffer. For another way
141 to run Octave within Emacs, see @ref{Emacs Octave Support}. 143 to run Octave within Emacs, see @ref{Emacs Octave Support}.
142 144
143 @item --no-history 145 @item --line-editing
146 @cindex @code{--line-editing}
147 Force readline use for command-line editing.
148
149 @item --no-history
144 @itemx -H 150 @itemx -H
145 Disable command-line history. 151 @cindex @code{--no-history}
152 @cindex @code{-H}
153 Disable recording of command-line history.
146 154
147 @item --no-init-file 155 @item --no-init-file
148 @cindex @code{--no-init-file} 156 @cindex @code{--no-init-file}
149 Don't read the @file{~/.octaverc} or @file{.octaverc} files. 157 Don't read the initialization files @file{~/.octaverc} and @file{.octaverc}.
158
159 @item --no-init-path
160 @cindex @code{--no-init-path}
161 Don't initialize the search path for function files to include default
162 locations.
150 163
151 @item --no-line-editing 164 @item --no-line-editing
152 @cindex @code{--no-line-editing} 165 @cindex @code{--no-line-editing}
153 Disable command-line editing. 166 Disable command-line editing.
154 167
155 @item --no-site-file 168 @item --no-site-file
156 @cindex @code{--no-site-file} 169 @cindex @code{--no-site-file}
157 Don't read the site-wide @file{octaverc} file. 170 Don't read the site-wide @file{octaverc} initialization files.
158 171
159 @item --norc 172 @item --norc
160 @itemx -f 173 @itemx -f
161 @cindex @code{--norc} 174 @cindex @code{--norc}
162 @cindex @code{-f} 175 @cindex @code{-f}
163 Don't read any of the system or user initialization files at startup. 176 Don't read any of the system or user initialization files at startup.
164 This is equivalent to using both of the options @code{--no-init-file} 177 This is equivalent to using both of the options @code{--no-init-file}
165 and @code{--no-site-file}. 178 and @code{--no-site-file}.
166 179
167 @item --path @var{path} 180 @item --path @var{path}
168 @itemx -p @var{path} 181 @itemx -p @var{path}
169 @cindex @code{--path @var{path}} 182 @cindex @code{--path @var{path}}
170 @cindex @code{-p @var{path}} 183 @cindex @code{-p @var{path}}
171 Specify the path to search for function files. The value of @var{path} 184 Add path to the head of the search path for function files. The
172 specified on the command line will override any value of 185 value of @var{path} specified on the command line will override any value
173 @code{OCTAVE_PATH} found in the environment, but not any commands in the 186 of @code{OCTAVE_PATH} found in the environment, but not any commands in the
174 system or user startup files that set the internal load path through one 187 system or user startup files that set the internal load path through one
175 of the path functions. 188 of the path functions.
176 189
177 @item --persist 190 @item --persist
191 @cindex @code{--persist}
178 Go to interactive mode after @code{--eval} or reading from a file 192 Go to interactive mode after @code{--eval} or reading from a file
179 named on the command line. 193 named on the command line.
180 194
181 @item --silent 195 @item --silent
182 @itemx --quiet 196 @itemx --quiet
183 @itemx -q 197 @itemx -q
184 @cindex @code{--silent} 198 @cindex @code{--silent}
185 @cindex @code{--quiet} 199 @cindex @code{--quiet}
186 @cindex @code{-q} 200 @cindex @code{-q}
187 Don't print the usual greeting and version message at startup. 201 Don't print the usual greeting and version message at startup.
188 202
189 @item --traditional 203 @item --traditional
190 @itemx --braindead 204 @itemx --braindead
191 @cindex @code{--traditional} 205 @cindex @code{--traditional}
192 @cindex @code{--braindead} 206 @cindex @code{--braindead}
193 For compatibility with @sc{matlab}, set initial values for 207 For compatibility with @sc{matlab}, set initial values for
194 user preferences to the following values 208 user preferences to the following values
196 @example 210 @example
197 @group 211 @group
198 PS1 = ">> " 212 PS1 = ">> "
199 PS2 = "" 213 PS2 = ""
200 beep_on_error = true 214 beep_on_error = true
215 confirm_recursive_rmdir = false
201 crash_dumps_octave_core = false 216 crash_dumps_octave_core = false
202 default_save_options = "-mat-binary" 217 default_save_options = "-mat-binary"
203 fixed_point_format = true 218 fixed_point_format = true
204 history_timestamp_format_string 219 history_timestamp_format_string
205 = "%%-- %D %I:%M %p --%%" 220 = "%%-- %D %I:%M %p --%%"
216 Octave:function-name-clash 231 Octave:function-name-clash
217 Octave:load-file-in-path 232 Octave:load-file-in-path
218 @end group 233 @end group
219 @end example 234 @end example
220 235
221 @item --verbose 236 @item --verbose
222 @itemx -V 237 @itemx -V
223 @cindex @code{--verbose} 238 @cindex @code{--verbose}
224 @cindex @code{-V} 239 @cindex @code{-V}
225 Turn on verbose output. 240 Turn on verbose output.
226 241
227 @item --version 242 @item --version
228 @itemx -v 243 @itemx -v
229 @cindex @code{--version} 244 @cindex @code{--version}
230 @cindex @code{-v} 245 @cindex @code{-v}
231 Print the program version number and exit. 246 Print the program version number and exit.
232 247
233 @item @var{file} 248 @item @var{file}
234 Execute commands from @var{file}. Exit when done unless 249 Execute commands from @var{file}. Exit when done unless
235 @code{--persist} is also specified. 250 @code{--persist} is also specified.
236 @end table 251 @end table
237 252
238 Octave also includes several built-in variables that contain information 253 Octave also includes several functions which return information
239 about the command line, including the number of arguments and all of the 254 about the command line, including the number of arguments and all of the
240 options. 255 options.
241 256
242 @DOCSTRING(argv) 257 @DOCSTRING(argv)
243 258
244 @DOCSTRING(program_name) 259 @DOCSTRING(program_name)
245 260
246 @DOCSTRING(program_invocation_name) 261 @DOCSTRING(program_invocation_name)
247 262
248 Here is an example of using these functions to reproduce Octave's 263 Here is an example of using these functions to reproduce the command
249 command line. 264 line which invoked Octave.
250 265
251 @example 266 @example
267 @group
252 printf ("%s", program_name ()); 268 printf ("%s", program_name ());
253 arg_list = argv (); 269 arg_list = argv ();
254 for i = 1:nargin 270 for i = 1:nargin
255 printf (" %s", arg_list@{i@}); 271 printf (" %s", arg_list@{i@});
256 endfor 272 endfor
257 printf ("\n"); 273 printf ("\n");
274 @end group
258 @end example 275 @end example
259 276
260 @noindent 277 @noindent
261 @xref{Index Expressions}, for an explanation of how to properly index 278 @xref{Indexing Cell Arrays}, for an explanation of how to retrieve objects
262 arrays of strings and substrings in Octave, and @xref{Defining Functions}, 279 from cell arrays, and @ref{Defining Functions}, for information about the
263 for information about the variable @code{nargin}. 280 variable @code{nargin}.
264 281
265 @node Startup Files 282 @node Startup Files
266 @subsection Startup Files 283 @subsection Startup Files
267 @cindex initialization 284 @cindex initialization
268 @cindex startup 285 @cindex startup
273 290
274 @cindex startup files 291 @cindex startup files
275 292
276 @table @code 293 @table @code
277 @item @var{octave-home}/share/octave/site/m/startup/octaverc 294 @item @var{octave-home}/share/octave/site/m/startup/octaverc
278 Where @var{octave-home} is the directory in which all of Octave is 295 @cindex site startup file
279 installed (the default is @file{@value{OCTAVEHOME}}). This file is 296 where @var{octave-home} is the directory in which Octave is installed
280 provided so that changes to the default Octave environment can be made 297 (the default is @file{@value{OCTAVEHOME}}).
281 globally for all users at your site for all versions of Octave you have 298 This file is provided so that changes to the default Octave environment
282 installed. Some care should be taken when making changes to this file, 299 can be made globally for all users at your site for all versions of Octave
283 since all users of Octave at your site will be affected. 300 you have installed. Care should be taken when making changes to this file
301 since all users of Octave at your site will be affected. The default file
302 may be overridden by the environment variable @w{@code{OCTAVE_SITE_INITFILE}}.
284 303
285 @item @var{octave-home}/share/octave/@var{version}/m/startup/octaverc 304 @item @var{octave-home}/share/octave/@var{version}/m/startup/octaverc
286 Where @var{octave-home} is the directory in which all of Octave is 305 @cindex version startup file
306 where @var{octave-home} is the directory in which Octave is
287 installed (the default is @file{@value{OCTAVEHOME}}), and @var{version} 307 installed (the default is @file{@value{OCTAVEHOME}}), and @var{version}
288 is the version number of Octave. This file is provided so that changes 308 is the version number of Octave. This file is provided so that changes
289 to the default Octave environment can be made globally for all users for 309 to the default Octave environment can be made globally for all users of
290 a particular version of Octave. Some care should be taken when making 310 a particular version of Octave. Care should be taken when making
291 changes to this file, since all users of Octave at your site will be 311 changes to this file since all users of Octave at your site will be
292 affected. 312 affected. The default file may be overridden by the environment variable
313 @w{@code{OCTAVE_VERSION_INITFILE}}.
293 314
294 @item ~/.octaverc 315 @item ~/.octaverc
316 @cindex personal startup file
295 @cindex @code{~/.octaverc} 317 @cindex @code{~/.octaverc}
296 This file is used to make personal changes to the default 318 This file is used to make personal changes to the default
297 Octave environment. 319 Octave environment.
298 320
299 @item .octaverc 321 @item .octaverc
322 @cindex project startup file
300 @cindex @code{.octaverc} 323 @cindex @code{.octaverc}
301 This file can be used to make changes to the default Octave environment 324 This file can be used to make changes to the default Octave environment
302 for a particular project. Octave searches for this file in the current 325 for a particular project. Octave searches for this file in the current
303 directory after it reads @file{~/.octaverc}. Any use of the @code{cd} 326 directory after it reads @file{~/.octaverc}. Any use of the @code{cd}
304 command in the @file{~/.octaverc} file will affect the directory where 327 command in the @file{~/.octaverc} file will affect the directory where
752 775
753 @noindent 776 @noindent
754 Octave will respond immediately with a message like this: 777 Octave will respond immediately with a message like this:
755 778
756 @example 779 @example
780 @group
757 parse error: 781 parse error:
758 782
759 syntax error 783 syntax error
760 784
761 >>> functon y = f (x) y = x^2; endfunction 785 >>> functon y = f (x) y = x^2; endfunction
762 ^ 786 ^
787 @end group
763 @end example 788 @end example
764 789
765 @noindent 790 @noindent
766 For most parse errors, Octave uses a caret (@samp{^}) to mark the point 791 For most parse errors, Octave uses a caret (@samp{^}) to mark the point
767 on the line where it was unable to make sense of your input. In this 792 on the line where it was unable to make sense of your input. In this