GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
usage.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1993-2024 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_usage_h)
27 #define octave_usage_h 1
28 
29 #include "octave-config.h"
30 
31 #include <iosfwd>
32 
33 #include "version.h"
34 
35 // Usage message
36 static const char *usage_string =
37  "octave [-HVWdfhiqvx] [--debug] [--doc-cache-file file] [--echo-commands]\n\
38  [--eval CODE] [--exec-path path] [--experimental-terminal-widget]\n\
39  [--gui] [--help] [--image-path path] [--info-file file]\n\
40  [--info-program prog] [--interactive] [--line-editing] [--no-gui]\n\
41  [--no-history] [--no-init-file] [--no-init-path] [--no-line-editing]\n\
42  [--no-site-file] [--no-window-system] [--norc] [-p path]\n\
43  [--path path] [--persist] [--server] [--silent] [--traditional]\n\
44  [--verbose] [--version] [file]";
45 
46 // Usage message with extra help.
47 
48 static void
49 octave_print_verbose_usage_and_exit ()
50 {
52  << "\n\
53 \n\
54 Usage: octave [options] [FILE]\n\
55 \n\
56 Options:\n\
57 \n\
58  --built-in-docstrings-file FILE Use docs for built-ins from FILE.\n\
59  --debug, -d Enter parser debugging mode.\n\
60  --doc-cache-file FILE Use doc cache file FILE.\n\
61  --echo-commands, -x Echo commands as they are executed.\n\
62  --eval CODE Evaluate CODE. Exit when done unless --persist.\n\
63  --exec-path PATH Set path for executing subprograms.\n\
64  --experimental-terminal-widget\n\
65  Use new experimental terminal widget in the GUI.\n\
66  --gui Start the graphical user interface.\n\
67  --help, -h, Print short help message and exit.\n\
68  --image-path PATH Add PATH to head of image search path.\n\
69  --info-file FILE Use top-level info file FILE.\n\
70  --info-program PROGRAM Use PROGRAM for reading info files.\n\
71  --interactive, -i Force interactive behavior.\n\
72  --line-editing Force readline use for command-line editing.\n\
73  --no-gui Disable the graphical user interface.\n\
74  --no-history, -H Don't save commands to the history list\n\
75  --no-init-file Don't read the ~/.octaverc or .octaverc files.\n\
76  --no-init-path Don't initialize function search path.\n\
77  --no-line-editing Don't use readline for command-line editing.\n\
78  --no-site-file Don't read the site-wide octaverc file.\n\
79  --no-window-system, -W Disable window system, including graphics.\n\
80  --norc, -f Don't read any initialization files.\n\
81  --path PATH, -p PATH Add PATH to head of function search path.\n\
82  --persist Go interactive after --eval or reading from FILE.\n\
83  --server Enter server mode at startup.\n\
84  --silent, --quiet, -q Don't print message at startup.\n\
85  --texi-macros-file FILE Use Texinfo macros in FILE for makeinfo command.\n\
86  --traditional Set variables for closer MATLAB compatibility.\n\
87  --verbose, -V Enable verbose output in some cases.\n\
88  --version, -v Print version number and exit.\n\
89 \n\
90  FILE Execute commands from FILE. Exit when done\n\
91  unless --persist is also specified.\n\
92 \n"
94  << "\n\n"
96  << "\n\n"
98  << "\n";
99 
100  exit (0);
101 }
102 
103 // Terse usage message.
104 
105 static void
106 octave_print_terse_usage_and_exit ()
107 {
108  std::cerr << "\nusage: " << usage_string << "\n\n";
109 
110  exit (1);
111 }
112 
113 static void
114 octave_print_version_and_exit ()
115 {
117  << "\n";
118  exit (0);
119 }
120 
121 #endif
std::string octave_name_version_copyright_copying_and_warranty(bool html, const std::string &extra_info)
Definition: version.cc:84
std::string octave_bugs_statement(bool html)
Definition: version.cc:63
std::string octave_www_statement(bool html)
Definition: version.cc:49
std::string octave_name_version_copyright_copying_warranty_and_bugs(bool html, const std::string &extra_info)
Definition: version.cc:102
std::string octave_contrib_statement(bool html)
Definition: version.cc:56