GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
usage.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1993-2025 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
36static const char *usage_string =
37 "octave [-GHVWefghiqvx] [--echo-commands] [--eval CODE]\n\
38 [--experimental-terminal-widget] [--gui] [--help] [--interactive]\n\
39 [--line-editing] [--no-gui] [--no-history] [--no-init-all]\n\
40 [--no-init-path] [--no-init-site] [--no-init-user]\n\
41 [--no-line-editing] [--no-window-system] [--path path] [--persist]\n\
42 [--quiet] [--server] [--traditional] [--version] [file]";
43
44// Usage message with extra help.
45
46static void
47octave_print_verbose_usage_and_exit ()
48{
50 << "\n\
51\n\
52Usage: octave [options] [FILE]\n\
53\n\
54Options:\n\
55\n"
56// FIXME: Disabled debug option for parser 2023-12-29.
57// Uncomment and restore code if Octave adds capability to
58// immediately enter debug mode for a script.
59//--debug, -d Enter debugging mode.\n\ //
60"\
61 --echo-commands, -x Echo commands as they are executed.\n\
62 --eval, -e CODE Evaluate CODE. Exit when done unless --persist.\n\
63 --experimental-terminal-widget\n\
64 Use new experimental terminal widget in the GUI.\n\
65 --gui, -g Start the graphical user interface.\n\
66 --help, -h, Print short help message and exit.\n\
67 --interactive, -i Force interactive behavior.\n\
68 --line-editing Force readline use for command-line editing.\n\
69 --no-gui, -G Disable the graphical user interface.\n\
70 --no-history, -H Don't save commands to the history list\n\
71 --no-init-all, --norc, -f\n\
72 Don't read any initialization files.\n\
73 --no-init-path Don't initialize function search path.\n\
74 --no-init-site Don't read the site-wide octaverc files.\n\
75 --no-init-user Don't read the ~/.octaverc or .octaverc files.\n\
76 --no-line-editing Don't use readline for command-line editing.\n\
77 --no-window-system, -W Disable window system, including graphics.\n\
78 --path PATH, -p PATH Add PATH to head of function search path.\n\
79 --persist Go interactive after --eval or reading from FILE.\n\
80 --server Enter server mode at startup.\n\
81 --quiet, --silent, -q Don't print message at startup.\n\
82 --traditional Set variables for closer MATLAB compatibility.\n\
83 --version, -v Print version number and exit.\n\
84\n\
85 FILE Execute commands from FILE. Exit when done\n\
86 unless --persist is also specified.\n\
87\n"
89 << "\n\n"
91 << "\n\n"
93 << "\n";
94
95 exit (0);
96}
97
98// Terse usage message.
99
100static void
101octave_print_terse_usage_and_exit ()
102{
103 std::cerr << "\nusage: " << usage_string << "\n\n";
104
105 exit (1);
106}
107
108static void
109octave_print_version_and_exit ()
110{
112 << "\n";
113 exit (0);
114}
115
116#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