Mercurial > octave
annotate libinterp/usage.h @ 32669:b18af44b044b
Add new short form aliases of runtime long form options to octave.
Add '-e CODE' for '--eval CODE', '-g' for '--gui', '-G' for '--no-gui'.
* NEWS.10.md: Announce 3 new aliases.
* basics.txi: Update Octave manual with new aliases.
* octave.cc (cmdline_options): Update case statements to use new identifiers.
* options.h (*short_opts): Update list of short form opts to include 'G','e','g'.
* options.h: Remove EVAL_OPTION, GUI_OPTION, NO_GUI_OPTION from list of #defines
and renumber existing getopt options.
* options.h (long_opts[]): Update getopts structure to allow 'e' for '--eval',
'-g' for '--gui' or '--force-gui', '-G', for '--no-gui'.
* usage.h (*usage_string): Update usage to include 'G','e','g'.
* main.in.cc (main): Update case statements to use new identifiers.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 29 Dec 2023 16:03:06 -0800 |
parents | 0a98169f67f0 |
children | fe4976232a24 |
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 // |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31771
diff
changeset
|
3 // Copyright (C) 1993-2024 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 = |
32669
b18af44b044b
Add new short form aliases of runtime long form options to octave.
Rik <rik@octave.org>
parents:
32668
diff
changeset
|
37 "octave [-GHVWdefghiqvx] [--debug] [--echo-commands] [--eval CODE]\n\ |
32668
0a98169f67f0
Don't display developer-only options in Octave usage messages.
Rik <rik@octave.org>
parents:
32632
diff
changeset
|
38 [--experimental-terminal-widget] [--gui] [--help] [--info-file file]\n\ |
29949
f254c302bb9c
remove JIT compiler from Octave sources
John W. Eaton <jwe@octave.org>
parents:
29899
diff
changeset
|
39 [--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
|
40 [--no-history] [--no-init-file] [--no-init-path] [--no-line-editing]\n\ |
32668
0a98169f67f0
Don't display developer-only options in Octave usage messages.
Rik <rik@octave.org>
parents:
32632
diff
changeset
|
41 [--no-site-file] [--no-window-system] [--norc] [--path path]\n\ |
0a98169f67f0
Don't display developer-only options in Octave usage messages.
Rik <rik@octave.org>
parents:
32632
diff
changeset
|
42 [--persist] [--server] [--silent] [--traditional] [--verbose]\n\ |
0a98169f67f0
Don't display developer-only options in Octave usage messages.
Rik <rik@octave.org>
parents:
32632
diff
changeset
|
43 [--version] [file]"; |
17777
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 // 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
|
46 |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 static void |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
48 octave_print_verbose_usage_and_exit () |
17777
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 { |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 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
|
51 << "\n\ |
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 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
|
54 \n\ |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 Options:\n\ |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 \n\ |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 --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
|
58 --echo-commands, -x Echo commands as they are executed.\n\ |
32669
b18af44b044b
Add new short form aliases of runtime long form options to octave.
Rik <rik@octave.org>
parents:
32668
diff
changeset
|
59 --eval,-e CODE Evaluate CODE. Exit when done unless --persist.\n\ |
29503
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
60 --experimental-terminal-widget\n\ |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
61 Use new experimental terminal widget in the GUI.\n\ |
32669
b18af44b044b
Add new short form aliases of runtime long form options to octave.
Rik <rik@octave.org>
parents:
32668
diff
changeset
|
62 --gui, -g 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
|
63 --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
|
64 --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
|
65 --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
|
66 --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
|
67 --line-editing Force readline use for command-line editing.\n\ |
32669
b18af44b044b
Add new short form aliases of runtime long form options to octave.
Rik <rik@octave.org>
parents:
32668
diff
changeset
|
68 --no-gui, -G 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
|
69 --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
|
70 --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
|
71 --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
|
72 --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
|
73 --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
|
74 --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
|
75 --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
|
76 --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
|
77 --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
|
78 --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
|
79 --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
|
80 --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
|
81 --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
|
82 --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
|
83 \n\ |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 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
|
85 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
|
86 \n" |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 << octave_www_statement () |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
88 << "\n\n" |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
89 << octave_contrib_statement () |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
90 << "\n\n" |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 << octave_bugs_statement () |
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 |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
94 exit (0); |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
95 } |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
96 |
27956
2310164737b3
fix many spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
97 // Terse usage message. |
17777
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
98 |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
99 static void |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
100 octave_print_terse_usage_and_exit () |
17777
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 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
|
103 |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
104 exit (1); |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
105 } |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
106 |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
107 static void |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
108 octave_print_version_and_exit () |
17777
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 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
|
111 << "\n"; |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
112 exit (0); |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
113 } |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
114 |
ae8905fbf1f8
move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
115 #endif |