annotate libinterp/usage.h @ 31214:19bd1953fc1d stable

GitHub-CI: Remove ubuntu-18.04 runners from build matrix. * .github/workflow/make.yaml (ubuntu): GitHub-hosted runners for ubuntu-18.04 are being deprecated. Remove them from build matrix. See also: https://github.com/actions/runner-images/issues/6002
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 30 Aug 2022 11:16:27 +0200
parents 796f54d4ddbf
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29949
diff changeset
3 // Copyright (C) 1993-2022 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
29898
dffd1c943f1a main.cc: Use getopt to parse command line arguments (bug #60886).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
26 #if ! defined (octave_usage_h)
dffd1c943f1a main.cc: Use getopt to parse command line arguments (bug #60886).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
27 #define octave_usage_h 1
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
29 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
30
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 #include <iosfwd>
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 #include "version.h"
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 // Usage message
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 static const char *usage_string =
29949
f254c302bb9c remove JIT compiler from Octave sources
John W. Eaton <jwe@octave.org>
parents: 29899
diff changeset
37 "octave [-HVWdfhiqvx] [--debug] [--doc-cache-file file] [--echo-commands]\n\
f254c302bb9c remove JIT compiler from Octave sources
John W. Eaton <jwe@octave.org>
parents: 29899
diff changeset
38 [--eval CODE] [--exec-path path] [--experimental-terminal-widget]\n\
f254c302bb9c remove JIT compiler from Octave sources
John W. Eaton <jwe@octave.org>
parents: 29899
diff changeset
39 [--gui] [--help] [--image-path path] [--info-file file]\n\
f254c302bb9c remove JIT compiler from Octave sources
John W. Eaton <jwe@octave.org>
parents: 29899
diff changeset
40 [--info-program prog] [--interactive] [--line-editing] [--no-gui]\n\
f254c302bb9c remove JIT compiler from Octave sources
John W. Eaton <jwe@octave.org>
parents: 29899
diff changeset
41 [--no-history] [--no-init-file] [--no-init-path] [--no-line-editing]\n\
17778
b5d58667d32d new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents: 17777
diff changeset
42 [--no-site-file] [--no-window-system] [--norc] [-p path]\n\
29254
11343ca3c125 allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents: 27957
diff changeset
43 [--path path] [--persist] [--server] [--silent] [--traditional]\n\
17778
b5d58667d32d new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents: 17777
diff changeset
44 [--verbose] [--version] [file]";
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 // Usage message with extra help.
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 static void
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 octave_print_verbose_usage_and_exit (void)
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 {
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 std::cout << octave_name_version_copyright_copying_and_warranty ()
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 << "\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 \n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 Usage: octave [options] [FILE]\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 \n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 Options:\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 \n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 --built-in-docstrings-file FILE Use docs for built-ins from FILE.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 --debug, -d Enter parser debugging mode.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 --doc-cache-file FILE Use doc cache file FILE.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 --echo-commands, -x Echo commands as they are executed.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 --eval CODE Evaluate CODE. Exit when done unless --persist.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 --exec-path PATH Set path for executing subprograms.\n\
29503
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
64 --experimental-terminal-widget\n\
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
65 Use new experimental terminal widget in the GUI.\n\
24874
a4dc2ef8741c Don't start GUI by default, require new '--gui' option
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
66 --gui Start the graphical user interface.\n\
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 --help, -h, Print short help message and exit.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 --image-path PATH Add PATH to head of image search path.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 --info-file FILE Use top-level info file FILE.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 --info-program PROGRAM Use PROGRAM for reading info files.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 --interactive, -i Force interactive behavior.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 --line-editing Force readline use for command-line editing.\n\
24878
4fdb160b47fb Keep the '--no-gui' option as the inverse of '--gui'
Mike Miller <mtmiller@octave.org>
parents: 24874
diff changeset
73 --no-gui Disable the graphical user interface.\n\
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 --no-history, -H Don't save commands to the history list\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 --no-init-file Don't read the ~/.octaverc or .octaverc files.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 --no-init-path Don't initialize function search path.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 --no-line-editing Don't use readline for command-line editing.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 --no-site-file Don't read the site-wide octaverc file.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 --no-window-system, -W Disable window system, including graphics.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 --norc, -f Don't read any initialization files.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 --path PATH, -p PATH Add PATH to head of function search path.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 --persist Go interactive after --eval or reading from FILE.\n\
29254
11343ca3c125 allow Octave to operate as a server, executing commands from a queue
John W. Eaton <jwe@octave.org>
parents: 27957
diff changeset
83 --server Enter server mode at startup.\n\
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 --silent, --quiet, -q Don't print message at startup.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 --texi-macros-file FILE Use Texinfo macros in FILE for makeinfo command.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 --traditional Set variables for closer MATLAB compatibility.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 --verbose, -V Enable verbose output in some cases.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 --version, -v Print version number and exit.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 \n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 FILE Execute commands from FILE. Exit when done\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 unless --persist is also specified.\n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 \n"
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93 << octave_www_statement ()
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 << "\n\n"
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 << octave_contrib_statement ()
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 << "\n\n"
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 << octave_bugs_statement ()
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 << "\n";
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 exit (0);
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 }
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102
27956
2310164737b3 fix many spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
103 // Terse usage message.
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 static void
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 octave_print_terse_usage_and_exit (void)
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 {
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 std::cerr << "\nusage: " << usage_string << "\n\n";
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 exit (1);
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 }
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 static void
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114 octave_print_version_and_exit (void)
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 {
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 std::cout << octave_name_version_copyright_copying_warranty_and_bugs ()
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 << "\n";
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 exit (0);
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 }
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 #endif