annotate libinterp/usage.h @ 33625:d213a148b3f1 default tip @

ensure exp. terminal widget has focus at startup * main-window.cc (main_window): call focus_command_window only if event loop is idle by using a single shot timer * main-window.h: make focus_command_window a public slot
author Torsten Lilge <ttl-octave@mailbox.org>
date Sun, 26 May 2024 02:29:44 +0200
parents 25e8f63da459
children
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 //
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 =
32671
fe4976232a24 Remove '--debug' option to octave executable.
Rik <rik@octave.org>
parents: 32669
diff changeset
37 "octave [-GHVWefghiqvx] [--echo-commands] [--eval CODE]\n\
32672
161649505a09 Don't display --info-file, --info-program developer-only options in Octave usage messages.
Rik <rik@octave.org>
parents: 32671
diff changeset
38 [--experimental-terminal-widget] [--gui] [--help] [--interactive]\n\
32678
49d6ecd07a76 Rename command-line options for handling configuration files.
Rik <rik@octave.org>
parents: 32677
diff changeset
39 [--line-editing] [--no-gui] [--no-history] [--no-init-all]\n\
49d6ecd07a76 Rename command-line options for handling configuration files.
Rik <rik@octave.org>
parents: 32677
diff changeset
40 [--no-init-path] [--no-init-site] [--no-init-user]\n\
49d6ecd07a76 Rename command-line options for handling configuration files.
Rik <rik@octave.org>
parents: 32677
diff changeset
41 [--no-line-editing] [--no-window-system] [--path path] [--persist]\n\
32680
25e8f63da459 Prefer --quiet to --silent in Octave.
Rik <rik@octave.org>
parents: 32678
diff changeset
42 [--quiet] [--server] [--traditional] [--version] [file]";
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 // 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
45
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 static void
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
47 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
48 {
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 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
50 << "\n\
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 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
53 \n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 Options:\n\
32671
fe4976232a24 Remove '--debug' option to octave executable.
Rik <rik@octave.org>
parents: 32669
diff changeset
55 \n"
fe4976232a24 Remove '--debug' option to octave executable.
Rik <rik@octave.org>
parents: 32669
diff changeset
56 // FIXME: Disabled debug option for parser 2023-12-29.
fe4976232a24 Remove '--debug' option to octave executable.
Rik <rik@octave.org>
parents: 32669
diff changeset
57 // Uncomment and restore code if Octave adds capability to
fe4976232a24 Remove '--debug' option to octave executable.
Rik <rik@octave.org>
parents: 32669
diff changeset
58 // immediately enter debug mode for a script.
fe4976232a24 Remove '--debug' option to octave executable.
Rik <rik@octave.org>
parents: 32669
diff changeset
59 //--debug, -d Enter debugging mode.\n\ //
fe4976232a24 Remove '--debug' option to octave executable.
Rik <rik@octave.org>
parents: 32669
diff changeset
60 "\
17777
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\
32671
fe4976232a24 Remove '--debug' option to octave executable.
Rik <rik@octave.org>
parents: 32669
diff changeset
62 --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
63 --experimental-terminal-widget\n\
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
64 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
65 --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
66 --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
67 --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
68 --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
69 --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
70 --no-history, -H Don't save commands to the history list\n\
32678
49d6ecd07a76 Rename command-line options for handling configuration files.
Rik <rik@octave.org>
parents: 32677
diff changeset
71 --no-init-all, --norc, -f\n\
49d6ecd07a76 Rename command-line options for handling configuration files.
Rik <rik@octave.org>
parents: 32677
diff changeset
72 Don't read any initialization files.\n\
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 --no-init-path Don't initialize function search path.\n\
32678
49d6ecd07a76 Rename command-line options for handling configuration files.
Rik <rik@octave.org>
parents: 32677
diff changeset
74 --no-init-site Don't read the site-wide octaverc files.\n\
49d6ecd07a76 Rename command-line options for handling configuration files.
Rik <rik@octave.org>
parents: 32677
diff changeset
75 --no-init-user Don't read the ~/.octaverc or .octaverc files.\n\
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 --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
77 --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
78 --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
79 --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
80 --server Enter server mode at startup.\n\
32680
25e8f63da459 Prefer --quiet to --silent in Octave.
Rik <rik@octave.org>
parents: 32678
diff changeset
81 --quiet, --silent, -q Don't print message at startup.\n\
17777
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 --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
83 --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
84 \n\
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 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
86 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
87 \n"
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 << octave_www_statement ()
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 << "\n\n"
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 << octave_contrib_statement ()
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 << "\n\n"
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 << octave_bugs_statement ()
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93 << "\n";
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 exit (0);
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 }
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97
27956
2310164737b3 fix many spelling errors (bug #57613)
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
98 // Terse usage message.
17777
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 static void
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
101 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
102 {
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 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
104
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 exit (1);
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
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 static void
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
109 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
110 {
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 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
112 << "\n";
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 exit (0);
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
ae8905fbf1f8 move usage and options strings and funtions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 #endif